feat: logout button
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
import Button from "@/components/ui/Button";
|
||||
import { useAppContext } from "@/providers/AuthProvider";
|
||||
import { FunctionComponent } from "preact";
|
||||
import { useLocation } from "preact-iso";
|
||||
import classes from "./profile_settings.module.scss";
|
||||
|
||||
const ProfifleSettings: FunctionComponent = () => {
|
||||
const ProfileSettings: FunctionComponent = () => {
|
||||
const { isLoggedIn } = useAppContext();
|
||||
const { route } = useLocation();
|
||||
return (
|
||||
<div class={classes.container}>
|
||||
<div class={classes.header_block}>
|
||||
@@ -17,11 +21,19 @@ const ProfifleSettings: FunctionComponent = () => {
|
||||
<div class="flex w-[300px] flex-col gap-10">
|
||||
<Button>Сменить тему</Button>
|
||||
<Button>Настройки</Button>
|
||||
<Button color="secondary">Выйти</Button>
|
||||
<Button
|
||||
color="secondary"
|
||||
onClick={() => {
|
||||
isLoggedIn.value = false;
|
||||
route("/login", true);
|
||||
}}
|
||||
>
|
||||
Выйти
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ProfifleSettings;
|
||||
export default ProfileSettings;
|
||||
|
||||
Reference in New Issue
Block a user