From 131e3a5df2e97a9b0b993c57081e35636ddd1e5b Mon Sep 17 00:00:00 2001 From: Tanmoy Basak Anjan Date: Fri, 21 Jan 2022 21:37:08 +0600 Subject: [PATCH 01/16] added api --- .../SubscriptionTab/ChangePlan/ConfirmPlan.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx index 02c5f2852a..bad345a458 100644 --- a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx @@ -1,4 +1,4 @@ -import React, { useMemo } from "react" +import React, { useEffect, useMemo } from "react" import { makeStyles, createStyles } from "@chainsafe/common-theme" import { CSFTheme } from "../../../../../Themes/types" import { Product, ProductPrice } from "@chainsafe/files-api-client" @@ -7,6 +7,7 @@ import { t, Trans } from "@lingui/macro" import dayjs from "dayjs" import { PaymentMethod, useBilling } from "../../../../../Contexts/BillingContext" import clsx from "clsx" +import { useFilesApi } from "../../../../../Contexts/FilesApiContext" const useStyles = makeStyles(({ constants, palette }: CSFTheme) => createStyles({ @@ -114,12 +115,21 @@ const ConfirmPlan = ({ const classes = useStyles() const { defaultCard } = useBilling() const { currentSubscription } = useBilling() + const { filesApiClient } = useFilesApi() const newPlanStorage = formatBytes(Number(planPrice?.metadata?.storage_size_bytes), 2) + const isDowngrade = useMemo(() => { const currentPrice = currentSubscription?.product?.price?.unit_amount return currentPrice && currentPrice > planPrice.unit_amount - }, [currentSubscription, planPrice] - ) + }, [currentSubscription, planPrice]) + + useEffect(() => { + if (!currentSubscription) return + filesApiClient.checkSubscriptionUpdate(currentSubscription?.id, { + payment_method: paymentMethod === "creditCard" ? "stripe" : "crypto", + price_id: planPrice.id + }).then(console.log).catch(console.error) + }, [currentSubscription, paymentMethod, filesApiClient, planPrice]) return (
From 396a40aa1888ccf02bbd6c8b368d7e71d0b19b6d Mon Sep 17 00:00:00 2001 From: Tanmoy Basak Anjan Date: Tue, 25 Jan 2022 00:53:37 +0600 Subject: [PATCH 02/16] currennt and previous balance --- .../ChangePlan/ChangePlanModal.tsx | 1 + .../ChangePlan/ConfirmPlan.tsx | 48 +++++++++++++++---- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ChangePlanModal.tsx b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ChangePlanModal.tsx index b67dcb5d23..5548f65869 100644 --- a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ChangePlanModal.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ChangePlanModal.tsx @@ -12,6 +12,7 @@ import PlanSuccess from "./PlanSuccess" import DowngradeDetails from "./DowngradeDetails" import { PaymentMethod } from "../../../../../Contexts/BillingContext" import CryptoPayment from "./CryptoPayment" + const useStyles = makeStyles(({ constants, breakpoints }: CSFTheme) => createStyles({ root: { diff --git a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx index 9a04fde4c3..1a00261b80 100644 --- a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx @@ -1,7 +1,7 @@ -import React, { useEffect, useMemo } from "react" +import React, { useState, useEffect, useMemo } from "react" import { makeStyles, createStyles } from "@chainsafe/common-theme" import { CSFTheme } from "../../../../../Themes/types" -import { Product, ProductPrice } from "@chainsafe/files-api-client" +import { CheckSubscriptionUpdate, Product, ProductPrice } from "@chainsafe/files-api-client" import { Button, CreditCardIcon, Divider, formatBytes, Typography } from "@chainsafe/common-components" import { t, Trans } from "@lingui/macro" import dayjs from "dayjs" @@ -116,6 +116,7 @@ const ConfirmPlan = ({ const { defaultCard } = useBilling() const { currentSubscription } = useBilling() const { filesApiClient } = useFilesApi() + const [checkSubscriptionUpdate, setCheckSubscriptionUpdate] = useState() const newPlanStorage = formatBytes(Number(planPrice?.metadata?.storage_size_bytes), 2) const isDowngrade = useMemo(() => { @@ -128,7 +129,7 @@ const ConfirmPlan = ({ filesApiClient.checkSubscriptionUpdate(currentSubscription?.id, { payment_method: paymentMethod === "creditCard" ? "stripe" : "crypto", price_id: planPrice.id - }).then(console.log).catch(console.error) + }).then(setCheckSubscriptionUpdate).catch(console.error) }, [currentSubscription, paymentMethod, filesApiClient, planPrice]) return ( @@ -266,20 +267,17 @@ const ConfirmPlan = ({ -
- Total + Plan price
{planPrice.unit_amount ? planPrice.currency : ""} {planPrice.unit_amount} @@ -288,6 +286,36 @@ const ConfirmPlan = ({
+ +
+ + Next payment amount + +
+ {checkSubscriptionUpdate &&
+ + {planPrice.currency} {checkSubscriptionUpdate.amount_remaining.toFixed(2)} + + {checkSubscriptionUpdate.amount_balance > 0 && + (Previous balance : {planPrice.currency} {checkSubscriptionUpdate.amount_balance.toFixed(2)}) + + + } +
+ } +
+
{isSubscriptionError && {paymentMethod === "creditCard" From 0db07d1fd198b575d4058d10c1b0ca75b60239ca Mon Sep 17 00:00:00 2001 From: Tanmoy Basak Anjan Date: Tue, 25 Jan 2022 20:21:55 +0600 Subject: [PATCH 03/16] proration amounts --- .../Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx index 1a00261b80..576715a634 100644 --- a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx @@ -293,7 +293,7 @@ const ConfirmPlan = ({ variant="h5" className={classes.boldText} > - Next payment amount + Payment amount
{checkSubscriptionUpdate &&
From 67f542a0d7aa264cdf1c2cb2dfce118fb9dd37ae Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 25 Jan 2022 14:29:57 +0000 Subject: [PATCH 04/16] lingui extract --- packages/files-ui/src/locales/de/messages.po | 9 +++++++++ packages/files-ui/src/locales/en/messages.po | 9 +++++++++ packages/files-ui/src/locales/es/messages.po | 9 +++++++++ packages/files-ui/src/locales/fr/messages.po | 9 +++++++++ packages/files-ui/src/locales/no/messages.po | 9 +++++++++ 5 files changed, 45 insertions(+) diff --git a/packages/files-ui/src/locales/de/messages.po b/packages/files-ui/src/locales/de/messages.po index 610fa9f9c6..232449ed8c 100644 --- a/packages/files-ui/src/locales/de/messages.po +++ b/packages/files-ui/src/locales/de/messages.po @@ -658,6 +658,9 @@ msgstr "" msgid "Pay with {0}" msgstr "" +msgid "Payment amount" +msgstr "" + msgid "Payment and Subscriptions" msgstr "" @@ -667,6 +670,9 @@ msgstr "" msgid "Plan changed successfully" msgstr "" +msgid "Plan price" +msgstr "" + msgid "Please enter a file name" msgstr "Bitte geben Sie einen Dateinamen ein" @@ -691,6 +697,9 @@ msgstr "Vorschau" msgid "Previous" msgstr "Vorherige" +msgid "Previous balance" +msgstr "" + msgid "Privacy Policy" msgstr "Datenschutzrichtlinie" diff --git a/packages/files-ui/src/locales/en/messages.po b/packages/files-ui/src/locales/en/messages.po index c5a1012975..aba1ed651e 100644 --- a/packages/files-ui/src/locales/en/messages.po +++ b/packages/files-ui/src/locales/en/messages.po @@ -661,6 +661,9 @@ msgstr "Pay with crypto" msgid "Pay with {0}" msgstr "Pay with {0}" +msgid "Payment amount" +msgstr "Payment amount" + msgid "Payment and Subscriptions" msgstr "Payment and Subscriptions" @@ -670,6 +673,9 @@ msgstr "Payment method" msgid "Plan changed successfully" msgstr "Plan changed successfully" +msgid "Plan price" +msgstr "Plan price" + msgid "Please enter a file name" msgstr "Please enter a file name" @@ -694,6 +700,9 @@ msgstr "Preview" msgid "Previous" msgstr "Previous" +msgid "Previous balance" +msgstr "Previous balance" + msgid "Privacy Policy" msgstr "Privacy Policy" diff --git a/packages/files-ui/src/locales/es/messages.po b/packages/files-ui/src/locales/es/messages.po index ddcff33156..41aedbe058 100644 --- a/packages/files-ui/src/locales/es/messages.po +++ b/packages/files-ui/src/locales/es/messages.po @@ -662,6 +662,9 @@ msgstr "" msgid "Pay with {0}" msgstr "" +msgid "Payment amount" +msgstr "" + msgid "Payment and Subscriptions" msgstr "" @@ -671,6 +674,9 @@ msgstr "" msgid "Plan changed successfully" msgstr "" +msgid "Plan price" +msgstr "" + msgid "Please enter a file name" msgstr "Ingrese un nombre de archivo" @@ -695,6 +701,9 @@ msgstr "Avance" msgid "Previous" msgstr "Anterior" +msgid "Previous balance" +msgstr "" + msgid "Privacy Policy" msgstr "Política de privacidad" diff --git a/packages/files-ui/src/locales/fr/messages.po b/packages/files-ui/src/locales/fr/messages.po index 6cbc8e1fec..46159ffcbf 100644 --- a/packages/files-ui/src/locales/fr/messages.po +++ b/packages/files-ui/src/locales/fr/messages.po @@ -662,6 +662,9 @@ msgstr "" msgid "Pay with {0}" msgstr "" +msgid "Payment amount" +msgstr "" + msgid "Payment and Subscriptions" msgstr "Paiements et souscriptions" @@ -671,6 +674,9 @@ msgstr "Méthode de paiement" msgid "Plan changed successfully" msgstr "Formule changée" +msgid "Plan price" +msgstr "" + msgid "Please enter a file name" msgstr "Veuillez entrer un nom de fichier" @@ -695,6 +701,9 @@ msgstr "Aperçu" msgid "Previous" msgstr "Précédent" +msgid "Previous balance" +msgstr "" + msgid "Privacy Policy" msgstr "Politique de confidentialité" diff --git a/packages/files-ui/src/locales/no/messages.po b/packages/files-ui/src/locales/no/messages.po index 1c1432d748..493e0ebbac 100644 --- a/packages/files-ui/src/locales/no/messages.po +++ b/packages/files-ui/src/locales/no/messages.po @@ -658,6 +658,9 @@ msgstr "" msgid "Pay with {0}" msgstr "" +msgid "Payment amount" +msgstr "" + msgid "Payment and Subscriptions" msgstr "" @@ -667,6 +670,9 @@ msgstr "" msgid "Plan changed successfully" msgstr "" +msgid "Plan price" +msgstr "" + msgid "Please enter a file name" msgstr "Skriv inn et filnavn" @@ -691,6 +697,9 @@ msgstr "Forhåndsvis" msgid "Previous" msgstr "Forrige" +msgid "Previous balance" +msgstr "" + msgid "Privacy Policy" msgstr "Personvernspraksis" From 05dee8139caa1753fe5e0d1f433ce69f80e6c59e Mon Sep 17 00:00:00 2001 From: Tanmoy Basak Anjan Date: Thu, 27 Jan 2022 20:53:20 +0600 Subject: [PATCH 05/16] Update packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> --- .../Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx index 576715a634..8132e7a8b5 100644 --- a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx @@ -126,10 +126,13 @@ const ConfirmPlan = ({ useEffect(() => { if (!currentSubscription) return + filesApiClient.checkSubscriptionUpdate(currentSubscription?.id, { payment_method: paymentMethod === "creditCard" ? "stripe" : "crypto", price_id: planPrice.id - }).then(setCheckSubscriptionUpdate).catch(console.error) + }) + .then(setCheckSubscriptionUpdate) + .catch(console.error) }, [currentSubscription, paymentMethod, filesApiClient, planPrice]) return ( From 9cb857ed2893e099c83bd2a201fcac51fe745668 Mon Sep 17 00:00:00 2001 From: Tanmoy Basak Anjan Date: Thu, 27 Jan 2022 20:53:44 +0600 Subject: [PATCH 06/16] Update packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> --- .../Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx index 8132e7a8b5..f477d5e8e4 100644 --- a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx @@ -311,7 +311,7 @@ const ConfirmPlan = ({ component="p" variant="body2" > - (Previous balance : {planPrice.currency} {checkSubscriptionUpdate.amount_balance.toFixed(2)}) + (Previous balance: {planPrice.currency} {checkSubscriptionUpdate.amount_balance.toFixed(2)}) } From 9c6177492fa297bdad49c8782bb54afefbd7ff91 Mon Sep 17 00:00:00 2001 From: Tanmoy Basak Anjan Date: Thu, 27 Jan 2022 20:53:57 +0600 Subject: [PATCH 07/16] Update packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> --- .../Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx index f477d5e8e4..905752728c 100644 --- a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/ChangePlan/ConfirmPlan.tsx @@ -339,7 +339,7 @@ const ConfirmPlan = ({
} From 7758f7cd16451c998bc0f10c111e7697fadc08f1 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 27 Jan 2022 15:02:51 +0000 Subject: [PATCH 09/16] lingui extract --- packages/files-ui/src/locales/fr/messages.po | 9 --------- 1 file changed, 9 deletions(-) diff --git a/packages/files-ui/src/locales/fr/messages.po b/packages/files-ui/src/locales/fr/messages.po index eabae6dcb3..3426e28e79 100644 --- a/packages/files-ui/src/locales/fr/messages.po +++ b/packages/files-ui/src/locales/fr/messages.po @@ -536,9 +536,6 @@ msgstr "Gérer l’accès" msgid "Manage Shared Folder" msgstr "Gérer le dossier partagé" -#~ msgid "Monthly billing" -#~ msgstr "Facturation mensuelle" - msgid "Move" msgstr "Déplacer" @@ -680,9 +677,6 @@ msgstr "Formule changée" msgid "Plan price" msgstr "" -#~ msgid "Please complete payment of the following outstanding invoices in order to " -#~ msgstr "" - msgid "Please complete payment of the following outstanding invoices in order to avoid account suspension" msgstr "" @@ -1121,9 +1115,6 @@ msgstr "Quelle belle journée." msgid "What a fine night it is." msgstr "Quelle belle nuit." -#~ msgid "Yearly billing" -#~ msgstr "Paiement annuel" - msgid "Yes, save it" msgstr "Oui, l’enregistrer" From 61a99911d25b6c090f9aaac0fc8537e1699523ab Mon Sep 17 00:00:00 2001 From: Thibaut Sardan Date: Thu, 27 Jan 2022 16:44:28 +0100 Subject: [PATCH 10/16] lint fix --- .../Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx index 1b6f150ae7..330cf5ce82 100644 --- a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx @@ -131,8 +131,8 @@ const ConfirmPlan = ({ payment_method: paymentMethod === "creditCard" ? "stripe" : "crypto", price_id: planPrice.id }) - .then(setCheckSubscriptionUpdate) - .catch(console.error) + .then(setCheckSubscriptionUpdate) + .catch(console.error) }, [currentSubscription, paymentMethod, filesApiClient, planPrice]) return ( From a46c6d00d5259a8b784b1aa8bac458f010c636b0 Mon Sep 17 00:00:00 2001 From: Tanmoy Basak Anjan Date: Fri, 11 Feb 2022 11:47:48 +0600 Subject: [PATCH 11/16] client updates --- packages/files-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/files-ui/package.json b/packages/files-ui/package.json index 115d0b395b..c0bac4e425 100644 --- a/packages/files-ui/package.json +++ b/packages/files-ui/package.json @@ -6,7 +6,7 @@ "@babel/core": "^7.12.10", "@babel/runtime": "^7.0.0", "@chainsafe/browser-storage-hooks": "^1.0.1", - "@chainsafe/files-api-client": "1.18.27", + "@chainsafe/files-api-client": "1.18.28", "@chainsafe/web3-context": "1.3.1", "@emeraldpay/hashicon-react": "^0.5.1", "@lingui/core": "^3.7.2", From 08193b4c21c7406723d81caef1540d52c06f57d1 Mon Sep 17 00:00:00 2001 From: Tanmoy Basak Anjan Date: Fri, 11 Feb 2022 11:48:57 +0600 Subject: [PATCH 12/16] client updates --- packages/storage-ui/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/storage-ui/package.json b/packages/storage-ui/package.json index 4f891a1d71..aec8b41ad2 100644 --- a/packages/storage-ui/package.json +++ b/packages/storage-ui/package.json @@ -6,7 +6,7 @@ "@babel/core": "^7.12.10", "@babel/runtime": "^7.0.0", "@chainsafe/browser-storage-hooks": "^1.0.1", - "@chainsafe/files-api-client": "1.18.27", + "@chainsafe/files-api-client": "1.18.28", "@chainsafe/web3-context": "1.3.0", "@lingui/core": "^3.7.2", "@lingui/react": "^3.7.2", diff --git a/yarn.lock b/yarn.lock index d0addd39ec..3bac1d7e0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1925,10 +1925,10 @@ resolved "https://registry.yarnpkg.com/@chainsafe/browser-storage-hooks/-/browser-storage-hooks-1.0.1.tgz#26d32cde1999914db755a631e2643823c54959f7" integrity sha512-Q4b5gQAZnsRXKeADspd5isqfwwhhXjDk70y++YadufA6EZ3tf340oW0OVszp74KaGEw+CAYFGQR4X7bzpZ3x9Q== -"@chainsafe/files-api-client@1.18.27": - version "1.18.27" - resolved "https://registry.yarnpkg.com/@chainsafe/files-api-client/-/files-api-client-1.18.27.tgz#5ecf5094d4972714a29db79de5b8469c17466f99" - integrity sha512-/NThz1xN/FaDPwXCwgnkuvLt3oMdzOpWKJwl2uOYLOFq7CJeirvZRazarmS8EK6zcGF+ylLtPsVR/XNZB4ipYQ== +"@chainsafe/files-api-client@1.18.28": + version "1.18.28" + resolved "https://registry.yarnpkg.com/@chainsafe/files-api-client/-/files-api-client-1.18.28.tgz#40d97262094d98235e7f06efa9933c6b8bdc3049" + integrity sha512-KCT3T7f0lb7thDd4RAa0pcIfx0iRl+53lctVflRVZ4UIcq/smjapbvLpB/4a+YwHHm/1VIWn7QUX5Ja8IbJ6PQ== dependencies: "@redocly/openapi-cli" "^1.0.0-beta.58" "@redocly/openapi-core" "^1.0.0-beta.69" From bad33eed95b5f521a92d4caf3e77b3b16c898d28 Mon Sep 17 00:00:00 2001 From: Tanmoy Basak Anjan Date: Fri, 11 Feb 2022 12:54:03 +0600 Subject: [PATCH 13/16] calculation deigns --- .../SubscriptionTab/Common/ConfirmPlan.tsx | 94 +++++++++++++------ 1 file changed, 67 insertions(+), 27 deletions(-) diff --git a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx index 44d5a55b5c..9f8a6d75db 100644 --- a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx @@ -23,7 +23,7 @@ const useStyles = makeStyles(({ constants, palette }: CSFTheme) => marginBottom: constants.generalUnit * 3 }, boldText: { - fontWeight: "bold" + fontWeight: 600 }, normalWeightText: { fontWeight: "normal" @@ -164,8 +164,8 @@ const ConfirmPlan = ({
{plan.name} @@ -206,8 +206,8 @@ const ConfirmPlan = ({ <>
Payment method @@ -293,12 +293,22 @@ const ConfirmPlan = ({
+
+ Pricing details + +
+
+ Plan price @@ -316,35 +326,65 @@ const ConfirmPlan = ({
- -
- - Payment amount - -
- {checkSubscriptionUpdate &&
+ {(!!checkSubscriptionUpdate && + (checkSubscriptionUpdate.amount_from_credit + checkSubscriptionUpdate.amount_unused_from_last_bill > 0)) && +
+ + Credit available + +
- {planPrice.currency} {checkSubscriptionUpdate.amount_remaining.toFixed(2)} - - {checkSubscriptionUpdate.amount_balance > 0 && - (Previous balance: {planPrice.currency} {checkSubscriptionUpdate.amount_balance.toFixed(2)}) + {planPrice.currency}  + {(checkSubscriptionUpdate.amount_from_credit + checkSubscriptionUpdate.amount_unused_from_last_bill).toFixed(2)} - }
- } +
+ } + + {!!checkSubscriptionUpdate &&
+ + Amount due + +
+ + {planPrice.currency} {checkSubscriptionUpdate?.amount_due.toFixed(2)} + +
+
+ } + {!!checkSubscriptionUpdate?.amount_credited &&
+ + Credit remaining + +
+ + {planPrice.currency}  + {checkSubscriptionUpdate.amount_credited.toFixed(2)} +
+ }
Date: Fri, 11 Feb 2022 06:55:44 +0000 Subject: [PATCH 14/16] lingui extract --- packages/files-ui/src/locales/de/messages.po | 14 ++++++++++---- packages/files-ui/src/locales/en/messages.po | 16 +++++++++++----- packages/files-ui/src/locales/es/messages.po | 14 ++++++++++---- packages/files-ui/src/locales/fr/messages.po | 14 ++++++++++---- packages/files-ui/src/locales/no/messages.po | 14 ++++++++++---- 5 files changed, 51 insertions(+), 21 deletions(-) diff --git a/packages/files-ui/src/locales/de/messages.po b/packages/files-ui/src/locales/de/messages.po index 0faee99ff4..b3a224ca69 100644 --- a/packages/files-ui/src/locales/de/messages.po +++ b/packages/files-ui/src/locales/de/messages.po @@ -97,6 +97,9 @@ msgstr "" msgid "Allow lookup by sharing key, wallet address, username or ENS" msgstr "" +msgid "Amount due" +msgstr "" + msgid "An error occurred:" msgstr "Es ist ein Fehler aufgetreten:" @@ -271,6 +274,12 @@ msgstr "" msgid "Credit Card is expiring soon" msgstr "" +msgid "Credit available" +msgstr "" + +msgid "Credit remaining" +msgstr "" + msgid "Dark Theme" msgstr "Dunkles Farbschema" @@ -670,9 +679,6 @@ msgstr "" msgid "Pay with {0}" msgstr "" -msgid "Payment amount" -msgstr "" - msgid "Payment and Subscriptions" msgstr "" @@ -718,7 +724,7 @@ msgstr "Vorschau" msgid "Previous" msgstr "Vorherige" -msgid "Previous balance" +msgid "Pricing details" msgstr "" msgid "Privacy Policy" diff --git a/packages/files-ui/src/locales/en/messages.po b/packages/files-ui/src/locales/en/messages.po index 5074f59eae..9365bc073c 100644 --- a/packages/files-ui/src/locales/en/messages.po +++ b/packages/files-ui/src/locales/en/messages.po @@ -97,6 +97,9 @@ msgstr "All invoices" msgid "Allow lookup by sharing key, wallet address, username or ENS" msgstr "Allow lookup by sharing key, wallet address, username or ENS" +msgid "Amount due" +msgstr "Amount due" + msgid "An error occurred:" msgstr "An error occurred:" @@ -271,6 +274,12 @@ msgstr "Create your public username in <0>Settings!" msgid "Credit Card is expiring soon" msgstr "Credit Card is expiring soon" +msgid "Credit available" +msgstr "Credit available" + +msgid "Credit remaining" +msgstr "Credit remaining" + msgid "Dark Theme" msgstr "Dark Theme" @@ -673,9 +682,6 @@ msgstr "Pay with crypto" msgid "Pay with {0}" msgstr "Pay with {0}" -msgid "Payment amount" -msgstr "Payment amount" - msgid "Payment and Subscriptions" msgstr "Payment and Subscriptions" @@ -721,8 +727,8 @@ msgstr "Preview" msgid "Previous" msgstr "Previous" -msgid "Previous balance" -msgstr "Previous balance" +msgid "Pricing details" +msgstr "Pricing details" msgid "Privacy Policy" msgstr "Privacy Policy" diff --git a/packages/files-ui/src/locales/es/messages.po b/packages/files-ui/src/locales/es/messages.po index e8dd055b8d..156deae8bf 100644 --- a/packages/files-ui/src/locales/es/messages.po +++ b/packages/files-ui/src/locales/es/messages.po @@ -98,6 +98,9 @@ msgstr "" msgid "Allow lookup by sharing key, wallet address, username or ENS" msgstr "" +msgid "Amount due" +msgstr "" + msgid "An error occurred:" msgstr "" @@ -272,6 +275,12 @@ msgstr "" msgid "Credit Card is expiring soon" msgstr "" +msgid "Credit available" +msgstr "" + +msgid "Credit remaining" +msgstr "" + msgid "Dark Theme" msgstr "Tema oscuro" @@ -674,9 +683,6 @@ msgstr "" msgid "Pay with {0}" msgstr "" -msgid "Payment amount" -msgstr "" - msgid "Payment and Subscriptions" msgstr "" @@ -722,7 +728,7 @@ msgstr "Avance" msgid "Previous" msgstr "Anterior" -msgid "Previous balance" +msgid "Pricing details" msgstr "" msgid "Privacy Policy" diff --git a/packages/files-ui/src/locales/fr/messages.po b/packages/files-ui/src/locales/fr/messages.po index 8f97812c9f..504de03a2a 100644 --- a/packages/files-ui/src/locales/fr/messages.po +++ b/packages/files-ui/src/locales/fr/messages.po @@ -98,6 +98,9 @@ msgstr "" msgid "Allow lookup by sharing key, wallet address, username or ENS" msgstr "" +msgid "Amount due" +msgstr "" + msgid "An error occurred:" msgstr "Une erreur s'est produite :" @@ -272,6 +275,12 @@ msgstr "Créez votre nom d'utilisateur public dans <0>Paramètres !" msgid "Credit Card is expiring soon" msgstr "La carte de crédit va bientôt expirer" +msgid "Credit available" +msgstr "" + +msgid "Credit remaining" +msgstr "" + msgid "Dark Theme" msgstr "Thème sombre" @@ -674,9 +683,6 @@ msgstr "Payer en cryptomonnaie" msgid "Pay with {0}" msgstr "Payer via {0}" -msgid "Payment amount" -msgstr "" - msgid "Payment and Subscriptions" msgstr "Paiements et souscriptions" @@ -722,7 +728,7 @@ msgstr "Aperçu" msgid "Previous" msgstr "Précédent" -msgid "Previous balance" +msgid "Pricing details" msgstr "" msgid "Privacy Policy" diff --git a/packages/files-ui/src/locales/no/messages.po b/packages/files-ui/src/locales/no/messages.po index 4fd8f20f20..d91a1220ba 100644 --- a/packages/files-ui/src/locales/no/messages.po +++ b/packages/files-ui/src/locales/no/messages.po @@ -97,6 +97,9 @@ msgstr "" msgid "Allow lookup by sharing key, wallet address, username or ENS" msgstr "" +msgid "Amount due" +msgstr "" + msgid "An error occurred:" msgstr "" @@ -271,6 +274,12 @@ msgstr "" msgid "Credit Card is expiring soon" msgstr "" +msgid "Credit available" +msgstr "" + +msgid "Credit remaining" +msgstr "" + msgid "Dark Theme" msgstr "Mørk drakt" @@ -670,9 +679,6 @@ msgstr "" msgid "Pay with {0}" msgstr "" -msgid "Payment amount" -msgstr "" - msgid "Payment and Subscriptions" msgstr "" @@ -718,7 +724,7 @@ msgstr "Forhåndsvis" msgid "Previous" msgstr "Forrige" -msgid "Previous balance" +msgid "Pricing details" msgstr "" msgid "Privacy Policy" From 4bb154df71fb1fe8cbf1e65275371178ad045b89 Mon Sep 17 00:00:00 2001 From: Tanmoy Basak Anjan Date: Fri, 11 Feb 2022 19:58:01 +0600 Subject: [PATCH 15/16] terms updated --- .../SubscriptionTab/Common/ConfirmPlan.tsx | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx index 9f8a6d75db..bfdab7379b 100644 --- a/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/SubscriptionTab/Common/ConfirmPlan.tsx @@ -326,15 +326,14 @@ const ConfirmPlan = ({
- {(!!checkSubscriptionUpdate && - (checkSubscriptionUpdate.amount_from_credit + checkSubscriptionUpdate.amount_unused_from_last_bill > 0)) && + {!!checkSubscriptionUpdate?.amount_from_credit &&
- Credit available + Amount from credit
{planPrice.currency}  - {(checkSubscriptionUpdate.amount_from_credit + checkSubscriptionUpdate.amount_unused_from_last_bill).toFixed(2)} + {checkSubscriptionUpdate.amount_from_credit.toFixed(2)} + +
+
+ } + {!!checkSubscriptionUpdate?.amount_unused_from_last_bill && +
+ + Amount available from last bill + +
+ + {planPrice.currency}  + {checkSubscriptionUpdate.amount_unused_from_last_bill.toFixed(2)}
@@ -372,7 +393,7 @@ const ConfirmPlan = ({ component="p" variant="body1" > - Credit remaining + Amount added to credit
Date: Fri, 11 Feb 2022 13:59:23 +0000 Subject: [PATCH 16/16] lingui extract --- packages/files-ui/src/locales/de/messages.po | 15 +++++++++------ packages/files-ui/src/locales/en/messages.po | 15 +++++++++------ packages/files-ui/src/locales/es/messages.po | 15 +++++++++------ packages/files-ui/src/locales/fr/messages.po | 15 +++++++++------ packages/files-ui/src/locales/no/messages.po | 15 +++++++++------ 5 files changed, 45 insertions(+), 30 deletions(-) diff --git a/packages/files-ui/src/locales/de/messages.po b/packages/files-ui/src/locales/de/messages.po index b3a224ca69..66a0a975b6 100644 --- a/packages/files-ui/src/locales/de/messages.po +++ b/packages/files-ui/src/locales/de/messages.po @@ -97,9 +97,18 @@ msgstr "" msgid "Allow lookup by sharing key, wallet address, username or ENS" msgstr "" +msgid "Amount added to credit" +msgstr "" + +msgid "Amount available from last bill" +msgstr "" + msgid "Amount due" msgstr "" +msgid "Amount from credit" +msgstr "" + msgid "An error occurred:" msgstr "Es ist ein Fehler aufgetreten:" @@ -274,12 +283,6 @@ msgstr "" msgid "Credit Card is expiring soon" msgstr "" -msgid "Credit available" -msgstr "" - -msgid "Credit remaining" -msgstr "" - msgid "Dark Theme" msgstr "Dunkles Farbschema" diff --git a/packages/files-ui/src/locales/en/messages.po b/packages/files-ui/src/locales/en/messages.po index 9365bc073c..d21ca721b8 100644 --- a/packages/files-ui/src/locales/en/messages.po +++ b/packages/files-ui/src/locales/en/messages.po @@ -97,9 +97,18 @@ msgstr "All invoices" msgid "Allow lookup by sharing key, wallet address, username or ENS" msgstr "Allow lookup by sharing key, wallet address, username or ENS" +msgid "Amount added to credit" +msgstr "Amount added to credit" + +msgid "Amount available from last bill" +msgstr "Amount available from last bill" + msgid "Amount due" msgstr "Amount due" +msgid "Amount from credit" +msgstr "Amount from credit" + msgid "An error occurred:" msgstr "An error occurred:" @@ -274,12 +283,6 @@ msgstr "Create your public username in <0>Settings!" msgid "Credit Card is expiring soon" msgstr "Credit Card is expiring soon" -msgid "Credit available" -msgstr "Credit available" - -msgid "Credit remaining" -msgstr "Credit remaining" - msgid "Dark Theme" msgstr "Dark Theme" diff --git a/packages/files-ui/src/locales/es/messages.po b/packages/files-ui/src/locales/es/messages.po index 156deae8bf..e43a954f30 100644 --- a/packages/files-ui/src/locales/es/messages.po +++ b/packages/files-ui/src/locales/es/messages.po @@ -98,9 +98,18 @@ msgstr "" msgid "Allow lookup by sharing key, wallet address, username or ENS" msgstr "" +msgid "Amount added to credit" +msgstr "" + +msgid "Amount available from last bill" +msgstr "" + msgid "Amount due" msgstr "" +msgid "Amount from credit" +msgstr "" + msgid "An error occurred:" msgstr "" @@ -275,12 +284,6 @@ msgstr "" msgid "Credit Card is expiring soon" msgstr "" -msgid "Credit available" -msgstr "" - -msgid "Credit remaining" -msgstr "" - msgid "Dark Theme" msgstr "Tema oscuro" diff --git a/packages/files-ui/src/locales/fr/messages.po b/packages/files-ui/src/locales/fr/messages.po index 504de03a2a..0735f42992 100644 --- a/packages/files-ui/src/locales/fr/messages.po +++ b/packages/files-ui/src/locales/fr/messages.po @@ -98,9 +98,18 @@ msgstr "" msgid "Allow lookup by sharing key, wallet address, username or ENS" msgstr "" +msgid "Amount added to credit" +msgstr "" + +msgid "Amount available from last bill" +msgstr "" + msgid "Amount due" msgstr "" +msgid "Amount from credit" +msgstr "" + msgid "An error occurred:" msgstr "Une erreur s'est produite :" @@ -275,12 +284,6 @@ msgstr "Créez votre nom d'utilisateur public dans <0>Paramètres !" msgid "Credit Card is expiring soon" msgstr "La carte de crédit va bientôt expirer" -msgid "Credit available" -msgstr "" - -msgid "Credit remaining" -msgstr "" - msgid "Dark Theme" msgstr "Thème sombre" diff --git a/packages/files-ui/src/locales/no/messages.po b/packages/files-ui/src/locales/no/messages.po index d91a1220ba..7369be6ef6 100644 --- a/packages/files-ui/src/locales/no/messages.po +++ b/packages/files-ui/src/locales/no/messages.po @@ -97,9 +97,18 @@ msgstr "" msgid "Allow lookup by sharing key, wallet address, username or ENS" msgstr "" +msgid "Amount added to credit" +msgstr "" + +msgid "Amount available from last bill" +msgstr "" + msgid "Amount due" msgstr "" +msgid "Amount from credit" +msgstr "" + msgid "An error occurred:" msgstr "" @@ -274,12 +283,6 @@ msgstr "" msgid "Credit Card is expiring soon" msgstr "" -msgid "Credit available" -msgstr "" - -msgid "Credit remaining" -msgstr "" - msgid "Dark Theme" msgstr "Mørk drakt"