mirror of
https://github.com/lemeow125/Ivy-Frontend.git
synced 2025-06-29 17:05:44 +08:00
Readded directories with uppercase
This commit is contained in:
parent
d54e6be430
commit
101a8e8ae6
21 changed files with 737 additions and 0 deletions
38
src/Components/Logout/Logout.tsx
Normal file
38
src/Components/Logout/Logout.tsx
Normal file
|
@ -0,0 +1,38 @@
|
|||
import React from "react";
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
import { toggle } from "../../Features/Login/LoginSlice";
|
||||
import { Button } from "@mui/material";
|
||||
import styles from "../../styles";
|
||||
|
||||
export interface state {
|
||||
logged_in: {
|
||||
value: boolean;
|
||||
};
|
||||
}
|
||||
export interface props {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export default function Logout(props: props) {
|
||||
const logged_in = useSelector((state: state) => state.logged_in.value);
|
||||
const dispatch = useDispatch();
|
||||
|
||||
async function login() {
|
||||
await dispatch(toggle());
|
||||
await console.log("test " + logged_in);
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{ paddingTop: "40vh" }}>
|
||||
<Button
|
||||
onClick={login}
|
||||
value="Log out"
|
||||
variant="contained"
|
||||
style={styles.logout_button}
|
||||
>
|
||||
{props.children}
|
||||
<p style={styles.text}>Log Out</p>
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue