Skip to content

armgit / ente

Public Imported from GitHub
0

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

Inline

Manav Rathid50c577a2f1a
diff --git a/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/family/usageSection/index.tsx b/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/family/usageSection/index.tsx
index 91181d98bf..84ee5b0f69 100644
--- a/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/family/usageSection/index.tsx
+++ b/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/family/usageSection/index.tsx
@@ -4,8 +4,7 @@ import {
} from "@ente/shared/components/Container";
import { Box, Stack, Typography } from "@mui/material";
import { t } from "i18next";
-import { LegendIndicator } from "../../../styledComponents";
-import { FamilyUsageProgressBar } from "./progressBar";
+import { LegendIndicator, Progressbar } from "../../../styledComponents";
interface Iprops {
userUsage: number;
@@ -44,10 +43,44 @@ export function FamilyUsageSection({
);
}
+interface FamilyUsageProgressBarProps {
+ userUsage: number;
+ totalUsage: number;
+ totalStorage: number;
+}
+
+function FamilyUsageProgressBar({
+ userUsage,
+ totalUsage,
+ totalStorage,
+}: FamilyUsageProgressBarProps) {
+ return (
+ <Box position={"relative"} width="100%">
+ <Progressbar
+ sx={{ backgroundColor: "transparent" }}
+ value={Math.min((userUsage * 100) / totalStorage, 100)}
+ />
+ <Progressbar
+ sx={{
+ position: "absolute",
+ top: 0,
+ zIndex: 1,
+ ".MuiLinearProgress-bar ": {
+ backgroundColor: "text.muted",
+ },
+ width: "100%",
+ }}
+ value={Math.min((totalUsage * 100) / totalStorage, 100)}
+ />
+ </Box>
+ );
+}
+
interface LegendProps {
label: string;
color: string;
}
+
function Legend({ label, color }: LegendProps) {
return (
<FlexWrapper>
diff --git a/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/family/usageSection/progressBar.tsx b/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/family/usageSection/progressBar.tsx
deleted file mode 100644
index ab28b5b8f1..0000000000
--- a/web/apps/photos/src/components/Sidebar/SubscriptionCard/contentOverlay/family/usageSection/progressBar.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { Box } from "@mui/material";
-import { Progressbar } from "../../../styledComponents";
-interface Iprops {
- userUsage: number;
- totalUsage: number;
- totalStorage: number;
-}
-
-export function FamilyUsageProgressBar({
- userUsage,
- totalUsage,
- totalStorage,
-}: Iprops) {
- return (
- <Box position={"relative"} width="100%">
- <Progressbar
- sx={{ backgroundColor: "transparent" }}
- value={Math.min((userUsage * 100) / totalStorage, 100)}
- />
- <Progressbar
- sx={{
- position: "absolute",
- top: 0,
- zIndex: 1,
- ".MuiLinearProgress-bar ": {
- backgroundColor: "text.muted",
- },
- width: "100%",
- }}
- value={Math.min((totalUsage * 100) / totalStorage, 100)}
- />
- </Box>
- );
-}