minor changes

This commit is contained in:
Sahni-Arjun 2022-03-06 21:13:11 -05:00
parent 528cb80c1f
commit 532b5d3876
3 changed files with 59 additions and 54 deletions

View File

@ -4,6 +4,7 @@ import SignIn from './SignIn';
import SignUp from './SignUp'; import SignUp from './SignUp';
import Admin from './Admin'; import Admin from './Admin';
import Home from './Home'; import Home from './Home';
import ChatWindow from './ChatWindow';
function App() { function App() {
return ( return (
<div className="App"> <div className="App">
@ -12,6 +13,7 @@ function App() {
<Route path="sign-in" element={<SignIn />} /> <Route path="sign-in" element={<SignIn />} />
<Route path="sign-up" element={<SignUp />} /> <Route path="sign-up" element={<SignUp />} />
<Route path="admin" element={<Admin />} /> <Route path="admin" element={<Admin />} />
<Route path="chat-window" element={<ChatWindow />} />
</Routes> </Routes>
</div> </div>
); );

View File

@ -108,7 +108,7 @@ export default function Navbar() {
<Box sx={{ flexGrow: 0, marginRight: '1%' }}> <Box sx={{ flexGrow: 0, marginRight: '1%' }}>
<Tooltip title="Chats"> <Tooltip title="Chats">
<IconButton sx={{ p: 0 }}> <IconButton onClick={() => { navigate('/chat-window') }} sx={{ p: 0 }}>
<ForumIcon sx={{ color: 'white' }}></ForumIcon> <ForumIcon sx={{ color: 'white' }}></ForumIcon>
</IconButton> </IconButton>
</Tooltip> </Tooltip>

View File

@ -16,8 +16,10 @@ export default function SignIn() {
event.preventDefault(); event.preventDefault();
const data = new FormData(event.currentTarget); const data = new FormData(event.currentTarget);
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
if(data.get('username') == "admin" && data.get('password') == "admin"){ if (data.get('username') === "admin" && data.get('password') === "admin") {
navigate('/'); navigate('/admin');
} else if (data.get('username') === "user" && data.get('password') === "user") {
navigate('/chat-window')
} }
}; };
return ( return (
@ -72,4 +74,5 @@ export default function SignIn() {
</Box> </Box>
</Box> </Box>
</Container> </Container>
)} )
}