feat: home link icon
This commit is contained in:
parent
43305a8d2f
commit
e4b9e32a09
@ -1,7 +1,20 @@
|
|||||||
import { Divider, Stack, SvgIcon, Typography } from "@mui/material";
|
import {
|
||||||
|
Button,
|
||||||
|
Divider,
|
||||||
|
Link,
|
||||||
|
Stack,
|
||||||
|
SvgIcon,
|
||||||
|
Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { useNavigation } from "@react-navigation/native";
|
||||||
|
import { NativeStackNavigationProp } from "@react-navigation/native-stack";
|
||||||
|
import { StackParamsList } from "../types";
|
||||||
|
|
||||||
export const Header: React.FC<{ title: string }> = ({ title }) => (
|
export const Header: React.FC<{ title: string }> = ({ title }) => {
|
||||||
|
const navigation =
|
||||||
|
useNavigation<NativeStackNavigationProp<StackParamsList>>();
|
||||||
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
sx={{
|
sx={{
|
||||||
@ -11,6 +24,12 @@ export const Header: React.FC<{ title: string }> = ({ title }) => (
|
|||||||
py: 2,
|
py: 2,
|
||||||
}}
|
}}
|
||||||
spacing={1}
|
spacing={1}
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
component={Link}
|
||||||
|
onClick={() => {
|
||||||
|
navigation.navigate("Home");
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<SvgIcon sx={{ height: 20, width: 115 }}>
|
<SvgIcon sx={{ height: 20, width: 115 }}>
|
||||||
<svg
|
<svg
|
||||||
@ -56,6 +75,7 @@ export const Header: React.FC<{ title: string }> = ({ title }) => (
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</SvgIcon>
|
</SvgIcon>
|
||||||
|
</Button>
|
||||||
<Divider
|
<Divider
|
||||||
flexItem
|
flexItem
|
||||||
orientation="vertical"
|
orientation="vertical"
|
||||||
@ -65,3 +85,4 @@ export const Header: React.FC<{ title: string }> = ({ title }) => (
|
|||||||
<Typography variant="h5">{title}</Typography>
|
<Typography variant="h5">{title}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user