minor changes
This commit is contained in:
parent
528cb80c1f
commit
532b5d3876
@ -4,6 +4,7 @@ import SignIn from './SignIn';
|
||||
import SignUp from './SignUp';
|
||||
import Admin from './Admin';
|
||||
import Home from './Home';
|
||||
import ChatWindow from './ChatWindow';
|
||||
function App() {
|
||||
return (
|
||||
<div className="App">
|
||||
@ -12,6 +13,7 @@ function App() {
|
||||
<Route path="sign-in" element={<SignIn />} />
|
||||
<Route path="sign-up" element={<SignUp />} />
|
||||
<Route path="admin" element={<Admin />} />
|
||||
<Route path="chat-window" element={<ChatWindow />} />
|
||||
</Routes>
|
||||
</div>
|
||||
);
|
||||
|
@ -108,7 +108,7 @@ export default function Navbar() {
|
||||
|
||||
<Box sx={{ flexGrow: 0, marginRight: '1%' }}>
|
||||
<Tooltip title="Chats">
|
||||
<IconButton sx={{ p: 0 }}>
|
||||
<IconButton onClick={() => { navigate('/chat-window') }} sx={{ p: 0 }}>
|
||||
<ForumIcon sx={{ color: 'white' }}></ForumIcon>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
@ -16,8 +16,10 @@ export default function SignIn() {
|
||||
event.preventDefault();
|
||||
const data = new FormData(event.currentTarget);
|
||||
// eslint-disable-next-line no-console
|
||||
if(data.get('username') == "admin" && data.get('password') == "admin"){
|
||||
navigate('/');
|
||||
if (data.get('username') === "admin" && data.get('password') === "admin") {
|
||||
navigate('/admin');
|
||||
} else if (data.get('username') === "user" && data.get('password') === "user") {
|
||||
navigate('/chat-window')
|
||||
}
|
||||
};
|
||||
return (
|
||||
@ -72,4 +74,5 @@ export default function SignIn() {
|
||||
</Box>
|
||||
</Box>
|
||||
</Container>
|
||||
)}
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue
Block a user