From b0af8b22e4c674bd296ef49c5291a112fb9dbfb8 Mon Sep 17 00:00:00 2001 From: Luc Date: Sat, 27 Jan 2024 15:38:37 +0000 Subject: [PATCH] Introduce Expired Screen --- components/POAPModal/POAPModal.tsx | 9 ++++++++- components/POAPModal/stages/Expired.tsx | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 components/POAPModal/stages/Expired.tsx diff --git a/components/POAPModal/POAPModal.tsx b/components/POAPModal/POAPModal.tsx index 513c63f..a646ca1 100644 --- a/components/POAPModal/POAPModal.tsx +++ b/components/POAPModal/POAPModal.tsx @@ -8,6 +8,7 @@ import { IYKRefResponse as IYKReferenceResponse } from '../../hooks/useIYKRef'; import { POAPMetadata } from '../../hooks/usePOAPData'; import { Creeper } from './Creeper'; import { SHOW_POAP_ANYWAYS } from './settings'; +import { ExpiredPOAP } from './stages/Expired'; import { MintToProfile } from './stages/MintToProfile'; import { NameInput } from './stages/NameInput'; import { PendingApproval } from './stages/PendingApproval'; @@ -18,6 +19,7 @@ const HIDE_AFTER_TIME = 1000 * 60 * 60 * 24 * 100; const PENDING_APPROVAL = 'pending-approval'; const MINT_TO = 'mint-to'; const NAME_INPUT = 'name-input'; +const EXPIRED_STATE = 'expired'; const event_names = { frensday2023: 'frENSday 2023', @@ -67,7 +69,11 @@ export const POAPModal: FC<{ if (pendingApproval) { state = PENDING_APPROVAL; } else { - state = mintToProfile ? MINT_TO : NAME_INPUT; + if (poapEvent.status == 'expired') { + state = EXPIRED_STATE; + } else { + state = mintToProfile ? MINT_TO : NAME_INPUT; + } } return ( @@ -131,6 +137,7 @@ export const POAPModal: FC<{ event_name={event_name} /> )} + {state === EXPIRED_STATE && } {/*
diff --git a/components/POAPModal/stages/Expired.tsx b/components/POAPModal/stages/Expired.tsx new file mode 100644 index 0000000..8c4605f --- /dev/null +++ b/components/POAPModal/stages/Expired.tsx @@ -0,0 +1,18 @@ +import { FC } from 'react'; + +export const ExpiredPOAP: FC<{}> = () => { + return ( +
+ This POAP is expired and can no longer be redeemed. You can + reprogram your card{' '} + + via the IYK Dashboard + + . +
+ ); +};