From 0c70f1f76f439353aa4cd58d953af6fb00fbe425 Mon Sep 17 00:00:00 2001 From: 0xTxbi Date: Tue, 17 Dec 2024 21:57:08 +0100 Subject: [PATCH] more cleanup --- .../content/event/LockDeploying.tsx | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/unlock-app/src/components/content/event/LockDeploying.tsx b/unlock-app/src/components/content/event/LockDeploying.tsx index 93836f803a1..13c53a8cb82 100644 --- a/unlock-app/src/components/content/event/LockDeploying.tsx +++ b/unlock-app/src/components/content/event/LockDeploying.tsx @@ -23,11 +23,9 @@ export const LockDeploying = ({ const config = useConfig() const router = useRouter() const [loadingEventPage, setLoadingEventPage] = useState(false) - const [eventData, setEventData] = useState<{ - status: EventStatus - }>({ - status: EventStatus.PENDING, - }) + const [eventStatus, setEventStatus] = useState( + EventStatus.PENDING + ) const { hash: transactionHash, network, slug } = transactionDetails const [title, setTitle] = useState('Waiting for your transaction to be mined') @@ -39,13 +37,13 @@ export const LockDeploying = ({ // Update title and message when event is deployed useEffect(() => { - if (eventData.status === EventStatus.DEPLOYED) { + if (eventStatus === EventStatus.DEPLOYED) { setTitle('🚀​ Your contract was successfully deployed') setMessage( 'Did you know that you can airdrop tickets to your fren by sending them email?' ) } - }, [eventData.status]) + }, [eventStatus]) // Poll for event status every 5 seconds useInterval( @@ -53,14 +51,13 @@ export const LockDeploying = ({ if (!slug) return try { const { data: event } = await locksmith.getEvent(slug) - setEventData({ - status: event.data?.status as EventStatus, - }) + // @ts-ignore + setEventStatus(event.status as EventStatus) } catch (error) { console.error('Failed to fetch event status:', error) } }, - eventData.status === EventStatus.DEPLOYED ? null : 5000 + eventStatus === EventStatus.DEPLOYED ? null : 5000 ) // Scroll to top on mount @@ -102,7 +99,7 @@ export const LockDeploying = ({
@@ -111,7 +108,7 @@ export const LockDeploying = ({ Status - {eventData.status === EventStatus.DEPLOYED + {eventStatus === EventStatus.DEPLOYED ? 'Deployed' : 'In progress...'} @@ -131,7 +128,7 @@ export const LockDeploying = ({ {message} - {eventData.status === EventStatus.DEPLOYED && !compact && ( + {eventStatus === EventStatus.DEPLOYED && !compact && (

We made a page for your event! Go check it out!