Skip to content

Commit 18acdc7

Browse files
authored
Merge pull request #595 from johanbook/nav-layout
refactor(web-ui): rename nav-layout
2 parents c3f5ac4 + 0c56a6e commit 18acdc7

File tree

7 files changed

+21
-18
lines changed

7 files changed

+21
-18
lines changed

services/web-ui/public/locales/en/organization-list.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
}
77
},
88
"description": "These are the groups you are a member of",
9-
"header": "Groups"
9+
"header": "Groups",
10+
"links": {
11+
"back": "Back"
12+
}
1013
}

services/web-ui/public/locales/sv/organization-list.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
}
77
},
88
"description": "De här är de grupper som du är medlem i",
9-
"header": "Grupper"
9+
"header": "Grupper",
10+
"links": {
11+
"back": "Tillbaka"
12+
}
1013
}

services/web-ui/src/components/layout/PageWithNav.tsx renamed to services/web-ui/src/components/layout/NavLayout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import { Link as ReactRouterLink } from "react-router-dom";
44
import { ArrowBackIosNew } from "@mui/icons-material";
55
import { Link as MuiLink, Typography } from "@mui/material";
66

7-
interface PageWithNavProps {
7+
interface NavLayoutProps {
88
children: ReactNode;
99
header?: string | null;
1010
linkText: string;
1111
to: string;
1212
}
1313

14-
export function PageWithNav({
14+
export function NavLayout({
1515
children,
1616
header,
1717
linkText,
1818
to,
19-
}: PageWithNavProps): ReactElement {
19+
}: NavLayoutProps): ReactElement {
2020
return (
2121
<>
2222
<MuiLink
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export { Page } from "./Page";
2-
export { PageWithNav } from "./PageWithNav";
2+
export { NavLayout } from "./NavLayout";

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ReactElement, ReactNode } from "react";
22

3-
import { PageWithNav } from "src/components/layout";
3+
import { NavLayout } from "src/components/layout";
44
import { useTranslation } from "src/core/i18n";
55

66
interface BlogPostPageNavProps {
@@ -13,8 +13,8 @@ export function BlogPostPageNav({
1313
const { t } = useTranslation("blog");
1414

1515
return (
16-
<PageWithNav linkText={t("links.back")} to="/">
16+
<NavLayout linkText={t("links.back")} to="/">
1717
{children}
18-
</PageWithNav>
18+
</NavLayout>
1919
);
2020
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ReactElement, ReactNode } from "react";
22

33
import { Grid, Typography } from "@mui/material";
44

5-
import { PageWithNav } from "src/components/layout";
5+
import { NavLayout } from "src/components/layout";
66
import { DatePicker } from "src/components/ui/DatePicker";
77
import { useTranslation } from "src/core/i18n";
88

@@ -25,7 +25,7 @@ export function JournalPageNav({
2525
const { t } = useTranslation("journal");
2626

2727
return (
28-
<PageWithNav header={t("header")} linkText={t("links.back")} to="/profile">
28+
<NavLayout header={t("header")} linkText={t("links.back")} to="/profile">
2929
<Typography color="textSecondary" sx={{ paddingBottom: 3 }}>
3030
{t("description")}
3131
</Typography>
@@ -51,6 +51,6 @@ export function JournalPageNav({
5151
</Grid>
5252

5353
{children}
54-
</PageWithNav>
54+
</NavLayout>
5555
);
5656
}

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { ReactNode } from "react";
22

33
import { Typography } from "@mui/material";
44

5+
import { NavLayout } from "src/components/layout";
56
import { useTranslation } from "src/core/i18n";
67

78
interface OrganizationListPageNavProps {
@@ -14,14 +15,10 @@ export function OrganizationListPageNav({
1415
const { t } = useTranslation("organization-list");
1516

1617
return (
17-
<>
18-
<Typography gutterBottom sx={{ paddingTop: 2 }} variant="h5">
19-
{t("header")}
20-
</Typography>
21-
18+
<NavLayout header={t("header")} linkText={t("links.back")} to="/profile">
2219
<Typography color="textSecondary">{t("description")}</Typography>
2320

2421
{children}
25-
</>
22+
</NavLayout>
2623
);
2724
}

0 commit comments

Comments
 (0)