Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added last login fix for gupshup enterprise #2608

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading