mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
feat: add renewal info
This commit is contained in:
parent
81cb73c243
commit
2346a5bf86
@ -293,7 +293,10 @@
|
|||||||
"renew_subscription": "Renew Hydra Cloud",
|
"renew_subscription": "Renew Hydra Cloud",
|
||||||
"subscription_expired_at": "Your subscription expired at {{date}}",
|
"subscription_expired_at": "Your subscription expired at {{date}}",
|
||||||
"no_subscription": "Enjoy Hydra in the best possible way",
|
"no_subscription": "Enjoy Hydra in the best possible way",
|
||||||
"become_subscriber": "Be Hydra Cloud"
|
"become_subscriber": "Be Hydra Cloud",
|
||||||
|
"subscription_renew_cancelled": "Automatic renewal is not active",
|
||||||
|
"subscription_renews_on": "Your subscription renews on {{date}}",
|
||||||
|
"bill_sent_until": "You next bill will be sent until this day"
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"download_complete": "Download complete",
|
"download_complete": "Download complete",
|
||||||
|
@ -280,8 +280,11 @@
|
|||||||
"account_data_updated_successfully": "Dados da conta atualizados com sucesso",
|
"account_data_updated_successfully": "Dados da conta atualizados com sucesso",
|
||||||
"renew_subscription": "Renovar Hydra Cloud",
|
"renew_subscription": "Renovar Hydra Cloud",
|
||||||
"subscription_expired_at": "Sua assinatura expirou em {{date}}",
|
"subscription_expired_at": "Sua assinatura expirou em {{date}}",
|
||||||
"no_subscription": "Aproveite o Hydra ao seu máximo",
|
"no_subscription": "Aproveite o Hydra da melhor forma possível",
|
||||||
"become_subscriber": "Seja Hydra Cloud"
|
"become_subscriber": "Seja Hydra Cloud",
|
||||||
|
"subscription_renew_cancelled": "A renovação automática está desativada",
|
||||||
|
"subscription_renews_on": "Sua assinatura renova dia {{date}}",
|
||||||
|
"bill_sent_until": "Sua próxima cobrança será enviada até esse dia"
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"download_complete": "Download concluído",
|
"download_complete": "Download concluído",
|
||||||
|
@ -96,27 +96,48 @@ export function SettingsAccount() {
|
|||||||
|
|
||||||
const getHydraCloudSectionContent = () => {
|
const getHydraCloudSectionContent = () => {
|
||||||
const hasSubscribedBefore = Boolean(userDetails?.subscription?.expiresAt);
|
const hasSubscribedBefore = Boolean(userDetails?.subscription?.expiresAt);
|
||||||
|
const isRenewalActive = userDetails?.subscription?.status === "active";
|
||||||
|
|
||||||
if (!hasSubscribedBefore) {
|
if (!hasSubscribedBefore) {
|
||||||
return {
|
return {
|
||||||
description: t("no_subscription"),
|
description: <small>{t("no_subscription")}</small>,
|
||||||
callToAction: t("become_subscriber"),
|
callToAction: t("become_subscriber"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasActiveSubscription) {
|
if (hasActiveSubscription) {
|
||||||
return {
|
return {
|
||||||
description: t("subscription_active_until", {
|
description: isRenewalActive ? (
|
||||||
date: formatDate(userDetails!.subscription!.expiresAt!),
|
<>
|
||||||
}),
|
<small>
|
||||||
|
{t("subscription_renews_on", {
|
||||||
|
date: formatDate(userDetails.subscription!.expiresAt!),
|
||||||
|
})}
|
||||||
|
</small>
|
||||||
|
<small>{t("bill_sent_until")}</small>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<small>{t("subscription_renew_cancelled")}</small>
|
||||||
|
<small>
|
||||||
|
{t("subscription_active_until", {
|
||||||
|
date: formatDate(userDetails!.subscription!.expiresAt!),
|
||||||
|
})}
|
||||||
|
</small>
|
||||||
|
</>
|
||||||
|
),
|
||||||
callToAction: t("manage_subscription"),
|
callToAction: t("manage_subscription"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
description: t("subscription_expired_at", {
|
description: (
|
||||||
date: formatDate(userDetails!.subscription!.expiresAt!),
|
<small>
|
||||||
}),
|
{t("subscription_expired_at", {
|
||||||
|
date: formatDate(userDetails!.subscription!.expiresAt!),
|
||||||
|
})}
|
||||||
|
</small>
|
||||||
|
),
|
||||||
callToAction: t("renew_subscription"),
|
callToAction: t("renew_subscription"),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -189,9 +210,9 @@ export function SettingsAccount() {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||||
<h3 style={{ marginTop: `${SPACING_UNIT * 2}px` }}>Hydra Cloud</h3>
|
<h3 style={{ marginTop: `${SPACING_UNIT * 2}px` }}>Hydra Cloud</h3>
|
||||||
<small>{getHydraCloudSectionContent().description}</small>
|
{getHydraCloudSectionContent().description}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
Loading…
Reference in New Issue
Block a user