From b309f9d4389601a255c0ecc6affe8f8c53789c89 Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Mon, 25 Nov 2024 13:14:10 +0100 Subject: [PATCH] add discount banner --- .../js/Components/Billing/BillingBanner.vue | 81 ++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/resources/js/Components/Billing/BillingBanner.vue b/resources/js/Components/Billing/BillingBanner.vue index 60dc8385..b194b04c 100644 --- a/resources/js/Components/Billing/BillingBanner.vue +++ b/resources/js/Components/Billing/BillingBanner.vue @@ -35,11 +35,90 @@ const hideFreeUpgradeBanner = useSessionStorage( false ); const showFreeUpgradeBanner = computed( - () => isFreePlan() && !isBlocked() && !hideFreeUpgradeBanner.value + () => + isFreePlan() && + !isBlocked() && + !hideFreeUpgradeBanner.value && + !showBlackFridayBanner.value ); +const hideBlackFridayBanner = useSessionStorage( + 'hideBlackFridayBanner-' + getCurrentOrganizationId(), + false +); + +const showBlackFridayBanner = computed(() => { + if (hideBlackFridayBanner.value) { + return false; + } + const today = new Date(); + const blackFriday = new Date(2024, 10, 30); + return today < blackFriday; +});