Skip to content

Commit

Permalink
Add player spacer
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcretu committed Aug 26, 2023
1 parent 8fe54e1 commit 5bea8dc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ui/src/components/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "@mui/material";
import { ReactNode, useState } from "react";

import { BottomNavSpacer } from "@/components/BottomNav";
import { PlayerSpacer } from "@/components/Player";
import useIsMobile from "@/hooks/useIsMobile";
import { displayDesktop, displayMobile } from "@/styles/responsive";

Expand Down Expand Up @@ -79,7 +79,7 @@ function Mobile({ children, open, onOpen, onClose }: DrawerProps) {
<Box sx={{ overflow: "auto" }}>
<ToolbarSpacer />
{children}
<BottomNavSpacer />
<PlayerSpacer />
</Box>
</SwipeableDrawer>
);
Expand Down
9 changes: 8 additions & 1 deletion ui/src/components/Player/Player.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Box } from "@mui/material";
import { styled } from "@mui/material/styles";
import dynamic from "next/dynamic";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";

Expand Down Expand Up @@ -109,7 +110,7 @@ export default function Player({
return (
<Box
sx={{
minHeight: 80,
minHeight: (theme) => theme.spacing(10),
color: "base.contrastText",
backgroundColor: "base.main",
display: "flex",
Expand Down Expand Up @@ -171,3 +172,9 @@ export default function Player({
</Box>
);
}

// Utility component to help with spacing
// Just a box that's the same height as the player
export const PlayerSpacer = styled(Box)(({ theme }) => ({
height: theme.spacing(10),
}));
1 change: 1 addition & 0 deletions ui/src/components/Player/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default } from "./Player";
export * from "./Player";

0 comments on commit 5bea8dc

Please sign in to comment.