From d5ac24e4688b8797711d7a2ddbe9ce32ada7db18 Mon Sep 17 00:00:00 2001 From: Grayash Date: Mon, 9 Sep 2024 10:14:33 +0900 Subject: [PATCH] Fix CTAButton component to handle ticket availability --- src/app/components/CTAButton.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/components/CTAButton.tsx b/src/app/components/CTAButton.tsx index 08c070a..299d19d 100644 --- a/src/app/components/CTAButton.tsx +++ b/src/app/components/CTAButton.tsx @@ -17,7 +17,11 @@ export default function CTAButton() { const today = Date.now(); if (today < TICKET_OPEN_TIMESTAMP) { return "before"; - } else if (today < EVENT_END_TIMESTAMP && today > TICKET_OPEN_TIMESTAMP) { + } else if ( + today < EVENT_END_TIMESTAMP && + today > TICKET_OPEN_TIMESTAMP && + process.env.NEXT_PUBLIC_TICKET_SOLDOUT !== "true" + ) { return "sale"; } else if ( today < EVENT_END_TIMESTAMP &&