feat: implement login
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user