({ flags, campaignId }: MarketingCta)
| 40 | ]; |
| 41 | |
| 42 | const PlusGrid = ({ flags, campaignId }: MarketingCta) => { |
| 43 | const { logEvent } = useLogContext(); |
| 44 | const { clearMarketingCta } = useBoot(); |
| 45 | const isApiLanding = useFeature(featurePlusApiLanding); |
| 46 | |
| 47 | if (!flags) { |
| 48 | return null; |
| 49 | } |
| 50 | const { title, description, ctaText, ctaUrl } = flags; |
| 51 | const ctaColor = isApiLanding ? ButtonColor.Bacon : ButtonColor.Avocado; |
| 52 | |
| 53 | const handleClose = () => { |
| 54 | logEvent({ |
| 55 | event_name: LogEvent.MarketingCtaDismiss, |
| 56 | target_type: TargetType.PlusEntryCard, |
| 57 | target_id: campaignId, |
| 58 | }); |
| 59 | clearMarketingCta(campaignId); |
| 60 | }; |
| 61 | |
| 62 | const handleClick = () => { |
| 63 | logEvent({ |
| 64 | event_name: LogEvent.ClickPlusFeature, |
| 65 | target_type: TargetType.PlusEntryCard, |
| 66 | target_id: campaignId, |
| 67 | }); |
| 68 | clearMarketingCta(campaignId); |
| 69 | }; |
| 70 | |
| 71 | return ( |
| 72 | <div className="plus-entry-gradient relative overflow-hidden rounded-b-16 p-4 pb-6"> |
| 73 | <div className="flex flex-col gap-4"> |
| 74 | <div className="flex items-center justify-between"> |
| 75 | <div className="flex items-center gap-2"> |
| 76 | <div className="rounded-8 bg-action-plus-float p-1"> |
| 77 | <DevPlusIcon className="fill-action-plus-default" /> |
| 78 | </div> |
| 79 | <Typography |
| 80 | tag={TypographyTag.H3} |
| 81 | type={TypographyType.Title3} |
| 82 | bold |
| 83 | > |
| 84 | {title} |
| 85 | </Typography> |
| 86 | </div> |
| 87 | <CloseButton onClick={handleClose} /> |
| 88 | </div> |
| 89 | |
| 90 | <div className="flex flex-col gap-4"> |
| 91 | <Typography |
| 92 | tag={TypographyTag.P} |
| 93 | type={TypographyType.Callout} |
| 94 | color={TypographyColor.Secondary} |
| 95 | > |
| 96 | {description} |
| 97 | </Typography> |
| 98 | |
| 99 | <div className="flex w-full flex-col gap-1"> |
nothing calls this directly
no test coverage detected