import React, { useState } from 'react'; import 'rsuite/lib/styles/index.less'; import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'; import { AuthContext } from './helpers/authContext'; import PrivateRoute from './components/Routes/PrivateRoute'; import Home from './screens/Home'; import Dashboard from './screens/Dashboard'; import Schedule from './screens/Schedule/Schedule'; import Availability from './screens/Availability/Availability'; import Invite from './screens/Invite/Invite'; import Login from './screens/Login'; import Register from './screens/Register'; const existingToken = localStorage.getItem('token'); // const existingUser = JSON.parse(localStorage.getItem('user')); export default function App() { const [authToken, setAuthToken] = useState(existingToken || ''); const setToken = (data) => { localStorage.setItem('token', JSON.stringify(data)); setAuthToken(data); }; return ( ); }