+ Logout button for dashboard
This commit is contained in:
parent
8e512291b9
commit
9d536f9ada
|
@ -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 />
|
||||
) : (
|
||||
|
|
|
@ -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;
|
Loading…
Reference in New Issue