From 2feb659eca05179dab1926c031e7d98e1def3b4d Mon Sep 17 00:00:00 2001 From: mdshamoon Date: Wed, 11 Oct 2023 08:43:37 +0530 Subject: [PATCH] removed last login on closed drawer --- .../UI/Layout/Navigation/SideDrawer/SideDrawer.tsx | 2 +- src/containers/LastLogin/LastLogin.module.css | 2 +- src/containers/LastLogin/LastLogin.tsx | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/UI/Layout/Navigation/SideDrawer/SideDrawer.tsx b/src/components/UI/Layout/Navigation/SideDrawer/SideDrawer.tsx index 875e60e58..5300dc44f 100644 --- a/src/components/UI/Layout/Navigation/SideDrawer/SideDrawer.tsx +++ b/src/components/UI/Layout/Navigation/SideDrawer/SideDrawer.tsx @@ -184,7 +184,7 @@ export const SideDrawer = () => { {drawer} - + diff --git a/src/containers/LastLogin/LastLogin.module.css b/src/containers/LastLogin/LastLogin.module.css index a771c8f9d..cb8d5c168 100644 --- a/src/containers/LastLogin/LastLogin.module.css +++ b/src/containers/LastLogin/LastLogin.module.css @@ -2,7 +2,7 @@ position: absolute; bottom: 26px; font-size: 12px; - padding-left: 10px; + padding-left: 22px; color: #073f24; font-weight: 500; } diff --git a/src/containers/LastLogin/LastLogin.tsx b/src/containers/LastLogin/LastLogin.tsx index 8ed011ca3..0a96bac95 100644 --- a/src/containers/LastLogin/LastLogin.tsx +++ b/src/containers/LastLogin/LastLogin.tsx @@ -6,12 +6,16 @@ import { DATE_TIME_FORMAT } from 'common/constants'; import styles from './LastLogin.module.css'; -export const LastLogin = () => { +interface LastLoginProps { + drawerOpen: boolean; +} + +export const LastLogin = ({ drawerOpen }: LastLoginProps) => { const { t } = useTranslation(); const lastLogin = getAuthSession('last_login_time'); - return ( + return drawerOpen ? (
{t('Last login')}: {moment(lastLogin).format(DATE_TIME_FORMAT)}
- ); + ) : null; };