diff options
author | asketonim <anton.dubik33@gmail.com> | 2020-02-03 19:53:37 +0300 |
---|---|---|
committer | asketonim <anton.dubik33@gmail.com> | 2020-02-03 19:53:37 +0300 |
commit | cf10bd8925fe8cbffb91e2b282e16f086575bf32 (patch) | |
tree | deb6ca00818fdba03732264e8884c1d2ec4c5e7c /src | |
parent | 6bbf39de74bbe7437bca5369e9ac751fff8f4fb8 (diff) | |
download | react-benzin-cf10bd8925fe8cbffb91e2b282e16f086575bf32.tar.gz |
feat: migrate Header to TypeScript
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Header/Header.tsx (renamed from src/lib/Header/Header.js) | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/lib/Header/Header.js b/src/lib/Header/Header.tsx index 3ade7b3..85dac4b 100644 --- a/src/lib/Header/Header.js +++ b/src/lib/Header/Header.tsx @@ -11,7 +11,19 @@ import { import { makeStyles } from '@material-ui/core/styles'; -const useStyles = makeStyles(theme => ({ +interface PropTypes { + logo: { + icon: React.ReactNode; + title: string; + }; + contents: any; + page: string; + setPage: any; +} + + + +const useStyles = makeStyles((theme: any) => ({ root: { background: theme.palette.background.elevation2, color: theme.palette.text.primary, @@ -34,10 +46,10 @@ const useStyles = makeStyles(theme => ({ })); -const Header = ({ logo, contents, page, setPage }) => { +const Header: React.FC<PropTypes> = ({ logo, contents, page, setPage }) => { const classes = useStyles(); - const handleChange = (event, newPage) => { + const handleChange = (event: any, newPage: string) => { setPage(newPage); }; |