Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Inline

Manav Rathi0a03df924242
diff --git a/web/apps/photos/src/components/pages/gallery/PlanSelector/card.tsx b/web/apps/photos/src/components/pages/gallery/PlanSelector/card.tsx
index cb2e08368d..c722534cfe 100644
--- a/web/apps/photos/src/components/pages/gallery/PlanSelector/card.tsx
+++ b/web/apps/photos/src/components/pages/gallery/PlanSelector/card.tsx
@@ -1,8 +1,8 @@
import log from "@/base/log";
-import { bytesInGB } from "@/new/photos/utils/units";
+import { bytesInGB, formattedStorageByteSize } from "@/new/photos/utils/units";
import { SpaceBetweenFlex } from "@ente/shared/components/Container";
import Close from "@mui/icons-material/Close";
-import { IconButton, Link, Stack } from "@mui/material";
+import { IconButton, Link, Stack, styled } from "@mui/material";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import { PLAN_PERIOD } from "constants/gallery";
@@ -32,7 +32,6 @@ import { getTotalFamilyUsage, isPartOfFamily } from "utils/user/family";
import { ManageSubscription } from "./manageSubscription";
import { PeriodToggler } from "./periodToggler";
import Plans from "./plans";
-import { BFAddOnRow } from "./plans/BfAddOnRow";
interface Props {
closeModal: any;
@@ -353,3 +352,41 @@ function PaidSubscriptionPlanSelectorCard({
</>
);
}
+
+function BFAddOnRow({ bonusData, closeModal }) {
+ return (
+ <>
+ {bonusData.storageBonuses.map((bonus) => {
+ if (bonus.type.startsWith("ADD_ON")) {
+ return (
+ <AddOnRowContainer key={bonus.id} onClick={closeModal}>
+ <Box>
+ <Typography color="text.muted">
+ <Trans
+ i18nKey={"add_on_valid_till"}
+ values={{
+ storage: formattedStorageByteSize(
+ bonus.storage,
+ ),
+ date: bonus.validTill,
+ }}
+ />
+ </Typography>
+ </Box>
+ </AddOnRowContainer>
+ );
+ }
+ return null;
+ })}
+ </>
+ );
+}
+
+const AddOnRowContainer = styled(SpaceBetweenFlex)(({ theme }) => ({
+ // gap: theme.spacing(1.5),
+ padding: theme.spacing(1, 0),
+ cursor: "pointer",
+ "&:hover .endIcon": {
+ backgroundColor: "rgba(255,255,255,0.08)",
+ },
+}));
diff --git a/web/apps/photos/src/components/pages/gallery/PlanSelector/plans/BfAddOnRow.tsx b/web/apps/photos/src/components/pages/gallery/PlanSelector/plans/BfAddOnRow.tsx
deleted file mode 100644
index 6484ae2156..0000000000
--- a/web/apps/photos/src/components/pages/gallery/PlanSelector/plans/BfAddOnRow.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { SpaceBetweenFlex } from "@ente/shared/components/Container";
-import { Box, styled, Typography } from "@mui/material";
-
-import { formattedStorageByteSize } from "@/new/photos/utils/units";
-import { Trans } from "react-i18next";
-
-const RowContainer = styled(SpaceBetweenFlex)(({ theme }) => ({
- // gap: theme.spacing(1.5),
- padding: theme.spacing(1, 0),
- cursor: "pointer",
- "&:hover .endIcon": {
- backgroundColor: "rgba(255,255,255,0.08)",
- },
-}));
-export function BFAddOnRow({ bonusData, closeModal }) {
- return (
- <>
- {bonusData.storageBonuses.map((bonus) => {
- if (bonus.type.startsWith("ADD_ON")) {
- return (
- <RowContainer key={bonus.id} onClick={closeModal}>
- <Box>
- <Typography color="text.muted">
- <Trans
- i18nKey={"add_on_valid_till"}
- values={{
- storage: formattedStorageByteSize(
- bonus.storage,
- ),
- date: bonus.validTill,
- }}
- />
- </Typography>
- </Box>
- </RowContainer>
- );
- }
- return null;
- })}
- </>
- );
-}