diff --git a/web/apps/photos/src/components/pages/gallery/PlanSelector/index.tsx b/web/apps/photos/src/components/pages/gallery/PlanSelector/index.tsx
index ed3d34d3a0..3879d3667a 100644
--- a/web/apps/photos/src/components/pages/gallery/PlanSelector/index.tsx
+++ b/web/apps/photos/src/components/pages/gallery/PlanSelector/index.tsx
@@ -1,11 +1,14 @@
import log from "@/base/log";
import { bytesInGB, formattedStorageByteSize } from "@/new/photos/utils/units";
import {
+ FlexWrapper,
FluidContainer,
SpaceBetweenFlex,
} from "@ente/shared/components/Container";
+import ArrowForward from "@mui/icons-material/ArrowForward";
import ChevronRight from "@mui/icons-material/ChevronRight";
import Close from "@mui/icons-material/Close";
+import Done from "@mui/icons-material/Done";
import {
Button,
ButtonProps,
@@ -40,6 +43,7 @@ import {
hasPaidSubscription,
hasStripeSubscription,
isOnFreePlan,
+ isPopularPlan,
isSubscriptionActive,
isSubscriptionCancelled,
isUserSubscribedPlan,
@@ -50,7 +54,6 @@ import {
} from "utils/billing";
import { getLocalUserDetails } from "utils/user";
import { getTotalFamilyUsage, isPartOfFamily } from "utils/user/family";
-import Plans from "./plans";
interface PlanSelectorProps {
modalView: boolean;
@@ -448,6 +451,185 @@ const CustomToggleButton = styled(ToggleButton)(({ theme }) => ({
width: "97.433px",
}));
+interface PlansProps {
+ plansResponse: PlansResponse | undefined;
+ planPeriod: PLAN_PERIOD;
+ subscription: Subscription;
+ bonusData?: BonusData;
+ onPlanSelect: (plan: Plan) => void;
+ closeModal: () => void;
+}
+
+const Plans = ({
+ plansResponse,
+ planPeriod,
+ subscription,
+ bonusData,
+ onPlanSelect,
+ closeModal,
+}: PlansProps) => {
+ const { freePlan, plans } = plansResponse ?? {};
+ return (
+
+ {plans
+ ?.filter((plan) => plan.period === planPeriod)
+ ?.map((plan) => (
+
+ ))}
+ {!hasPaidSubscription(subscription) &&
+ !hasAddOnBonus(bonusData) &&
+ freePlan && (
+
+ )}
+
+ );
+};
+
+interface PlanRowProps {
+ plan: Plan;
+ subscription: Subscription;
+ onPlanSelect: (plan: Plan) => void;
+ disabled: boolean;
+ popular: boolean;
+}
+
+function PlanRow({
+ plan,
+ subscription,
+ onPlanSelect,
+ disabled,
+ popular,
+}: PlanRowProps) {
+ const handleClick = () => {
+ !isUserSubscribedPlan(plan, subscription) && onPlanSelect(plan);
+ };
+
+ const PlanButton = disabled ? DisabledPlanButton : ActivePlanButton;
+
+ return (
+
+
+
+ {bytesInGB(plan.storage)}
+
+
+
+ {t("storage_unit.gb")}
+
+ {popular && !hasPaidSubscription(subscription) && (
+ {t("POPULAR")}
+ )}
+
+
+
+
+
+
+ {plan.price}{" "}
+ {" "}
+
+ {`/ ${
+ plan.period === PLAN_PERIOD.MONTH
+ ? t("MONTH_SHORT")
+ : t("YEAR")
+ }`}
+
+
+
+
+
+ );
+}
+
+const PlanRowContainer = styled(FlexWrapper)(() => ({
+ background:
+ "linear-gradient(268.22deg, rgba(256, 256, 256, 0.08) -3.72%, rgba(256, 256, 256, 0) 85.73%)",
+}));
+
+const TopAlignedFluidContainer = styled(FluidContainer)`
+ align-items: flex-start;
+`;
+
+const DisabledPlanButton = styled((props: ButtonProps) => (
+ } {...props} />
+))(({ theme }) => ({
+ "&.Mui-disabled": {
+ backgroundColor: "transparent",
+ color: theme.colors.text.base,
+ },
+}));
+
+const ActivePlanButton = styled((props: ButtonProps) => (
+ } />
+))(() => ({
+ ".MuiButton-endIcon": {
+ transition: "transform .2s ease-in-out",
+ },
+ "&:hover .MuiButton-endIcon": {
+ transform: "translateX(4px)",
+ },
+}));
+
+const Badge = styled(Box)(({ theme }) => ({
+ borderRadius: theme.shape.borderRadius,
+ padding: "2px 4px",
+ backgroundColor: theme.colors.black.muted,
+ backdropFilter: `blur(${theme.colors.blur.muted})`,
+ color: theme.colors.white.base,
+ textTransform: "uppercase",
+ ...theme.typography.mini,
+}));
+
+interface FreePlanRowProps {
+ storage: number;
+ closeModal: () => void;
+}
+
+const FreePlanRow: React.FC = ({ closeModal, storage }) => {
+ return (
+
+
+ {t("free_plan_option")}
+
+ {t("free_plan_description", {
+ storage: formattedStorageByteSize(storage),
+ })}
+
+
+
+
+
+
+ );
+};
+
+const FreePlanRow_ = styled(SpaceBetweenFlex)(({ theme }) => ({
+ gap: theme.spacing(1.5),
+ padding: theme.spacing(1.5, 1),
+ cursor: "pointer",
+ "&:hover .endIcon": {
+ backgroundColor: "rgba(255,255,255,0.08)",
+ },
+}));
+
function BFAddOnRow({ bonusData, closeModal }) {
return (
<>
diff --git a/web/apps/photos/src/components/pages/gallery/PlanSelector/plans/index.tsx b/web/apps/photos/src/components/pages/gallery/PlanSelector/plans/index.tsx
deleted file mode 100644
index 942607be89..0000000000
--- a/web/apps/photos/src/components/pages/gallery/PlanSelector/plans/index.tsx
+++ /dev/null
@@ -1,209 +0,0 @@
-import { bytesInGB, formattedStorageByteSize } from "@/new/photos/utils/units";
-import {
- FlexWrapper,
- FluidContainer,
- SpaceBetweenFlex,
-} from "@ente/shared/components/Container";
-import ArrowForward from "@mui/icons-material/ArrowForward";
-import Done from "@mui/icons-material/Done";
-import {
- Box,
- Button,
- ButtonProps,
- IconButton,
- Stack,
- Typography,
- styled,
-} from "@mui/material";
-import { PLAN_PERIOD } from "constants/gallery";
-import { t } from "i18next";
-import type { PlansResponse } from "services/billingService";
-import { Plan, Subscription } from "types/billing";
-import { BonusData } from "types/user";
-import {
- hasAddOnBonus,
- hasPaidSubscription,
- isPopularPlan,
- isUserSubscribedPlan,
-} from "utils/billing";
-
-interface PlansProps {
- plansResponse: PlansResponse | undefined;
- planPeriod: PLAN_PERIOD;
- subscription: Subscription;
- bonusData?: BonusData;
- onPlanSelect: (plan: Plan) => void;
- closeModal: () => void;
-}
-
-const Plans = ({
- plansResponse,
- planPeriod,
- subscription,
- bonusData,
- onPlanSelect,
- closeModal,
-}: PlansProps) => {
- const { freePlan, plans } = plansResponse ?? {};
- return (
-
- {plans
- ?.filter((plan) => plan.period === planPeriod)
- ?.map((plan) => (
-
- ))}
- {!hasPaidSubscription(subscription) &&
- !hasAddOnBonus(bonusData) &&
- freePlan && (
-
- )}
-
- );
-};
-
-export default Plans;
-
-interface PlanRowProps {
- plan: Plan;
- subscription: Subscription;
- onPlanSelect: (plan: Plan) => void;
- disabled: boolean;
- popular: boolean;
-}
-
-function PlanRow({
- plan,
- subscription,
- onPlanSelect,
- disabled,
- popular,
-}: PlanRowProps) {
- const handleClick = () => {
- !isUserSubscribedPlan(plan, subscription) && onPlanSelect(plan);
- };
-
- const PlanButton = disabled ? DisabledPlanButton : ActivePlanButton;
-
- return (
-
-
-
- {bytesInGB(plan.storage)}
-
-
-
- {t("storage_unit.gb")}
-
- {popular && !hasPaidSubscription(subscription) && (
- {t("POPULAR")}
- )}
-
-
-
-
-
-
- {plan.price}{" "}
- {" "}
-
- {`/ ${
- plan.period === PLAN_PERIOD.MONTH
- ? t("MONTH_SHORT")
- : t("YEAR")
- }`}
-
-
-
-
-
- );
-}
-
-const PlanRowContainer = styled(FlexWrapper)(() => ({
- background:
- "linear-gradient(268.22deg, rgba(256, 256, 256, 0.08) -3.72%, rgba(256, 256, 256, 0) 85.73%)",
-}));
-
-const TopAlignedFluidContainer = styled(FluidContainer)`
- align-items: flex-start;
-`;
-
-const DisabledPlanButton = styled((props: ButtonProps) => (
- } {...props} />
-))(({ theme }) => ({
- "&.Mui-disabled": {
- backgroundColor: "transparent",
- color: theme.colors.text.base,
- },
-}));
-
-const ActivePlanButton = styled((props: ButtonProps) => (
- } />
-))(() => ({
- ".MuiButton-endIcon": {
- transition: "transform .2s ease-in-out",
- },
- "&:hover .MuiButton-endIcon": {
- transform: "translateX(4px)",
- },
-}));
-
-const Badge = styled(Box)(({ theme }) => ({
- borderRadius: theme.shape.borderRadius,
- padding: "2px 4px",
- backgroundColor: theme.colors.black.muted,
- backdropFilter: `blur(${theme.colors.blur.muted})`,
- color: theme.colors.white.base,
- textTransform: "uppercase",
- ...theme.typography.mini,
-}));
-
-interface FreePlanRowProps {
- storage: number;
- closeModal: () => void;
-}
-
-const FreePlanRow: React.FC = ({ closeModal, storage }) => {
- return (
-
-
- {t("free_plan_option")}
-
- {t("free_plan_description", {
- storage: formattedStorageByteSize(storage),
- })}
-
-
-
-
-
-
- );
-};
-
-const FreePlanRow_ = styled(SpaceBetweenFlex)(({ theme }) => ({
- gap: theme.spacing(1.5),
- padding: theme.spacing(1.5, 1),
- cursor: "pointer",
- "&:hover .endIcon": {
- backgroundColor: "rgba(255,255,255,0.08)",
- },
-}));