()
| 67 | const onViewBoost = () => router.push(getBoostManagerUrl(campaignId)); |
| 68 | |
| 69 | const onClick = () => { |
| 70 | if (!permittedUser) { |
| 71 | return null; |
| 72 | } |
| 73 | |
| 74 | if (campaignId) { |
| 75 | if (!isBooster) { |
| 76 | return null; |
| 77 | } |
| 78 | |
| 79 | return onViewBoost(); |
| 80 | } |
| 81 | |
| 82 | const isPlaceholderImage = squad?.image?.includes('squad_placeholder'); |
| 83 | const isMissingImage = !squad?.image || isPlaceholderImage; |
| 84 | |
| 85 | if (isMissingImage || !squad?.headerImage || !squad?.description) { |
| 86 | openModal({ |
| 87 | type: LazyModal.ActionSuccess, |
| 88 | props: { |
| 89 | size: ModalSize.XSmall, |
| 90 | content: { |
| 91 | title: 'Make your Squad boost-ready', |
| 92 | 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.`, |
| 93 | body: ( |
| 94 | <div className="mt-2 flex flex-col gap-2"> |
| 95 | <Requirement copy="Profile image" passed={!isMissingImage} /> |
| 96 | <Requirement copy="Cover image" passed={!!squad?.headerImage} /> |
| 97 | <Requirement |
| 98 | copy="Squad description" |
| 99 | passed={!!squad?.description} |
| 100 | /> |
| 101 | <Typography |
| 102 | type={TypographyType.Body} |
| 103 | color={TypographyColor.Secondary} |
| 104 | className="mt-2" |
| 105 | > |
| 106 | Finish these in Squad settings to unlock boosting and make a |
| 107 | strong impression. |
| 108 | </Typography> |
| 109 | </div> |
| 110 | ), |
| 111 | }, |
| 112 | cta: { |
| 113 | copy: 'Go to Squad settings', |
| 114 | icon: <SettingsIcon secondary />, |
| 115 | tag: 'a', |
| 116 | href: `${webappUrl}squads/${squad.handle}/edit`, |
| 117 | }, |
| 118 | }, |
| 119 | }); |
| 120 | return null; |
| 121 | } |
| 122 | |
| 123 | return onBoost(); |
| 124 | }; |
| 125 | |
| 126 | const hasTooltip = campaignId && !isBooster && !!campaign; |
no test coverage detected