Skip to content

Commit

Permalink
Merge pull request #2608 from glific/style/login
Browse files Browse the repository at this point in the history
Added last login fix for gupshup enterprise
  • Loading branch information
kurund authored Nov 1, 2023
2 parents d6a74ab + 8b1cd3c commit 0472af7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
margin: 0 6px;
}
.BottomMenusWithoutWallet {
bottom: 10px;
bottom: 15px;
}
.BottomMenusVertical {
flex-flow: column;
Expand Down
7 changes: 6 additions & 1 deletion src/containers/LastLogin/LastLogin.module.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
.lastLogin {
.LastLogin {
position: absolute;
bottom: 26px;
font-size: 12px;
padding-left: 22px;
color: #073f24;
font-weight: 500;
}

.LastLoginEnterprise {
composes: LastLogin;
bottom: 2px;
}
9 changes: 7 additions & 2 deletions src/containers/LastLogin/LastLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ? (
<div className={styles.lastLogin}>
<div className={lastLoginStyle}>
{t('Last login')}: {moment(lastLogin).format(DATE_TIME_FORMAT)}
</div>
) : null;
Expand Down

0 comments on commit 0472af7

Please sign in to comment.