From f52e7a667c6ad383b58a958469c4f30f604b80b4 Mon Sep 17 00:00:00 2001 From: canove Date: Thu, 3 Sep 2020 18:59:10 -0300 Subject: [PATCH] feat: started settings style --- frontend/src/pages/Settings/index.js | 73 ++++++++++++++++++++++++++++ frontend/src/routes/index.js | 2 + 2 files changed, 75 insertions(+) diff --git a/frontend/src/pages/Settings/index.js b/frontend/src/pages/Settings/index.js index e69de29..c4b1d32 100644 --- a/frontend/src/pages/Settings/index.js +++ b/frontend/src/pages/Settings/index.js @@ -0,0 +1,73 @@ +import React, { useState, useEffect } from "react"; +import { useHistory } from "react-router-dom"; +import api from "../../services/api"; +import openSocket from "socket.io-client"; + +import { makeStyles } from "@material-ui/core/styles"; + +import Paper from "@material-ui/core/Paper"; + +import Switch from "@material-ui/core/Switch"; +import Typography from "@material-ui/core/Typography"; +import Container from "@material-ui/core/Container"; + +const useStyles = makeStyles(theme => ({ + root: { + display: "flex", + alignItems: "center", + padding: theme.spacing(4), + }, + + paper: { + padding: theme.spacing(2), + display: "flex", + alignItems: "center", + }, + + switch: { + marginLeft: "auto", + }, +})); + +const WhatsAuth = () => { + const classes = useStyles(); + // const history = useHistory(); + + const [settings, setSettings] = useState([]); + + // useEffect(() => { + // const fetchSession = async () => { + // try { + // const { data } = await api.get("/whatsapp/session/1"); + // setQrCode(data.qrcode); + // setSession(data); + // } catch (err) { + // console.log(err); + // } + // }; + // fetchSession(); + // }, []); + + return ( +
+ + + Settings + + + Enable user creation + setShowAllTickets(prevState => !prevState)} + name="showAllTickets" + color="primary" + /> + + +
+ ); +}; + +export default WhatsAuth; diff --git a/frontend/src/routes/index.js b/frontend/src/routes/index.js index 3932021..b48a030 100644 --- a/frontend/src/routes/index.js +++ b/frontend/src/routes/index.js @@ -8,6 +8,7 @@ import Tickets from "../pages/Tickets/"; import Signup from "../pages/Signup/"; import Login from "../pages/Login/"; import Connection from "../pages/Connection/"; +import Settings from "../pages/Settings/"; import Users from "../pages/Users"; import Contacts from "../pages/Contacts/"; import { AuthProvider } from "../context/Auth/AuthContext"; @@ -31,6 +32,7 @@ const Routes = () => { +