Skip to content

Commit cbd57ca

Browse files
johanbookJohan Book
and
Johan Book
authored
feat(web-ui): improve nav further (#872)
Co-authored-by: Johan Book <{ID}+{username}@users.noreply.github.com>
1 parent b7e5620 commit cbd57ca

File tree

5 files changed

+70
-18
lines changed

5 files changed

+70
-18
lines changed

services/web-ui/src/features/settings/pages/AppearancePage/AppearancePage.nav.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export function AppearancePageNav({
3131
<Typography variant="h5">{t("header")}</Typography>
3232
</>
3333
);
34+
3435
return (
3536
<Nav appBarContent={appBarContent}>
3637
<Box sx={{ pt: 1, px: 3 }}>{children}</Box>
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { ReactElement, ReactNode } from "react";
2+
import { Link as ReactRouterLink } from "react-router-dom";
23

3-
import { Typography } from "@mui/material";
4+
import { ArrowBack } from "@mui/icons-material";
5+
import { Box, IconButton, Typography } from "@mui/material";
46

5-
import { NavLayout } from "src/components/layout";
67
import { Nav } from "src/components/nav";
78
import { useTranslation } from "src/core/i18n";
89

@@ -15,13 +16,29 @@ export function SettingsPageNav({
1516
}: SettingsPageNavProps): ReactElement {
1617
const { t } = useTranslation("settings");
1718

19+
const appBarContent = (
20+
<>
21+
<IconButton
22+
component={ReactRouterLink}
23+
sx={{
24+
mr: 2,
25+
}}
26+
to="/profile"
27+
>
28+
<ArrowBack />
29+
</IconButton>
30+
31+
<Typography variant="h5">{t("header")}</Typography>
32+
</>
33+
);
34+
1835
return (
19-
<Nav>
20-
<NavLayout header={t("header")} linkText="Back" to="/profile">
36+
<Nav appBarContent={appBarContent}>
37+
<Box sx={{ pt: 1, px: 3 }}>
2138
<Typography color="textSecondary">{t("description")}</Typography>
2239

2340
{children}
24-
</NavLayout>
41+
</Box>
2542
</Nav>
2643
);
2744
}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import React, { ReactNode } from "react";
1+
import { ReactElement, ReactNode } from "react";
2+
import { Link as ReactRouterLink } from "react-router-dom";
23

3-
import { Typography } from "@mui/material";
4+
import { ArrowBack } from "@mui/icons-material";
5+
import { Box, IconButton, Typography } from "@mui/material";
46

5-
import { NavLayout } from "src/components/layout";
67
import { Nav } from "src/components/nav";
78
import { useTranslation } from "src/core/i18n";
89

@@ -12,16 +13,32 @@ interface OrganizationListPageNavProps {
1213

1314
export function OrganizationListPageNav({
1415
children,
15-
}: OrganizationListPageNavProps): React.ReactElement {
16+
}: OrganizationListPageNavProps): ReactElement {
1617
const { t } = useTranslation("organization-list");
1718

19+
const appBarContent = (
20+
<>
21+
<IconButton
22+
component={ReactRouterLink}
23+
sx={{
24+
mr: 2,
25+
}}
26+
to="/profile"
27+
>
28+
<ArrowBack />
29+
</IconButton>
30+
31+
<Typography variant="h5">{t("header")}</Typography>
32+
</>
33+
);
34+
1835
return (
19-
<Nav>
20-
<NavLayout header={t("header")} linkText={t("links.back")} to="/profile">
36+
<Nav appBarContent={appBarContent}>
37+
<Box sx={{ pt: 1, px: 3 }}>
2138
<Typography color="textSecondary">{t("description")}</Typography>
2239

2340
{children}
24-
</NavLayout>
41+
</Box>
2542
</Nav>
2643
);
2744
}

services/web-ui/src/pages/ProfileJournalPage/ProfileJournalPage.component.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function ProfileJournalPageComponent({
3232
return (
3333
<Table
3434
columns={columns}
35-
height="55vh"
35+
height="65vh"
3636
initialState={{
3737
sorting: {
3838
sortModel: [{ field: "created", sort: "desc" }],

services/web-ui/src/pages/ProfileJournalPage/ProfileJournalPage.nav.tsx

+22-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { ReactElement, ReactNode } from "react";
2+
import { Link as ReactRouterLink } from "react-router-dom";
23

3-
import { Grid, Typography } from "@mui/material";
4+
import { ArrowBack } from "@mui/icons-material";
5+
import { Box, Grid, IconButton, Typography } from "@mui/material";
46

5-
import { NavLayout } from "src/components/layout";
67
import { Nav } from "src/components/nav";
78
import { DatePicker } from "src/components/ui/DatePicker";
89
import { useTranslation } from "src/core/i18n";
@@ -25,9 +26,25 @@ export function ProfileJournalPageNav({
2526
}: ProfileJournalPageNavProps): ReactElement {
2627
const { t } = useTranslation("journal");
2728

29+
const appBarContent = (
30+
<>
31+
<IconButton
32+
component={ReactRouterLink}
33+
sx={{
34+
mr: 2,
35+
}}
36+
to="/profile"
37+
>
38+
<ArrowBack />
39+
</IconButton>
40+
41+
<Typography variant="h5">{t("header")}</Typography>
42+
</>
43+
);
44+
2845
return (
29-
<Nav>
30-
<NavLayout header={t("header")} linkText={t("links.back")} to="/profile">
46+
<Nav appBarContent={appBarContent}>
47+
<Box sx={{ pt: 1, px: 3 }}>
3148
<Typography color="textSecondary" sx={{ paddingBottom: 3 }}>
3249
{t("description")}
3350
</Typography>
@@ -53,7 +70,7 @@ export function ProfileJournalPageNav({
5370
</Grid>
5471

5572
{children}
56-
</NavLayout>
73+
</Box>
5774
</Nav>
5875
);
5976
}

0 commit comments

Comments
 (0)