Phone navigation button

This commit is contained in:
J Francisco Rader committed 2020-08-22 21:56:12 -03:00
1 parent d1c7e61b30
commit d36ef4ce38
1 file changed
+9 -6
+9 -6
View File
@@ -6,6 +6,7 @@ import {
} from "@material-ui/core";
import KeyboardArrowLeftIcon from "@material-ui/icons/KeyboardArrowLeft";
import AppsIcon from "@material-ui/icons/Apps";
import PhoneIcon from "@material-ui/icons/Phone";
import { useHistory } from "react-router-dom";
const useStyles = makeStyles((theme) => ({
@@ -18,24 +19,26 @@ const useStyles = makeStyles((theme) => ({
export const Navigation = () => {
const classes = useStyles();
const history = useHistory();
return (
<BottomNavigation
className={classes.root}
onChange={(_e, value) =>
value === "back" ? history.goBack() : history.push("/")
}
onChange={(_e, value) => value()}
>
<BottomNavigationAction
label="Back"
value="back"
value={() => history.goBack()}
icon={<KeyboardArrowLeftIcon />}
/>
<BottomNavigationAction
label="Home"
value="home"
value={() => history.push('/')}
icon={<AppsIcon className={classes.icon} />}
/>
<BottomNavigationAction
label="Phone"
value={() => history.push('/phone')}
icon={<PhoneIcon className={classes.icon} />}
/>
</BottomNavigation>
);
};