From 51df59e14cbf38f039aad104bc2b08eac6a5941d Mon Sep 17 00:00:00 2001 From: Akash Date: Sat, 25 Apr 2020 16:24:47 +0530 Subject: [PATCH] Enabling home button clickable feature --- simplq/src/components/Layout.jsx | 14 ++++++++++++-- simplq/src/components/Routes.jsx | 5 ++--- simplq/src/index.js | 7 ++++--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/simplq/src/components/Layout.jsx b/simplq/src/components/Layout.jsx index de1389f9..3c73708c 100644 --- a/simplq/src/components/Layout.jsx +++ b/simplq/src/components/Layout.jsx @@ -5,6 +5,8 @@ import Typography from '@material-ui/core/Typography'; import { makeStyles } from '@material-ui/core/styles'; import Link from '@material-ui/core/Link'; import Routes from './Routes' +import Button from '@material-ui/core/Button'; +import { withRouter } from "react-router"; function Copyright() { return ( @@ -26,7 +28,11 @@ const useStyles = makeStyles((theme) => ({ } })); -export default function Layout() { +const handleClick = (props) => { + props.history.push("/"); + } + + function Layout(props) { const classes = useStyles(); return ( @@ -34,7 +40,9 @@ export default function Layout() { - SQ + @@ -47,3 +55,5 @@ export default function Layout() { ); } + +export default withRouter(Layout); \ No newline at end of file diff --git a/simplq/src/components/Routes.jsx b/simplq/src/components/Routes.jsx index 54e2ec1f..143052a9 100644 --- a/simplq/src/components/Routes.jsx +++ b/simplq/src/components/Routes.jsx @@ -1,6 +1,5 @@ import React from "react"; import { - BrowserRouter as Router, Route } from "react-router-dom"; import CreateQueue from "./page/CreateQueue" @@ -9,10 +8,10 @@ import QueueStatus from "./page/QueueStatus"; import Admin from "./page/admin/index"; export default () => { - return + return <> - + } diff --git a/simplq/src/index.js b/simplq/src/index.js index ec0c66f3..0bd0219c 100644 --- a/simplq/src/index.js +++ b/simplq/src/index.js @@ -4,12 +4,13 @@ import './index.css'; import Layout from './components/Layout'; import * as serviceWorker from './serviceWorker'; import Routes from './components/Routes'; +import { + BrowserRouter as Router +} from "react-router-dom"; ReactDOM.render( - - - + , document.getElementById('root') );