Skip to content

Commit 4aa1393

Browse files
authored
Merge pull request #596 from johanbook/nav
feat(web-ui): add navigations
2 parents 18acdc7 + 8c6dae0 commit 4aa1393

File tree

7 files changed

+23
-19
lines changed

7 files changed

+23
-19
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
}
1616
},
1717
"description": "By creating a new group you can organize friends and content in one place",
18-
"header": "Create a new group"
18+
"header": "Create a new group",
19+
"links": {
20+
"back": "Back"
21+
}
1922
}

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

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"header": "Group",
3+
"links": {
4+
"back": "Back"
5+
},
36
"members": {
47
"error": "Unable to retrieve organization members",
58
"header": "Members",

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
}
1616
},
1717
"description": "Genom att skapa ny grupp kan du samla vänner och innehåll på en plats",
18-
"header": "Skapa ny grupp"
18+
"header": "Skapa ny grupp",
19+
"links": {
20+
"back": "Tillbaka"
21+
}
1922
}

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

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"header": "Grupp",
3+
"links": {
4+
"back": "Tillbaka"
5+
},
36
"members": {
47
"error": "Fel vid hämtning av gruppmedlemmar",
58
"header": "Medlemmar",

services/web-ui/public/locales/sv/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"create-organization": "Skapa ny grupp",
66
"current-organization": "Nuvarande grupp",
77
"journal": "Journal",
8-
"list-organizations": "Tillgängliga grupper",
8+
"list-organizations": "Dina grupper",
99
"new-organization": "Skapa ny grupp"
1010
}
1111
},

services/web-ui/src/pages/CreateOrganizationPage/CreateOrganizationPage.container.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Box } from "@mui/material";
66

77
import { CreateOrganizationCommand } from "src/api";
88
import { organizationsApi } from "src/apis";
9+
import { NavLayout } from "src/components/layout";
910
import { Button, TextField, Typography } from "src/components/ui";
1011
import { useForm, validators } from "src/core/forms";
1112
import { useTranslation } from "src/core/i18n";
@@ -55,11 +56,7 @@ export function CreateOrganizationPageContainer(): ReactElement {
5556
}
5657

5758
return (
58-
<>
59-
<Typography gutterBottom sx={{ paddingTop: 2 }} variant="h5">
60-
{t("header")}
61-
</Typography>
62-
59+
<NavLayout header={t("header")} linkText={t("links.back")} to="/profile">
6360
<Typography color="textSecondary" sx={{ paddingBottom: 3 }}>
6461
{t("description")}
6562
</Typography>
@@ -91,6 +88,6 @@ export function CreateOrganizationPageContainer(): ReactElement {
9188
</Button>
9289
</Box>
9390
</form>
94-
</>
91+
</NavLayout>
9592
);
9693
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import React, { ReactNode } from "react";
2-
3-
import { Typography } from "@mui/material";
1+
import { ReactElement, ReactNode } from "react";
42

3+
import { NavLayout } from "src/components/layout";
54
import { useTranslation } from "src/core/i18n";
65

76
interface CurrentOrganizationPageNavProps {
@@ -10,16 +9,12 @@ interface CurrentOrganizationPageNavProps {
109

1110
export function CurrentOrganizationPageNav({
1211
children,
13-
}: CurrentOrganizationPageNavProps): React.ReactElement {
12+
}: CurrentOrganizationPageNavProps): ReactElement {
1413
const { t } = useTranslation("organization");
1514

1615
return (
17-
<>
18-
<Typography gutterBottom sx={{ paddingTop: 2 }} variant="h5">
19-
{t("header")}
20-
</Typography>
21-
16+
<NavLayout header={t("header")} linkText={t("links.back")} to="/profile">
2217
{children}
23-
</>
18+
</NavLayout>
2419
);
2520
}

0 commit comments

Comments
 (0)