diff --git a/components/discount/freeRegisterPresentation.tsx b/components/discount/freeRegisterPresentation.tsx index 2005b340..d4177953 100644 --- a/components/discount/freeRegisterPresentation.tsx +++ b/components/discount/freeRegisterPresentation.tsx @@ -10,7 +10,7 @@ type FreeRegisterPresentationProps = { title: { desc: string; catch: string; descAfter?: string }; desc: string; image: string; - expiry: number; + expiry?: number; }; const FreeRegisterPresentation: FunctionComponent< @@ -42,7 +42,7 @@ const FreeRegisterPresentation: FunctionComponent< className={styles.illustrationVariant} alt="Registration illustration" /> - + {expiry && } diff --git a/pages/gift.tsx b/pages/gift.tsx index 29c2ef8f..3c8ccad2 100644 --- a/pages/gift.tsx +++ b/pages/gift.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import React, { useState } from "react"; import type { NextPage } from "next"; import homeStyles from "../styles/Home.module.css"; import styles from "../styles/discount.module.css"; @@ -11,14 +11,6 @@ import FreeRegisterCheckout from "@/components/discount/freeRegisterCheckout"; const FreeRegistration: NextPage = () => { const [searchResult, setSearchResult] = useState(); const [screen, setScreen] = useState(1); - - useEffect(() => { - const currentDate = new Date(); - const timestamp = currentDate.getTime(); - - if (timestamp >= freeRegistration.expiry) setScreen(0); - }, []); - const goBack = () => setScreen(screen - 1); return ( @@ -36,7 +28,6 @@ const FreeRegistration: NextPage = () => { image={freeRegistration.offer.image ?? freeRegistration.image} setSearchResult={setSearchResult} setScreen={setScreen} - expiry={freeRegistration.expiry} /> ) : null} {screen === 2 ? (