Skip to content

Commit

Permalink
ref: remove expiry gift (#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
fricoben authored Sep 16, 2024
1 parent 2af05ee commit 6c2286f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
4 changes: 2 additions & 2 deletions components/discount/freeRegisterPresentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type FreeRegisterPresentationProps = {
title: { desc: string; catch: string; descAfter?: string };
desc: string;
image: string;
expiry: number;
expiry?: number;
};

const FreeRegisterPresentation: FunctionComponent<
Expand Down Expand Up @@ -42,7 +42,7 @@ const FreeRegisterPresentation: FunctionComponent<
className={styles.illustrationVariant}
alt="Registration illustration"
/>
<Timer expiry={expiry} fixed />
{expiry && <Timer expiry={expiry} fixed />}
</div>
</div>
</div>
Expand Down
11 changes: 1 addition & 10 deletions pages/gift.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -11,14 +11,6 @@ import FreeRegisterCheckout from "@/components/discount/freeRegisterCheckout";
const FreeRegistration: NextPage = () => {
const [searchResult, setSearchResult] = useState<SearchResult | undefined>();
const [screen, setScreen] = useState<number>(1);

useEffect(() => {
const currentDate = new Date();
const timestamp = currentDate.getTime();

if (timestamp >= freeRegistration.expiry) setScreen(0);
}, []);

const goBack = () => setScreen(screen - 1);

return (
Expand All @@ -36,7 +28,6 @@ const FreeRegistration: NextPage = () => {
image={freeRegistration.offer.image ?? freeRegistration.image}
setSearchResult={setSearchResult}
setScreen={setScreen}
expiry={freeRegistration.expiry}
/>
) : null}
{screen === 2 ? (
Expand Down

0 comments on commit 6c2286f

Please sign in to comment.