+ Logout button for dashboard

This commit is contained in:
Pogodaanton 2020-06-25 20:34:17 +02:00
parent 8e512291b9
commit 9d536f9ada
2 changed files with 21 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import { ListDataItem, DashboardListProps } from "../DashboardList/DashboardList
import { FullscreenLoader } from "../Loader";
import { LoadableComponent } from "@loadable/component";
import { DashboardEmptyProps } from "./views/DashboardEmpty.props";
import DashboardHeaderRight from "./views/DashboardHeaderRight";
const DashboardList: LoadableComponent<DashboardListProps> = FullscreenLoader(
import("../DashboardList/DashboardList")
@ -72,7 +73,7 @@ const Dashboard: React.FC<DashboardProps> = props => {
return (
<div className={isFrozen ? props.managedClasses.dashboard__frozen : ""}>
<Header position="fixed" />
<Header position="fixed" rightSideContent={<DashboardHeaderRight />} />
{listData === null ? null : listData.length === 0 ? (
<DashboardEmpty />
) : (

View File

@ -0,0 +1,19 @@
import React from "react";
import { Button, ButtonAppearance } from "../../_DesignSystem";
import { FaSignOutAlt } from "react-icons/fa";
const signOut = () => {
window.location.assign(window.location.href + "api/logout.php");
};
const DashboardHeaderRight: React.ComponentType<{}> = props => {
return (
<Button
appearance={ButtonAppearance.lightweight}
icon={FaSignOutAlt}
onClick={signOut}
/>
);
};
export default DashboardHeaderRight;