({
className,
}: WithClassNameProps)
| 39 | }; |
| 40 | |
| 41 | export function PlusSaleBanner({ |
| 42 | className, |
| 43 | }: WithClassNameProps): ReactElement | null { |
| 44 | const { isActive, headline, description, code, label, theme } = usePlusSale(); |
| 45 | const [isDismissed, setIsDismissed] = useState(false); |
| 46 | |
| 47 | if (!isActive || isDismissed) { |
| 48 | return null; |
| 49 | } |
| 50 | |
| 51 | const isBlackFriday = theme === 'blackFriday'; |
| 52 | const style = isBlackFriday ? blackFridayStyle : summerStyle; |
| 53 | |
| 54 | return ( |
| 55 | <section |
| 56 | className={classNames( |
| 57 | 'relative isolate w-full overflow-hidden rounded-16 px-5 py-4 tablet:px-8 tablet:py-6', |
| 58 | isBlackFriday && 'border border-border-subtlest-tertiary', |
| 59 | className, |
| 60 | )} |
| 61 | style={{ background: style.background }} |
| 62 | > |
| 63 | <div |
| 64 | aria-hidden |
| 65 | className="pointer-events-none absolute inset-0 -z-1" |
| 66 | style={{ background: style.glow }} |
| 67 | /> |
| 68 | <DevPlusIcon |
| 69 | aria-hidden |
| 70 | secondary |
| 71 | className="opacity-80 absolute -bottom-12 -right-8 -z-1 hidden !size-52 rotate-12 mobileL:block" |
| 72 | style={{ color: style.mark }} |
| 73 | /> |
| 74 | <div |
| 75 | aria-hidden |
| 76 | className="pointer-events-none absolute inset-0 -z-1" |
| 77 | style={{ background: style.scrim }} |
| 78 | /> |
| 79 | |
| 80 | <div className="flex items-center gap-6"> |
| 81 | {/* pr-8 keeps the headline clear of the close button. */} |
| 82 | <div className="flex max-w-[34rem] flex-1 flex-col gap-2 pr-8"> |
| 83 | {isBlackFriday && ( |
| 84 | <Typography |
| 85 | tag={TypographyTag.Span} |
| 86 | type={TypographyType.Caption1} |
| 87 | className="uppercase tracking-widest" |
| 88 | style={{ color: plusBlackFridayAccent }} |
| 89 | bold |
| 90 | > |
| 91 | Black Friday |
| 92 | </Typography> |
| 93 | )} |
| 94 | <Typography |
| 95 | tag={TypographyTag.H2} |
| 96 | type={TypographyType.Title2} |
| 97 | color={TypographyColor.Primary} |
| 98 | bold |
nothing calls this directly
no test coverage detected