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

Function onClick

packages/shared/src/features/boost/BoostSourceButton.tsx:64–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62 openModal({ type: LazyModal.BoostedCampaignView, props: { campaign } });
63
64 const onClick = () => {
65 if (!permittedUser) {
66 return null;
67 }
68
69 if (campaignId) {
70 if (!isBooster) {
71 return null;
72 }
73
74 return onViewBoost();
75 }
76
77 const isPlaceholderImage = squad?.image?.includes('squad_placeholder');
78 const isMissingImage = !squad?.image || isPlaceholderImage;
79
80 if (isMissingImage || !squad?.headerImage || !squad?.description) {
81 openModal({
82 type: LazyModal.ActionSuccess,
83 props: {
84 size: ModalSize.XSmall,
85 content: {
86 title: 'Make your Squad boost-ready',
87 description: `Before we can launch your boost, your squad needs a few details. This isn't just red tape, we want your Squad to look its best and get the traction it deserves.`,
88 body: (
89 <div className="mt-2 flex flex-col gap-2">
90 <Requirement copy="Profile image" passed={!isMissingImage} />
91 <Requirement copy="Cover image" passed={!!squad?.headerImage} />
92 <Requirement
93 copy="Squad description"
94 passed={!!squad?.description}
95 />
96 <Typography
97 type={TypographyType.Body}
98 color={TypographyColor.Secondary}
99 className="mt-2"
100 >
101 Finish these in Squad settings to unlock boosting and make a
102 strong impression.
103 </Typography>
104 </div>
105 ),
106 },
107 cta: {
108 copy: 'Go to Squad settings',
109 icon: <SettingsIcon secondary />,
110 tag: 'a',
111 href: `${webappUrl}squads/${squad.handle}/edit`,
112 },
113 },
114 });
115 return null;
116 }
117
118 return onBoost();
119 };
120
121 const hasTooltip = campaignId && !isBooster && !!campaign;

Callers 4

CampaignListFunction · 0.70
handleClickFunction · 0.50
WorkspacePhotoItemFunction · 0.50
ShortcutTileFunction · 0.50

Calls 2

onViewBoostFunction · 0.70
onBoostFunction · 0.70

Tested by

no test coverage detected