-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
86 additions
and
29 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,33 @@ | ||
.lastLogin { | ||
position: absolute; | ||
bottom: 4px; | ||
font-size: 12px; | ||
padding-left: 12px; | ||
.LastLogin { | ||
font-size: 9px; | ||
|
||
color: #073f24; | ||
font-weight: 500; | ||
} | ||
|
||
.UserAccount { | ||
width: 100%; | ||
cursor: pointer; | ||
background-color: white; | ||
position: absolute; | ||
bottom: 0px; | ||
} | ||
|
||
.UserAccount:hover { | ||
background-color: #f0f7f1; | ||
} | ||
|
||
.User { | ||
padding: 12px; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.User svg { | ||
margin-right: 8px; | ||
} | ||
|
||
.User p { | ||
width: 130px; | ||
overflow: auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,39 @@ | ||
import moment from 'moment'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { getAuthSession } from 'services/AuthService'; | ||
import UserIcon from 'assets/images/icons/UserIcon.svg?react'; | ||
import { getAuthSession, getUserSession } from 'services/AuthService'; | ||
import { DATE_TIME_FORMAT } from 'common/constants'; | ||
|
||
import styles from './LastLogin.module.css'; | ||
import { Divider, Typography } from '@mui/material'; | ||
import { useNavigate } from 'react-router'; | ||
|
||
interface LastLoginProps { | ||
drawerOpen: boolean; | ||
} | ||
|
||
export const LastLogin = ({ drawerOpen }: LastLoginProps) => { | ||
const navigate = useNavigate(); | ||
const { t } = useTranslation(); | ||
const userName = getUserSession('name'); | ||
const lastLogin = getAuthSession('last_login_time'); | ||
return drawerOpen ? ( | ||
<div className={styles.lastLogin}> | ||
{t('Last login')}: {moment(lastLogin).format(DATE_TIME_FORMAT)} | ||
<div | ||
className={styles.UserAccount} | ||
onClick={() => | ||
navigate('/user-profile', { state: { subMenu: { active: true, value: '/user-profile' } } }) | ||
} | ||
> | ||
<Divider /> | ||
<div className={styles.User}> | ||
<UserIcon /> | ||
<div> | ||
<Typography variant="body2"> {userName}</Typography> | ||
<div className={styles.LastLogin}> | ||
{t('Last login')}: {moment(lastLogin).format(DATE_TIME_FORMAT)} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
) : null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters