From 1f4d25aa8c2d68828238764fc8f51e6787ab53eb Mon Sep 17 00:00:00 2001 From: Grayash Date: Mon, 9 Sep 2024 09:57:23 +0900 Subject: [PATCH] Refactor CTAButton component to handle ticket availability logic more accurately --- src/app/components/CTAButton.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/components/CTAButton.tsx b/src/app/components/CTAButton.tsx index 1b34d8f..08c070a 100644 --- a/src/app/components/CTAButton.tsx +++ b/src/app/components/CTAButton.tsx @@ -19,7 +19,10 @@ export default function CTAButton() { return "before"; } else if (today < EVENT_END_TIMESTAMP && today > TICKET_OPEN_TIMESTAMP) { return "sale"; - } else if (process.env.NEXT_PUBLIC_TICKET_SOLDOUT) { + } else if ( + today < EVENT_END_TIMESTAMP && + process.env.NEXT_PUBLIC_TICKET_SOLDOUT === "true" + ) { return "soldout"; } else { return "end";