From 6c2286f7be2aa94937cb9fc4b9631cb567c3ba82 Mon Sep 17 00:00:00 2001 From: Fricoben <78437165+fricoben@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:37:58 -0300 Subject: [PATCH] ref: remove expiry gift (#879) --- components/discount/freeRegisterPresentation.tsx | 4 ++-- pages/gift.tsx | 11 +---------- 2 files changed, 3 insertions(+), 12 deletions(-) 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 ? (