Web: Payment alert description changed.
This commit is contained in:
parent
50d0d6f2a6
commit
e96252937d
@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect } from "react";
|
import React from "react";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import { withRouter } from "react-router";
|
import { withRouter } from "react-router";
|
||||||
import { useTranslation, Trans } from "react-i18next";
|
import { useTranslation, Trans } from "react-i18next";
|
||||||
@ -15,28 +15,13 @@ const PROXY_BASE_URL = combineUrl(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const ArticlePaymentAlert = ({
|
const ArticlePaymentAlert = ({
|
||||||
pricePerManager,
|
|
||||||
isFreeTariff,
|
isFreeTariff,
|
||||||
theme,
|
theme,
|
||||||
currencySymbol,
|
|
||||||
setPortalPaymentQuotas,
|
|
||||||
currentTariffPlanTitle,
|
currentTariffPlanTitle,
|
||||||
toggleArticleOpen,
|
toggleArticleOpen,
|
||||||
tariffPlanTitle,
|
|
||||||
isQuotaLoaded,
|
|
||||||
isQuotasLoaded,
|
|
||||||
}) => {
|
}) => {
|
||||||
const { t, ready } = useTranslation("Common");
|
const { t, ready } = useTranslation("Common");
|
||||||
|
|
||||||
useEffect(async () => {
|
|
||||||
if (isFreeTariff && isQuotaLoaded)
|
|
||||||
try {
|
|
||||||
await setPortalPaymentQuotas();
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
}
|
|
||||||
}, [isQuotaLoaded]);
|
|
||||||
|
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
const paymentPageUrl = combineUrl(
|
const paymentPageUrl = combineUrl(
|
||||||
PROXY_BASE_URL,
|
PROXY_BASE_URL,
|
||||||
@ -55,16 +40,11 @@ const ArticlePaymentAlert = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
const description = isFreeTariff
|
const description = isFreeTariff
|
||||||
? pricePerManager && (
|
? t("Common:GetMoreOptions")
|
||||||
<Trans t={t} i18nKey="PerUserMonth" ns="Common">
|
|
||||||
From {{ currencySymbol }}
|
|
||||||
{{ price: pricePerManager }} per admin/power user /month
|
|
||||||
</Trans>
|
|
||||||
)
|
|
||||||
: t("Common:PayBeforeTheEndGracePeriod");
|
: t("Common:PayBeforeTheEndGracePeriod");
|
||||||
|
|
||||||
const additionalDescription = isFreeTariff
|
const additionalDescription = isFreeTariff
|
||||||
? t("Common:ActivateBusinessPlan", { planName: tariffPlanTitle })
|
? t("Common:ActivatePremiumFeatures")
|
||||||
: t("Common:GracePeriodActivated");
|
: t("Common:GracePeriodActivated");
|
||||||
|
|
||||||
const color = isFreeTariff
|
const color = isFreeTariff
|
||||||
@ -73,9 +53,6 @@ const ArticlePaymentAlert = ({
|
|||||||
|
|
||||||
const isShowLoader = !ready;
|
const isShowLoader = !ready;
|
||||||
|
|
||||||
if (!isQuotaLoaded) return <></>;
|
|
||||||
if (isFreeTariff && !isQuotasLoaded) return <></>;
|
|
||||||
|
|
||||||
return isShowLoader ? (
|
return isShowLoader ? (
|
||||||
<Loaders.Rectangle width="210px" height="88px" />
|
<Loaders.Rectangle width="210px" height="88px" />
|
||||||
) : (
|
) : (
|
||||||
@ -95,29 +72,14 @@ const ArticlePaymentAlert = ({
|
|||||||
|
|
||||||
export default withRouter(
|
export default withRouter(
|
||||||
inject(({ auth }) => {
|
inject(({ auth }) => {
|
||||||
const { paymentQuotasStore, currentQuotaStore, settingsStore } = auth;
|
const { currentQuotaStore, settingsStore } = auth;
|
||||||
const {
|
const { currentTariffPlanTitle } = currentQuotaStore;
|
||||||
currentTariffPlanTitle,
|
|
||||||
isLoaded: isQuotaLoaded,
|
|
||||||
} = currentQuotaStore;
|
|
||||||
const { theme, toggleArticleOpen } = settingsStore;
|
const { theme, toggleArticleOpen } = settingsStore;
|
||||||
const {
|
|
||||||
setPortalPaymentQuotas,
|
|
||||||
planCost,
|
|
||||||
tariffPlanTitle,
|
|
||||||
isLoaded: isQuotasLoaded,
|
|
||||||
} = paymentQuotasStore;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
toggleArticleOpen,
|
toggleArticleOpen,
|
||||||
setPortalPaymentQuotas,
|
|
||||||
pricePerManager: planCost.value,
|
|
||||||
theme,
|
theme,
|
||||||
currencySymbol: planCost.currencySymbol,
|
|
||||||
currentTariffPlanTitle,
|
currentTariffPlanTitle,
|
||||||
tariffPlanTitle,
|
|
||||||
isQuotaLoaded,
|
|
||||||
isQuotasLoaded,
|
|
||||||
};
|
};
|
||||||
})(observer(ArticlePaymentAlert))
|
})(observer(ArticlePaymentAlert))
|
||||||
);
|
);
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
"Actions": "Actions",
|
"Actions": "Actions",
|
||||||
"Activate": "Activate",
|
"Activate": "Activate",
|
||||||
"ActivateBusinessPlan": "Activate {{planName}} plan?",
|
"ActivateBusinessPlan": "Activate {{planName}} plan?",
|
||||||
|
"ActivatePremiumFeatures": "Activate premium features?",
|
||||||
"Active": "Active",
|
"Active": "Active",
|
||||||
"AddButton": "Add",
|
"AddButton": "Add",
|
||||||
"AddFilter": "Add filter",
|
"AddFilter": "Add filter",
|
||||||
@ -109,6 +110,7 @@
|
|||||||
"FullAccess": "Full access",
|
"FullAccess": "Full access",
|
||||||
"Gigabyte": "GB",
|
"Gigabyte": "GB",
|
||||||
"GracePeriodActivated": "Grace period activated",
|
"GracePeriodActivated": "Grace period activated",
|
||||||
|
"GetMoreOptions": "Get more security and branding options",
|
||||||
"HasFullAccess": "He has full access to the room",
|
"HasFullAccess": "He has full access to the room",
|
||||||
"HelpCenter": "Help Center",
|
"HelpCenter": "Help Center",
|
||||||
"HideArticleMenu": "Hide menu",
|
"HideArticleMenu": "Hide menu",
|
||||||
|
Loading…
Reference in New Issue
Block a user