From bf08ffcaaf258cee1a565bd096c9ea50f2656268 Mon Sep 17 00:00:00 2001 From: mdshamoon Date: Tue, 31 Oct 2023 14:30:53 +0530 Subject: [PATCH] added last login fix for gupshup enterprise --- .../Layout/Navigation/SideDrawer/SideDrawer.module.css | 2 +- src/containers/LastLogin/LastLogin.module.css | 7 ++++++- src/containers/LastLogin/LastLogin.tsx | 9 +++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/UI/Layout/Navigation/SideDrawer/SideDrawer.module.css b/src/components/UI/Layout/Navigation/SideDrawer/SideDrawer.module.css index 6ca4f6332..12ca32823 100644 --- a/src/components/UI/Layout/Navigation/SideDrawer/SideDrawer.module.css +++ b/src/components/UI/Layout/Navigation/SideDrawer/SideDrawer.module.css @@ -87,7 +87,7 @@ margin: 0 6px; } .BottomMenusWithoutWallet { - bottom: 10px; + bottom: 15px; } .BottomMenusVertical { flex-flow: column; diff --git a/src/containers/LastLogin/LastLogin.module.css b/src/containers/LastLogin/LastLogin.module.css index cb8d5c168..5baeb041d 100644 --- a/src/containers/LastLogin/LastLogin.module.css +++ b/src/containers/LastLogin/LastLogin.module.css @@ -1,4 +1,4 @@ -.lastLogin { +.LastLogin { position: absolute; bottom: 26px; font-size: 12px; @@ -6,3 +6,8 @@ color: #073f24; font-weight: 500; } + +.LastLoginEnterprise { + composes: LastLogin; + bottom: 2px; +} diff --git a/src/containers/LastLogin/LastLogin.tsx b/src/containers/LastLogin/LastLogin.tsx index 0a96bac95..cbf5eef34 100644 --- a/src/containers/LastLogin/LastLogin.tsx +++ b/src/containers/LastLogin/LastLogin.tsx @@ -2,9 +2,11 @@ import moment from 'moment'; import { useTranslation } from 'react-i18next'; import { getAuthSession } from 'services/AuthService'; -import { DATE_TIME_FORMAT } from 'common/constants'; +import { DATE_TIME_FORMAT, GUPSHUP_ENTERPRISE_SHORTCODE } from 'common/constants'; import styles from './LastLogin.module.css'; +import { useContext } from 'react'; +import { ProviderContext } from 'context/session'; interface LastLoginProps { drawerOpen: boolean; @@ -13,8 +15,11 @@ interface LastLoginProps { export const LastLogin = ({ drawerOpen }: LastLoginProps) => { const { t } = useTranslation(); const lastLogin = getAuthSession('last_login_time'); + const { provider } = useContext(ProviderContext); + const lastLoginStyle = + provider === GUPSHUP_ENTERPRISE_SHORTCODE ? styles.LastLoginEnterprise : styles.LastLogin; return drawerOpen ? ( -
+
{t('Last login')}: {moment(lastLogin).format(DATE_TIME_FORMAT)}
) : null;