From 2346a5bf86d16d19477a2d4f788c45623f394d3b Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:32:59 -0300 Subject: [PATCH] feat: add renewal info --- src/locales/en/translation.json | 5 ++- src/locales/pt-BR/translation.json | 7 +++- .../src/pages/settings/settings-account.tsx | 39 ++++++++++++++----- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 30913b2b..55eac438 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -293,7 +293,10 @@ "renew_subscription": "Renew Hydra Cloud", "subscription_expired_at": "Your subscription expired at {{date}}", "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": { "download_complete": "Download complete", diff --git a/src/locales/pt-BR/translation.json b/src/locales/pt-BR/translation.json index 70052f28..13c75e4d 100644 --- a/src/locales/pt-BR/translation.json +++ b/src/locales/pt-BR/translation.json @@ -280,8 +280,11 @@ "account_data_updated_successfully": "Dados da conta atualizados com sucesso", "renew_subscription": "Renovar Hydra Cloud", "subscription_expired_at": "Sua assinatura expirou em {{date}}", - "no_subscription": "Aproveite o Hydra ao seu máximo", - "become_subscriber": "Seja Hydra Cloud" + "no_subscription": "Aproveite o Hydra da melhor forma possível", + "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": { "download_complete": "Download concluído", diff --git a/src/renderer/src/pages/settings/settings-account.tsx b/src/renderer/src/pages/settings/settings-account.tsx index 76feb957..6357a243 100644 --- a/src/renderer/src/pages/settings/settings-account.tsx +++ b/src/renderer/src/pages/settings/settings-account.tsx @@ -96,27 +96,48 @@ export function SettingsAccount() { const getHydraCloudSectionContent = () => { const hasSubscribedBefore = Boolean(userDetails?.subscription?.expiresAt); + const isRenewalActive = userDetails?.subscription?.status === "active"; if (!hasSubscribedBefore) { return { - description: t("no_subscription"), + description: {t("no_subscription")}, callToAction: t("become_subscriber"), }; } if (hasActiveSubscription) { return { - description: t("subscription_active_until", { - date: formatDate(userDetails!.subscription!.expiresAt!), - }), + description: isRenewalActive ? ( + <> + + {t("subscription_renews_on", { + date: formatDate(userDetails.subscription!.expiresAt!), + })} + + {t("bill_sent_until")} + + ) : ( + <> + {t("subscription_renew_cancelled")} + + {t("subscription_active_until", { + date: formatDate(userDetails!.subscription!.expiresAt!), + })} + + + ), callToAction: t("manage_subscription"), }; } return { - description: t("subscription_expired_at", { - date: formatDate(userDetails!.subscription!.expiresAt!), - }), + description: ( + + {t("subscription_expired_at", { + date: formatDate(userDetails!.subscription!.expiresAt!), + })} + + ), callToAction: t("renew_subscription"), }; }; @@ -189,9 +210,9 @@ export function SettingsAccount() { -
+

Hydra Cloud

- {getHydraCloudSectionContent().description} + {getHydraCloudSectionContent().description}