From 84c49bb87bbe7022bfb133971ec25486696b6336 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 3 Jul 2024 17:31:15 -0300 Subject: [PATCH] Set up the airdrop to end on July 3rd at 23:59 UTC (#93) * Set up the airdrop to end on July 3rd at 23:59 UTC * fix prettier --- frontend/components/AirdropEnd.tsx | 117 +++++++++++++++++++++++++++++ frontend/pages/_app.tsx | 23 +++++- 2 files changed, 136 insertions(+), 4 deletions(-) create mode 100644 frontend/components/AirdropEnd.tsx diff --git a/frontend/components/AirdropEnd.tsx b/frontend/components/AirdropEnd.tsx new file mode 100644 index 00000000..ef9f1e6a --- /dev/null +++ b/frontend/components/AirdropEnd.tsx @@ -0,0 +1,117 @@ +import SocialIcons from '@components/SocialIcons' +import W from '@images/w.inline.svg' +import Wormhole from '@images/wormhole.inline.svg' +import Link from 'next/link' + +type LayoutProps = { + setDisclaimerWasRead: Function +} + +export const AirdropEnd = ({ setDisclaimerWasRead }: LayoutProps) => { + const today = new Date() + const year = today.getFullYear() + + return ( + <> +
+
+ + + + +
+ + Please verify that the site URL is:{' '} + https://airdrop.wormhole.com + +
+
+
+
+
+

+ The airdrop claim period has ended +

+

+ To stay in touch with future Wormhole community initiatives head + over to our{' '} + + Discord + {' '} +

+
+
+ + + ) +} diff --git a/frontend/pages/_app.tsx b/frontend/pages/_app.tsx index e1054e47..faf97afc 100644 --- a/frontend/pages/_app.tsx +++ b/frontend/pages/_app.tsx @@ -13,6 +13,7 @@ import { EcosystemProviders } from '@components/Ecosystem' import '../styles/globals.css' import { usePathname, useRouter, useSearchParams } from 'next/navigation' import { Layout } from '@components/Layout' +import { AirdropEnd } from '@components/AirdropEnd' import { Disclaimer } from '@components/modal/Disclaimer' import { PathnameStore, resetOnVersionMismatch } from 'utils/store' @@ -58,11 +59,13 @@ function useRedirect(isVersionChecked: boolean) { }, [params, pathname, isVersionChecked]) } +const end = new Date('2024-07-03T23:59:00.000Z') +const now = new Date() + const App: FC = ({ Component, pageProps }: AppProps) => { const router = useRouter() - const [disclaimerWasRead, setDisclaimerWasRead] = useState(false) - - const [isVersionChecked, setIsVersionChecked] = useState(false) + const [disclaimerWasRead, setDisclaimerWasRead] = useState(now > end) + const [isVersionChecked, setIsVersionChecked] = useState(now > end) // check if there is a version mismatch, if it is reload after reset // if no setIsVersionChecked to true, which will be used to render other things @@ -74,7 +77,19 @@ const App: FC = ({ Component, pageProps }: AppProps) => { // TODO Review this, we should check if the user // loads the page, we should redirect to welcome pages again // useRedirect(isVersionChecked) - + if (now > end) { + return ( + <> + + { + setDisclaimerWasRead(true) + }} + /> + + ) + } return ( <> {isVersionChecked ? (