From b0e821bb7c4e794578d796568ef80341e60ad4ee Mon Sep 17 00:00:00 2001 From: benthecarman Date: Wed, 4 Oct 2023 16:06:29 -0500 Subject: [PATCH] Enable gifting on christmas --- src/i18n/en/translations.ts | 1 + src/routes/settings/Gift.tsx | 6 +++++- src/routes/settings/index.tsx | 17 ++++++++++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/i18n/en/translations.ts b/src/i18n/en/translations.ts index 2660058..2ffa97e 100644 --- a/src/i18n/en/translations.ts +++ b/src/i18n/en/translations.ts @@ -466,6 +466,7 @@ export default { gift: { give_sats_link: "Give sats as a gift", title: "Gifting", + no_plus_caption: "Upgrade to Mutiny+ to enabled gifting", receive_too_small: "Your first receive needs to be {{amount}} SATS or greater.", setup_fee_lightning: diff --git a/src/routes/settings/Gift.tsx b/src/routes/settings/Gift.tsx index be19711..09a8fa3 100644 --- a/src/routes/settings/Gift.tsx +++ b/src/routes/settings/Gift.tsx @@ -203,7 +203,11 @@ export default function GiftPage() { }; const selfHosted = state.settings?.selfhosted === "true"; - const canGift = state.mutiny_plus || selfHosted; + const today = new Date(); + // days are 1 indexed, months are 0 indexed + const isChristmas = today.getDate() === 25 && today.getMonth() === 11; + + const canGift = state.mutiny_plus || selfHosted || isChristmas; return ( diff --git a/src/routes/settings/index.tsx b/src/routes/settings/index.tsx index 0d54341..4608494 100644 --- a/src/routes/settings/index.tsx +++ b/src/routes/settings/index.tsx @@ -73,6 +73,9 @@ export default function Settings() { const COMMIT_HASH = import.meta.env.__COMMIT_HASH__; const selfHosted = state.settings?.selfhosted === "true"; + const today = new Date(); + // days are 1 indexed, months are 0 indexed + const isChristmas = today.getDate() === 25 && today.getMonth() === 11; return ( @@ -129,10 +132,18 @@ export default function Settings() { }, { href: "/settings/gift", - disabled: !(state.mutiny_plus || selfHosted), + disabled: !( + state.mutiny_plus || + selfHosted || + isChristmas + ), text: i18n.t("settings.gift.title"), - caption: !(state.mutiny_plus || selfHosted) - ? "Upgrade to Mutiny+ to enabled gifting" + caption: !( + state.mutiny_plus || + selfHosted || + isChristmas + ) + ? i18n.t("settings.gift.no_plus_caption") : undefined }, {