Skip to content

armgit / ente

Public Imported from GitHub
0

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

Inline

Manav Rathif3c4ca932de2
diff --git a/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/index.tsx b/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/index.tsx
index 687ba37896..a84f6b98ad 100644
--- a/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/index.tsx
+++ b/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/index.tsx
@@ -1,17 +1,16 @@
-import { formattedStorageByteSize } from "@/new/photos/utils/units";
+import { bytesInGB, formattedStorageByteSize } from "@/new/photos/utils/units";
import {
FlexWrapper,
Overlay,
SpaceBetweenFlex,
} from "@ente/shared/components/Container";
-import { Box, Stack, Typography } from "@mui/material";
+import { Box, Stack, Typography, styled } from "@mui/material";
import { t } from "i18next";
import type React from "react";
import { useMemo } from "react";
import { UserDetails } from "types/user";
import { hasNonAdminFamilyMembers, isPartOfFamily } from "utils/user/family";
import { LegendIndicator, Progressbar } from "../styledComponents";
-import StorageSection from "./storageSection";
interface SubscriptionCardContentOverlayPprops {
userDetails: UserDetails;
@@ -60,6 +59,53 @@ const IndividualSubscriptionCardContent: React.FC<
);
};
+const MobileSmallBox = styled(Box)`
+ display: none;
+ @media (max-width: 359px) {
+ display: block;
+ }
+`;
+
+const DefaultBox = styled(Box)`
+ display: none;
+ @media (min-width: 360px) {
+ display: block;
+ }
+`;
+
+interface StorageSectionProps {
+ usage: number;
+ storage: number;
+}
+
+const StorageSection: React.FC<StorageSectionProps> = ({ usage, storage }) => {
+ return (
+ <Box width="100%">
+ <Typography variant="small" color={"text.muted"}>
+ {t("STORAGE")}
+ </Typography>
+ <DefaultBox>
+ <Typography
+ fontWeight={"bold"}
+ sx={{ fontSize: "24px", lineHeight: "30px" }}
+ >
+ {`${formattedStorageByteSize(usage, { round: true })} ${t(
+ "OF",
+ )} ${formattedStorageByteSize(storage)} ${t("USED")}`}
+ </Typography>
+ </DefaultBox>
+ <MobileSmallBox>
+ <Typography
+ fontWeight={"bold"}
+ sx={{ fontSize: "24px", lineHeight: "30px" }}
+ >
+ {`${bytesInGB(usage)} / ${bytesInGB(storage)} ${t("storage_unit.gb")} ${t("USED")}`}
+ </Typography>
+ </MobileSmallBox>
+ </Box>
+ );
+};
+
interface IndividualUsageSectionProps {
usage: number;
fileCount: number;
diff --git a/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/storageSection.tsx b/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/storageSection.tsx
index 4ad0ed2149..e69de29bb2 100644
--- a/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/storageSection.tsx
+++ b/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/storageSection.tsx
@@ -1,48 +0,0 @@
-import { bytesInGB, formattedStorageByteSize } from "@/new/photos/utils/units";
-import { Box, Typography, styled } from "@mui/material";
-import { t } from "i18next";
-
-const MobileSmallBox = styled(Box)`
- display: none;
- @media (max-width: 359px) {
- display: block;
- }
-`;
-
-const DefaultBox = styled(Box)`
- display: none;
- @media (min-width: 360px) {
- display: block;
- }
-`;
-interface Iprops {
- usage: number;
- storage: number;
-}
-export default function StorageSection({ usage, storage }: Iprops) {
- return (
- <Box width="100%">
- <Typography variant="small" color={"text.muted"}>
- {t("STORAGE")}
- </Typography>
- <DefaultBox>
- <Typography
- fontWeight={"bold"}
- sx={{ fontSize: "24px", lineHeight: "30px" }}
- >
- {`${formattedStorageByteSize(usage, { round: true })} ${t(
- "OF",
- )} ${formattedStorageByteSize(storage)} ${t("USED")}`}
- </Typography>
- </DefaultBox>
- <MobileSmallBox>
- <Typography
- fontWeight={"bold"}
- sx={{ fontSize: "24px", lineHeight: "30px" }}
- >
- {`${bytesInGB(usage)} / ${bytesInGB(storage)} ${t("storage_unit.gb")} ${t("USED")}`}
- </Typography>
- </MobileSmallBox>
- </Box>
- );
-}