Skip to content

Commit

Permalink
feat(web-ui): improve mobile nav (#871)
Browse files Browse the repository at this point in the history
Co-authored-by: Johan Book <{ID}+{username}@users.noreply.github.com>
  • Loading branch information
johanbook and Johan Book authored Jul 16, 2024
1 parent 839bed4 commit b7e5620
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactNode } from "react";
import { ReactElement, ReactNode } from "react";
import { Link as ReactRouterLink } from "react-router-dom";

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

import { Nav } from "src/components/nav";
Expand All @@ -10,18 +10,16 @@ interface ChatPageNavProps {
children: ReactNode;
}

export function ChatPageNav({
children,
}: ChatPageNavProps): React.ReactElement {
export function ChatPageNav({ children }: ChatPageNavProps): ReactElement {
const appBarContent = (
<IconButton
component={ReactRouterLink}
sx={{
pr: 2,
mr: 2,
}}
to="/chat"
>
<ArrowBackIosNew sx={{ paddingRight: 1 / 2 }} />
<ArrowBack />
</IconButton>
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { ReactElement, ReactNode } from "react";
import { Link as ReactRouterLink } from "react-router-dom";

import { ArrowBack } from "@mui/icons-material";
import { Box, IconButton, Typography } from "@mui/material";

import { NavLayout } from "src/components/layout";
import { Nav } from "src/components/nav";
import { useTranslation } from "src/core/i18n";

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

const appBarContent = (
<>
<IconButton
component={ReactRouterLink}
sx={{
mr: 2,
}}
to="/profile"
>
<ArrowBack />
</IconButton>

<Typography variant="h5">{t("header")}</Typography>
</>
);
return (
<Nav>
<NavLayout header={t("header")} linkText="Back" to="/profile">
{children}
</NavLayout>
<Nav appBarContent={appBarContent}>
<Box sx={{ pt: 1, px: 3 }}>{children}</Box>
</Nav>
);
}

0 comments on commit b7e5620

Please sign in to comment.