diff --git a/packages/client/src/pages/PortalSettings/categories/payments/PaymentContainer.js b/packages/client/src/pages/PortalSettings/categories/payments/PaymentContainer.js index dddedadb55..0fc146f5b5 100644 --- a/packages/client/src/pages/PortalSettings/categories/payments/PaymentContainer.js +++ b/packages/client/src/pages/PortalSettings/categories/payments/PaymentContainer.js @@ -81,26 +81,28 @@ const StyledBody = styled.div` } `; -const PaymentContainer = ({ - isFreeTariff, - isGracePeriod, - theme, - isNotPaidPeriod, - payerEmail, - user, - isPaidPeriod, - currencySymbol, - startValue, - currentTariffPlanTitle, - tariffPlanTitle, - expandArticle, - gracePeriodEndDate, - delayDaysCount, +const PaymentContainer = (props) => { + const { + isFreeTariff, + isGracePeriod, + theme, + isNotPaidPeriod, + payerEmail, + user, + isPaidPeriod, + currencySymbol, + startValue, + currentTariffPlanTitle, + tariffPlanTitle, + expandArticle, + gracePeriodEndDate, + delayDaysCount, - isAlreadyPaid, - paymentDate, - t, -}) => { + isAlreadyPaid, + paymentDate, + t, + isNonProfit, + } = props; const renderTooltip = () => { return ( <> @@ -164,6 +166,8 @@ const PaymentContainer = ({ }; const planSuggestion = () => { + if (isNonProfit) return; + if (isFreeTariff) { return ( { + if (isFreeTariff || isNonProfit) return; + + if (isGracePeriod) + return ( + + + Grace period activated + + from {{ fromDate: paymentDate }} to + {{ byDate: gracePeriodEndDate }} + + (days remaining: {{ delayDaysCount }}) + {" "} + + {t("GracePeriodActivatedDescription")} + + + ); + + if (isPaidPeriod) + return ( + + + {{ finalDate: paymentDate }} + + + ); + }; + const isPayer = user.email === payerEmail; const isFreeAfterPaidPeriod = isFreeTariff && payerEmail?.length !== 0; @@ -244,7 +283,7 @@ const PaymentContainer = ({ ? expiredTitleSubscriptionWarning() : currentPlanTitle()} - {isAlreadyPaid && ( + {!isNonProfit && isAlreadyPaid && ( {planSuggestion()} + {planDescription()} - {isGracePeriod && ( - - - Grace period activated - - from {{ fromDate: paymentDate }} to - {{ byDate: gracePeriodEndDate }} - - (days remaining: {{ delayDaysCount }}) - {" "} - - {t("GracePeriodActivatedDescription")} - - - )} + {!isNonProfit && + !isGracePeriod && + !isNotPaidPeriod && + !isFreeAfterPaidPeriod && ( +
+ + + From {{ currencySymbol }} + {{ price: startValue }} per admin/power user /month + + - {isPaidPeriod && !isFreeTariff && ( - - - {{ finalDate: paymentDate }} - - - )} + {renderTooltip()} +
+ )} - {!isGracePeriod && !isNotPaidPeriod && !isFreeAfterPaidPeriod && ( -
- - - From {{ currencySymbol }} - {{ price: startValue }} per admin/power user /month - - - - {renderTooltip()} -
- )}
- + {!isNonProfit && ( + + )}
@@ -327,7 +344,9 @@ export default inject(({ auth, payments }) => { } = auth; const { showText: expandArticle } = settingsStore; - const { isFreeTariff, currentTariffPlanTitle } = currentQuotaStore; + const { isFreeTariff, currentTariffPlanTitle, isNonProfit } = + currentQuotaStore; + const { isNotPaidPeriod, isPaidPeriod, @@ -372,5 +391,6 @@ export default inject(({ auth, payments }) => { currentTariffPlanTitle, portalTariffStatus, portalPaymentQuotas, + isNonProfit, }; })(withRouter(observer(PaymentContainer))); diff --git a/packages/common/components/Article/index.js b/packages/common/components/Article/index.js index 11339673c0..fc848c4fdd 100644 --- a/packages/common/components/Article/index.js +++ b/packages/common/components/Article/index.js @@ -40,6 +40,7 @@ const Article = ({ withSendAgain, mainBarVisible, isBannerVisible, + isNonProfit, ...rest }) => { const [articleHeaderContent, setArticleHeaderContent] = React.useState(null); @@ -178,6 +179,7 @@ const Article = ({ )} {isPaymentPageAvailable && + !isNonProfit && (isFreeTariff || isGracePeriod) && showText && ( { isPaymentPageAvailable, bannerStore, } = auth; - const { isFreeTariff } = currentQuotaStore; + const { isFreeTariff, isNonProfit } = currentQuotaStore; const { isGracePeriod } = currentTariffStatusStore; const { withSendAgain } = userStore; @@ -283,5 +285,6 @@ export default inject(({ auth }) => { withSendAgain, mainBarVisible, isBannerVisible, + isNonProfit, }; })(observer(Article)); diff --git a/packages/common/store/CurrentQuotaStore.js b/packages/common/store/CurrentQuotaStore.js index 0243db7a64..3ac6d2e12e 100644 --- a/packages/common/store/CurrentQuotaStore.js +++ b/packages/common/store/CurrentQuotaStore.js @@ -207,6 +207,10 @@ class QuotasStore { ); } + get isNonProfit() { + return this.currentPortalQuota?.nonProfit; + } + setPortalQuotaValue = (res) => { this.currentPortalQuota = res; this.currentPortalQuotaFeatures = res.features;