Skip to content

Commit b7e5620

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

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

services/web-ui/src/features/chat/pages/ChatPage/ChatPage.nav.tsx

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React, { ReactNode } from "react";
1+
import { ReactElement, ReactNode } from "react";
22
import { Link as ReactRouterLink } from "react-router-dom";
33

4-
import { ArrowBackIosNew } from "@mui/icons-material";
4+
import { ArrowBack } from "@mui/icons-material";
55
import { Box, IconButton } from "@mui/material";
66

77
import { Nav } from "src/components/nav";
@@ -10,18 +10,16 @@ interface ChatPageNavProps {
1010
children: ReactNode;
1111
}
1212

13-
export function ChatPageNav({
14-
children,
15-
}: ChatPageNavProps): React.ReactElement {
13+
export function ChatPageNav({ children }: ChatPageNavProps): ReactElement {
1614
const appBarContent = (
1715
<IconButton
1816
component={ReactRouterLink}
1917
sx={{
20-
pr: 2,
18+
mr: 2,
2119
}}
2220
to="/chat"
2321
>
24-
<ArrowBackIosNew sx={{ paddingRight: 1 / 2 }} />
22+
<ArrowBack />
2523
</IconButton>
2624
);
2725

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { ReactElement, ReactNode } from "react";
2+
import { Link as ReactRouterLink } from "react-router-dom";
3+
4+
import { ArrowBack } from "@mui/icons-material";
5+
import { Box, IconButton, Typography } from "@mui/material";
26

3-
import { NavLayout } from "src/components/layout";
47
import { Nav } from "src/components/nav";
58
import { useTranslation } from "src/core/i18n";
69

@@ -13,11 +16,24 @@ export function AppearancePageNav({
1316
}: AppearancePageNavProps): ReactElement {
1417
const { t } = useTranslation("settings");
1518

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+
);
1634
return (
17-
<Nav>
18-
<NavLayout header={t("header")} linkText="Back" to="/profile">
19-
{children}
20-
</NavLayout>
35+
<Nav appBarContent={appBarContent}>
36+
<Box sx={{ pt: 1, px: 3 }}>{children}</Box>
2137
</Nav>
2238
);
2339
}

0 commit comments

Comments
 (0)