-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: dub refer embed #20258
base: main
Are you sure you want to change the base?
feat: dub refer embed #20258
Conversation
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (03/20/25)1 reviewer was added to this PR based on Keith Williams's automation. |
import ReferralClient from "@calcom/features/dub/ReferralClient"; | ||
import { IS_DUB_REFERRALS_ENABLED } from "@calcom/lib/constants"; | ||
import { useLocale } from "@calcom/lib/hooks/useLocale"; | ||
import { SkeletonAvatar, SkeletonButton, SkeletonContainer, SkeletonText } from "@calcom/ui/skeleton"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { SkeletonAvatar, SkeletonButton, SkeletonContainer, SkeletonText } from "@calcom/ui/skeleton"; | |
import { SkeletonAvatar, SkeletonButton, SkeletonContainer, SkeletonText } from "@calcom/ui/components/skeleton"; |
import { IS_DUB_REFERRALS_ENABLED } from "@calcom/lib/constants"; | ||
import { useLocale } from "@calcom/lib/hooks/useLocale"; | ||
import { SkeletonAvatar, SkeletonButton, SkeletonContainer, SkeletonText } from "@calcom/ui/skeleton"; | ||
import { showToast } from "@calcom/ui/toast"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { showToast } from "@calcom/ui/toast"; | |
import { showToast } from "@calcom/ui/components/toast"; |
}; | ||
|
||
// The enabled referrals page implementation | ||
const EnabledReferralsPage = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would move this to refer/EnabledReferralsPage.tsx
}; | ||
|
||
// Export the appropriate component based on the feature flag | ||
export default function ReferralsPage() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be async
|
||
// Export the appropriate component based on the feature flag | ||
export default function ReferralsPage() { | ||
const { t } = useLocale(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be const t = await getTranslate()
;
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
} | ||
|
||
try { | ||
const session = await getServerSession({ req: buildLegacyRequest(headers(), cookies()) }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const session = await getServerSession({ req: buildLegacyRequest(headers(), cookies()) }); | |
const session = await getServerSession({ req: buildLegacyRequest(await headers(), await cookies()) }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we're merging Next.js 15 in a moment
|
||
import { IS_DUB_REFERRALS_ENABLED } from "@calcom/lib/constants"; | ||
|
||
const ReferralClientImpl = ({ publicToken }: { publicToken: string }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- if this is used in apps/web/app only, it can exist there. better be in
refer
dir - that also means
@dub/embed-react
can only be inapps/web/package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
…b-referral-embed
E2E results are ready! |
return null; | ||
} | ||
|
||
if (loading || !token) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use loading.tsx Pattern instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loader for Shell Sidebar and Page loads differently so it looks weird??
Screencast.from.2025-03-24.14-28-14.webm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of loading.tsx, should I wrap the DubReferralsPage is Suspense? @zomars
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request |
What does this PR do?
Demo
https://www.loom.com/share/86aadaaf8fef486387fde9ebfae73305

Mandatory Tasks (DO NOT REMOVE)
How should this be tested?