A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: fix after trial period pricing ui
Abdullah Atta0b5128b13b49
diff --git a/apps/web/src/dialogs/buy-dialog/buy-dialog.tsx b/apps/web/src/dialogs/buy-dialog/buy-dialog.tsxindex ece9465bc..a3be39966 100644--- a/apps/web/src/dialogs/buy-dialog/buy-dialog.tsx+++ b/apps/web/src/dialogs/buy-dialog/buy-dialog.tsx@@ -35,7 +35,7 @@ import {PlansList} from "./plan-list";import { useCheckoutStore } from "./store";-import { toPricingInfo } from "./helpers";+import { formatPrice, toPricingInfo } from "./helpers";import { isUserSubscribed } from "../../hooks/use-is-user-premium";import BaseDialog from "../../components/dialog";import { ScopedThemeProvider } from "../../components/theme-provider";@@ -404,7 +404,7 @@ export function CheckoutPricing(props: CheckoutPricingProps) {</Flex>{pricingInfo.price.trial_period ? (<Text variant="body" color="heading">- FREE+ {formatPrice(0, pricingInfo.price.currency)}</Text>) : (<Text variant="body" color="heading">@@ -563,7 +563,7 @@ export function CheckoutPricing(props: CheckoutPricingProps) {</Text>{price.trial_period ? (<Text as="div" variant="title" sx={{ textAlign: "end" }}>- FREE+ {formatPrice(0, pricingInfo.price.currency)}</Text>) : (<Textdiff --git a/apps/web/src/dialogs/buy-dialog/paddle.tsx b/apps/web/src/dialogs/buy-dialog/paddle.tsxindex 6a2e6fadf..8962454e2 100644--- a/apps/web/src/dialogs/buy-dialog/paddle.tsx+++ b/apps/web/src/dialogs/buy-dialog/paddle.tsx@@ -222,6 +222,9 @@ function getPricingInfo(): PricingInfo {const isRecurringDiscount = !!data.recurring_totals?.discount;const price = data.items[0];+ const totals = price.trial_period+ ? price.recurring_totals || price.totals+ : price.totals;return {country: options.countryCode || "US",period: options.period,@@ -253,9 +256,9 @@ function getPricingInfo(currency: data.currency_code,id: price.price_id,period: options.period,- subtotal: formatPrice(data.totals.subtotal, data.currency_code),- total: formatPrice(data.totals.total, data.currency_code),- tax: formatPrice(data.totals.tax, data.currency_code),+ subtotal: formatPrice(totals.subtotal, data.currency_code),+ total: formatPrice(totals.total, data.currency_code),+ tax: formatPrice(totals.tax, data.currency_code),trial_period: price.trial_period? {frequency: price.trial_period.frequency