Skip to content

armgit / ente

Public Imported from GitHub
0

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

Move out

Manav Rathi7f1d8dba94b7
diff --git a/web/packages/base/components/mui/SidebarDrawer.tsx b/web/packages/base/components/mui/SidebarDrawer.tsx
index abaf84c64c..fdbb609fbf 100644
--- a/web/packages/base/components/mui/SidebarDrawer.tsx
+++ b/web/packages/base/components/mui/SidebarDrawer.tsx
@@ -5,6 +5,7 @@ import {
Drawer,
IconButton,
Stack,
+ styled,
Typography,
type DrawerProps,
} from "@mui/material";
@@ -35,32 +36,31 @@ export const SidebarDrawer: React.FC<DrawerProps> = ({ children, ...rest }) => (
},
}}
>
- {/* If running on desktop, adds a sticky opaque bar at the top with a
- * z-index greater than the expected sidebar contents. This ensures
- * that any title bar overlays added by the system (e.g. the traffic
- * lights on macOS) have a opaque background and the sidebar
- * contents scroll underneath them.
- *
- * See: [Note: Customize the desktop title bar]
- */}
- {wipDesktopCustomTitlebar && (
- <Box
- sx={{
- position: "sticky",
- top: 0,
- left: 0,
- width: "100%",
- minHeight: "env(titlebar-area-height, 30px)",
- bgcolor: "var(--mui-palette-backdrop-muted)",
- backdropFilter: "blur(3px)",
- zIndex: 10000,
- }}
- />
- )}
+ {wipDesktopCustomTitlebar && <AppTitlebarBackdrop />}
<Box sx={{ p: 1 }}>{children}</Box>
</Drawer>
);
+/**
+ * When running on desktop, we adds a sticky opaque bar at the top of the
+ * sidebar with a z-index greater than the expected sidebar contents. This
+ * ensures that any title bar overlays added by the system (e.g. the traffic
+ * lights on macOS) have a opaque-ish background and the sidebar contents scroll
+ * underneath them.
+ *
+ * See: [Note: Customize the desktop title bar]
+ */
+const AppTitlebarBackdrop = styled("div")(({ theme }) => ({
+ position: "sticky",
+ top: 0,
+ left: 0,
+ width: "100%",
+ minHeight: "env(titlebar-area-height, 30px)",
+ bgcolor: theme.vars.palette.backdrop.muted,
+ backdropFilter: "blur(3px)",
+ zIndex: 10000,
+}));
+
/**
* Common props for a {@link NestedSidebarDrawer} component. In addition to the
* regular modal visibility controls for opening and closing itself, these also