Feat(Nui): Nui send event | Close button

This commit is contained in:
chip committed 2020-08-28 00:22:25 +02:00
1 parent 3a213ea308
commit 5ae9f99f42
3 files changed
+31 -1

No files matched your search

@@ -7,8 +7,11 @@ import {
import KeyboardArrowLeftIcon from "@material-ui/icons/KeyboardArrowLeft";
import AppsIcon from "@material-ui/icons/Apps";
import PhoneIcon from "@material-ui/icons/Phone";
import RadioButtonUncheckedIcon from "@material-ui/icons/RadioButtonUnchecked";
import { useHistory } from "react-router-dom";
import Nui from "../../nui-events/utils/Nui";
const useStyles = makeStyles((theme) => ({
root: {
zIndex: 2,
@@ -17,6 +20,11 @@ const useStyles = makeStyles((theme) => ({
}));
export const Navigation = () => {
const closePhone = () => {
console.log("Phone closed");
Nui.send("phone:close");
};
const classes = useStyles();
const history = useHistory();
return (
@@ -34,6 +42,11 @@ export const Navigation = () => {
value={() => history.push("/")}
icon={<AppsIcon className={classes.icon} />}
/>
<BottomNavigationAction
label="Close"
value={() => closePhone()}
icon={<RadioButtonUncheckedIcon className={classes.icon} />}
/>
<BottomNavigationAction
label="Back"
value={() => history.goBack()}