Skip to content

Commit 8bd51aa

Browse files
authored
Merge pull request #7 from bramstroker/feat/profile-page
Implement separate profile page
2 parents 295f403 + 40860fb commit 8bd51aa

12 files changed

Lines changed: 3006 additions & 4578 deletions

File tree

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2609 additions & 4305 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"@emotion/react": "^11.14.0",
77
"@emotion/styled": "^11.14.0",
88
"@mui/icons-material": "^6.2.0",
9-
"@mui/material": "^6.2.0",
9+
"@mui/material": "^6.4.4",
1010
"@mui/styles": "^6.2.0",
1111
"@mui/x-date-pickers": "^7.23.2",
1212
"@tanstack/react-query": "^5.29.2",

src/components/DetailPanel.tsx

Lines changed: 0 additions & 204 deletions
This file was deleted.

src/components/Header.tsx

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,26 @@ import Typography from "@mui/material/Typography";
55
import Container from "@mui/material/Container";
66
import Logo from "./Logo";
77
import {
8-
MRT_GlobalFilterTextField,
8+
MRT_GlobalFilterTextField, MRT_ShowHideColumnsButton,
99
MRT_TableInstance,
1010
} from "material-react-table";
1111
import { PowerProfile } from "../types/PowerProfile";
12-
import { useColorScheme } from "@mui/material/styles";
13-
import { IconButton } from "@mui/material";
14-
import Brightness4Icon from "@mui/icons-material/Brightness4";
15-
import Brightness7Icon from "@mui/icons-material/Brightness7";
1612
import { useTheme } from "@mui/material";
13+
import {indigo} from "@mui/material/colors";
1714

1815
type HeaderProps = {
19-
total: number;
20-
table: MRT_TableInstance<PowerProfile>;
16+
total?: number;
17+
table?: MRT_TableInstance<PowerProfile>;
2118
};
2219

2320
export function Header({ total, table }: HeaderProps) {
2421
const theme = useTheme();
25-
const { mode, setMode } = useColorScheme();
2622

2723
return (
2824
<AppBar
2925
position="static"
3026
enableColorOnDark
31-
sx={{ justifyContent: "center" }}
27+
sx={{ justifyContent: "center", backgroundColor: indigo[700] }}
3228
>
3329
<Container maxWidth="xl">
3430
<Toolbar
@@ -72,24 +68,13 @@ export function Header({ total, table }: HeaderProps) {
7268
</Typography>
7369
</Box>
7470

75-
<MRT_GlobalFilterTextField table={table} sx={{ mr: 2 }} />
71+
{ table && <MRT_GlobalFilterTextField table={table} sx={{ mr: 2 }} /> }
7672

77-
<Box sx={{ flexGrow: 0, display: { xs: "none", md: "flex" } }}>
78-
<Typography noWrap>{total} profiles</Typography>
79-
</Box>
73+
{ table && <MRT_ShowHideColumnsButton table={table} /> }
8074

81-
<IconButton
82-
sx={{
83-
ml: 1,
84-
display: { xs: "none", sm: "flex" },
85-
}}
86-
onClick={() => {
87-
setMode(mode === "light" ? "dark" : "light");
88-
}}
89-
color="inherit"
90-
>
91-
{mode === "light" ? <Brightness7Icon /> : <Brightness4Icon />}
92-
</IconButton>
75+
{ table && <Box sx={{ flexGrow: 0, display: { xs: "none", md: "flex" } }}>
76+
<Typography noWrap>{total} profiles</Typography>
77+
</Box> }
9378
</Toolbar>
9479
</Container>
9580
</AppBar>

0 commit comments

Comments
 (0)