|
1 | 1 | 'use client'; |
2 | 2 |
|
3 | | -import { ReactElement } from 'react'; |
4 | | - |
5 | | -// import { MouseEvent, ReactElement, useEffect, useState } from 'react'; |
6 | | -// import { motion } from 'framer-motion'; |
7 | | -// import { |
8 | | -// MegaphoneIcon, |
9 | | -// VideoCameraIcon, |
10 | | -// XMarkIcon, |
11 | | -// } from '@heroicons/react/24/outline'; |
| 3 | +import { MouseEvent, ReactElement, useEffect, useState } from 'react'; |
| 4 | +import { motion } from 'framer-motion'; |
| 5 | +import { |
| 6 | + MegaphoneIcon, |
| 7 | + VideoCameraIcon, |
| 8 | + XMarkIcon, |
| 9 | +} from '@heroicons/react/24/outline'; |
12 | 10 |
|
13 | 11 | export function WebinarNotifier(): ReactElement | null { |
14 | | - return null; |
15 | | - |
16 | | - // const [isMounted, setIsMounted] = useState(false); |
17 | | - // const [isVisible, setIsVisible] = useState<boolean>(true); |
18 | | - // const localStorageKey = 'webinar-october-27-2025--notifier-closed'; |
| 12 | + const [isMounted, setIsMounted] = useState(false); |
| 13 | + const [isVisible, setIsVisible] = useState<boolean>(true); |
| 14 | + const localStorageKey = 'webinar-november-19-2025--notifier-closed'; |
19 | 15 |
|
20 | | - // useEffect(() => { |
21 | | - // setIsMounted(true); |
22 | | - // const isClosedSession = localStorage.getItem(localStorageKey); |
23 | | - // if (isClosedSession === 'true') { |
24 | | - // setIsVisible(false); |
25 | | - // } |
26 | | - // }, []); |
| 16 | + useEffect(() => { |
| 17 | + setIsMounted(true); |
| 18 | + const isClosedSession = localStorage.getItem(localStorageKey); |
| 19 | + if (isClosedSession === 'true') { |
| 20 | + setIsVisible(false); |
| 21 | + } |
| 22 | + }, []); |
27 | 23 |
|
28 | | - // const closeNotifier = (e: MouseEvent) => { |
29 | | - // e.stopPropagation(); |
30 | | - // setIsVisible(false); |
31 | | - // localStorage.setItem(localStorageKey, 'true'); |
32 | | - // }; |
| 24 | + const closeNotifier = (e: MouseEvent) => { |
| 25 | + e.stopPropagation(); |
| 26 | + setIsVisible(false); |
| 27 | + localStorage.setItem(localStorageKey, 'true'); |
| 28 | + }; |
33 | 29 |
|
34 | | - // if (!isMounted || !isVisible) return null; |
| 30 | + if (!isMounted || !isVisible) return null; |
35 | 31 |
|
36 | | - // return ( |
37 | | - // <motion.div |
38 | | - // layout |
39 | | - // initial={{ y: '120%' }} |
40 | | - // animate={{ y: 0 }} |
41 | | - // exit={{ y: '120%' }} |
42 | | - // transition={{ |
43 | | - // type: 'spring', |
44 | | - // stiffness: 300, |
45 | | - // damping: 30, |
46 | | - // mass: 1, |
47 | | - // }} |
48 | | - // className="fixed bottom-0 left-0 right-0 z-30 w-full overflow-hidden bg-slate-950 text-white shadow-lg md:bottom-4 md:left-auto md:right-4 md:w-[512px] md:rounded-lg" |
49 | | - // style={{ originY: 1 }} |
50 | | - // > |
51 | | - // <div className="relative p-4"> |
52 | | - // <button |
53 | | - // onClick={closeNotifier} |
54 | | - // className="absolute right-2 top-2 flex h-9 w-9 cursor-pointer items-center justify-center !rounded-full bg-transparent p-1 hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-white" |
55 | | - // > |
56 | | - // <XMarkIcon className="size-5" aria-hidden="true" /> |
57 | | - // <span className="sr-only">Close</span> |
58 | | - // </button> |
59 | | - // <div> |
60 | | - // <motion.h3 |
61 | | - // layout="position" |
62 | | - // className="flex items-center gap-2 pr-8 text-lg font-semibold" |
63 | | - // > |
64 | | - // <MegaphoneIcon |
65 | | - // aria-hidden="true" |
66 | | - // className="size-8 flex-shrink-0" |
67 | | - // /> |
68 | | - // <span>Get 70% More Performance From Your CI</span> |
69 | | - // </motion.h3> |
70 | | - // <motion.div key="live-event" className="mt-4 space-y-4"> |
71 | | - // <p className="mb-2 text-sm"> |
72 | | - // Join Nx co-founders, Jeff Cross and Victor Savkin, in our Oct. |
73 | | - // 27th webinar. Learn how to optimize your CI beyond just caching. |
74 | | - // </p> |
75 | | - // <div className="flex flex-wrap items-center justify-end gap-1 sm:gap-4"> |
76 | | - // <a |
77 | | - // title="Signup" |
78 | | - // href="https://bit.ly/48iV9DZ" |
79 | | - // target="_blank" |
80 | | - // rel="noopener noreferrer" |
81 | | - // className="inline-flex items-center justify-center gap-2 rounded-lg bg-pink-600 px-2 py-2 text-sm font-semibold text-white no-underline transition hover:bg-pink-700 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 active:text-black/70 md:px-4" |
82 | | - // > |
83 | | - // <VideoCameraIcon aria-hidden="true" className="size-4" /> |
84 | | - // <span>Sign Up Now</span> |
85 | | - // </a> |
86 | | - // </div> |
87 | | - // </motion.div> |
88 | | - // </div> |
89 | | - // </div> |
90 | | - // </motion.div> |
91 | | - // ); |
| 32 | + return ( |
| 33 | + <motion.div |
| 34 | + layout |
| 35 | + initial={{ y: '120%' }} |
| 36 | + animate={{ y: 0 }} |
| 37 | + exit={{ y: '120%' }} |
| 38 | + transition={{ |
| 39 | + type: 'spring', |
| 40 | + stiffness: 300, |
| 41 | + damping: 30, |
| 42 | + mass: 1, |
| 43 | + }} |
| 44 | + className="fixed bottom-0 left-0 right-0 z-30 w-full overflow-hidden bg-slate-950 text-white shadow-lg md:bottom-4 md:left-auto md:right-4 md:w-[512px] md:rounded-lg" |
| 45 | + style={{ originY: 1 }} |
| 46 | + > |
| 47 | + <div className="relative p-4"> |
| 48 | + <button |
| 49 | + onClick={closeNotifier} |
| 50 | + className="absolute right-2 top-2 flex h-9 w-9 cursor-pointer items-center justify-center !rounded-full bg-transparent p-1 hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-white" |
| 51 | + > |
| 52 | + <XMarkIcon className="size-5" aria-hidden="true" /> |
| 53 | + <span className="sr-only">Close</span> |
| 54 | + </button> |
| 55 | + <div> |
| 56 | + <motion.h3 |
| 57 | + layout="position" |
| 58 | + className="flex items-center gap-2 pr-8 text-lg font-semibold" |
| 59 | + > |
| 60 | + <MegaphoneIcon |
| 61 | + aria-hidden="true" |
| 62 | + className="size-8 flex-shrink-0" |
| 63 | + /> |
| 64 | + <span>Unlock 3x More Performance From Your CI</span> |
| 65 | + </motion.h3> |
| 66 | + <motion.div key="live-event" className="mt-4 space-y-4"> |
| 67 | + <p className="mb-2 text-sm"> |
| 68 | + Join Nx co-founder Jeff Cross and Madeline Hennessy on Nov. 19th. |
| 69 | + See how Nx features compound to multiply your gains. |
| 70 | + </p> |
| 71 | + <div className="flex flex-wrap items-center justify-end gap-1 sm:gap-4"> |
| 72 | + <a |
| 73 | + title="Signup" |
| 74 | + href="https://bit.ly/496NV6n" |
| 75 | + target="_blank" |
| 76 | + rel="noopener noreferrer" |
| 77 | + className="inline-flex items-center justify-center gap-2 rounded-lg bg-pink-600 px-2 py-2 text-sm font-semibold text-white no-underline transition hover:bg-pink-700 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 active:text-black/70 md:px-4" |
| 78 | + > |
| 79 | + <VideoCameraIcon aria-hidden="true" className="size-4" /> |
| 80 | + <span>Sign Up Now</span> |
| 81 | + </a> |
| 82 | + </div> |
| 83 | + </motion.div> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + </motion.div> |
| 87 | + ); |
92 | 88 | } |
0 commit comments