diff --git a/app/components/subscription/current-plan-details.tsx b/app/components/subscription/current-plan-details.tsx index 0a5e343e8..c7a181da1 100644 --- a/app/components/subscription/current-plan-details.tsx +++ b/app/components/subscription/current-plan-details.tsx @@ -12,6 +12,7 @@ export const CurrentPlanDetails = () => { You’re currently using the {activeProduct?.name} version of Shelf{" "} {isTrialSubscription ? " on a free trial" : ""}.

+
{subscription?.canceled_at ? ( <> diff --git a/app/components/subscription/prices.tsx b/app/components/subscription/prices.tsx index 47633f5f4..13ae7ebc7 100644 --- a/app/components/subscription/prices.tsx +++ b/app/components/subscription/prices.tsx @@ -64,7 +64,12 @@ export const Price = ({ const isFreePlan = price.id != "free"; const features = price.product.metadata.features?.split(",") || []; - // icons to be mapped with different plans + const amount = + price.unit_amount != null + ? price?.recurring?.interval === "year" + ? price.unit_amount / 10 + : price.unit_amount + : null; return (
@@ -96,16 +101,24 @@ export const Price = ({
) : null}
- {price.unit_amount != null ? ( -
- {(price.unit_amount / 100).toLocaleString("en-US", { - style: "currency", - currency: price.currency, - maximumFractionDigits: 0, - })} - {price.recurring ? ( - /{shortenIntervalString(price.recurring.interval)} - ) : null} + {amount != null ? ( +
+
+ {(amount / 100).toLocaleString("en-US", { + style: "currency", + currency: price.currency, + maximumFractionDigits: 0, + })} + {price.recurring ? /mo : null} +
+
+ {price?.recurring?.interval === "year" && + `Billed annually ${(amount / 10).toLocaleString("en-US", { + style: "currency", + currency: price.currency, + maximumFractionDigits: 0, + })}`} +
) : null}

diff --git a/app/routes/_layout+/settings.subscription.tsx b/app/routes/_layout+/settings.subscription.tsx index 34d55c1bb..23589e663 100644 --- a/app/routes/_layout+/settings.subscription.tsx +++ b/app/routes/_layout+/settings.subscription.tsx @@ -7,12 +7,14 @@ import { json, redirect } from "@remix-run/node"; import { Link, useLoaderData } from "@remix-run/react"; import { z } from "zod"; import { InfoIcon } from "~/components/icons/library"; +import { Button } from "~/components/shared/button"; import { Tabs, TabsContent, TabsList, TabsTrigger, } from "~/components/shared/tabs"; +import { WarningBox } from "~/components/shared/warning-box"; import { CurrentPlanDetails } from "~/components/subscription/current-plan-details"; import { CustomerPortalForm } from "~/components/subscription/customer-portal-form"; import { Prices } from "~/components/subscription/prices"; @@ -196,21 +198,44 @@ export const handle = { export default function UserPage() { const { title, subTitle, prices, subscription } = useLoaderData(); + const isLegacyPricing = + subscription?.items?.data[0]?.price?.metadata.legacy === "true"; return ( <>

-
-
- +
+
+
+ +
+ {!subscription ? ( +

+ You’re currently using the{" "} + FREE version of Shelf +

+ ) : ( + + )}
- {!subscription ? ( -

- You’re currently using the{" "} - FREE version of Shelf -

- ) : ( - + {isLegacyPricing && ( + +

+ You are on a{" "} + + . We have since updated our pricing plans.
+ You can view the new pricing plans in the customer portal. If + you cancel your subscription, you will not be able to renew it. +
+ For any questions - get in touch with support +

+
)}
@@ -223,19 +248,24 @@ export default function UserPage() {
+ + Yearly{" "} + + Save 54% + + Monthly - Yearly (2 months free) - - - + + +