MCPcopy Create free account
hub / github.com/dailydotdev/apps / PlusPlus

Function PlusPlus

packages/shared/src/components/plus/PlusPlus.tsx:27–84  ·  view source on GitHub ↗
({ className }: PlusPlusProps)

Source from the content-addressed store, hash-verified

25);
26
27export const PlusPlus = ({ className }: PlusPlusProps): ReactElement => {
28 const { user } = useAuthContext();
29 const { data: gifter, isPending } = useQuery({
30 queryKey: generateQueryKey(RequestKey.GifterUser, user),
31 queryFn: getPlusGifterUser,
32 enabled: Boolean(user?.isPlus),
33 staleTime: StaleTime.Default,
34 });
35
36 if (isPending) {
37 return (
38 <Container>
39 <Loader />
40 </Container>
41 );
42 }
43
44 const manageCopy = gifter
45 ? ''
46 : ` Manage your subscription anytime to update your plan, payment details, or preferences`;
47
48 return (
49 <Container className={className}>
50 <PlusUser
51 iconSize={IconSize.XSmall}
52 typographyType={TypographyType.Callout}
53 />
54 <div className="flex flex-col gap-2">
55 <Typography
56 type={TypographyType.Body}
57 bold
58 color={TypographyColor.Primary}
59 >
60 {`You're already a Plus member!`}
61 </Typography>
62 <Typography
63 type={TypographyType.Callout}
64 color={TypographyColor.Tertiary}
65 >
66 Thanks for supporting daily.dev and unlocking our most powerful
67 experience.{manageCopy}.
68 </Typography>
69 </div>
70 {!gifter && (
71 <Button
72 tag="a"
73 className="max-w-48"
74 size={ButtonSize.Small}
75 variant={ButtonVariant.Secondary}
76 href={managePlusUrl}
77 target="_blank"
78 >
79 Manage subscription
80 </Button>
81 )}
82 </Container>
83 );
84};

Callers

nothing calls this directly

Calls 2

useAuthContextFunction · 0.90
generateQueryKeyFunction · 0.90

Tested by

no test coverage detected