aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorasketonim <anton.dubik33@gmail.com>2020-02-03 19:53:37 +0300
committerasketonim <anton.dubik33@gmail.com>2020-02-03 19:53:37 +0300
commitcf10bd8925fe8cbffb91e2b282e16f086575bf32 (patch)
treedeb6ca00818fdba03732264e8884c1d2ec4c5e7c
parent6bbf39de74bbe7437bca5369e9ac751fff8f4fb8 (diff)
downloadreact-benzin-cf10bd8925fe8cbffb91e2b282e16f086575bf32.tar.gz
feat: migrate Header to TypeScript
-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);
};