feat: implement login

This commit is contained in:
caturbgs
2021-12-09 23:00:56 +07:00
parent b20835257e
commit 62dfdbe40a
8 changed files with 124 additions and 152 deletions

View File

@@ -1,7 +1,7 @@
import React, {useState} from "react";
import {Button, Drawer, Layout, Menu, Popover, Typography,} from "antd";
import {MenuList} from "./MenuList";
import {Link} from "react-router-dom";
import {Link, useHistory} from "react-router-dom";
import {CalendarOutlined, HomeOutlined, MenuOutlined, UserOutlined,} from "@ant-design/icons";
import {AppRoute} from "../../routes/app";
import {useStore} from "../../utils/useStore";
@@ -12,6 +12,7 @@ const {Text, Paragraph} = Typography;
const {Header, Content, Sider} = Layout;
export const DesktopLayout = observer(() => {
let history = useHistory();
const xl = useMediaQuery({minWidth: 1024});
const store = useStore();
const [clicked, setClicked] = useState(false);
@@ -268,8 +269,8 @@ export const DesktopLayout = observer(() => {
</Menu.Item>
<Menu.Item
onClick={() => {
// store.authentication.logout();
// return history.push("/login");
store.authentication.logout();
history.push("/login");
}}
>
<span>Sign out</span>
@@ -278,10 +279,10 @@ export const DesktopLayout = observer(() => {
}
title={
<Text>
{/*{store.user.data.email}{" "}*/}
{/*<Paragraph style={{fontWeight: 400}} type={"secondary-dark"}>*/}
{/* {store.authentication.userData.full_name}*/}
{/*</Paragraph>*/}
{store.user.data.email}{" "}
<Paragraph style={{fontWeight: 400}} type={"secondary-dark"}>
{store.authentication.userData.email}
</Paragraph>
</Text>
}
trigger="click"
@@ -359,8 +360,8 @@ export const DesktopLayout = observer(() => {
</Menu.Item>
<Menu.Item
onClick={() => {
// store.authentication.logout();
// return history.push("/login");
store.authentication.logout();
history.push("/login");
}}
>
<span>Sign out</span>