Enable gifting on christmas

This commit is contained in:
benthecarman
2023-10-04 16:06:29 -05:00
committed by Paul Miller
parent 6d75e3b791
commit b0e821bb7c
3 changed files with 20 additions and 4 deletions

View File

@@ -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:

View File

@@ -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 (
<MutinyWalletGuard>

View File

@@ -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 (
<SafeArea>
@@ -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
},
{