From 9f283ae42e7fbe2123a305a6a018a2e953fcd793 Mon Sep 17 00:00:00 2001 From: mdshamoon Date: Wed, 25 Oct 2023 23:12:28 +0530 Subject: [PATCH] fixed some issues --- src/assets/images/icons/BrownDropdown.svg | 21 +++-------- src/assets/images/icons/Delete/Red.svg | 10 +++++- src/assets/images/icons/UserIcon.svg | 6 ++++ .../WhatsAppEditor/WhatsAppEditor.module.css | 1 + .../Layout/Navigation/SideMenus/SideMenus.tsx | 5 +++ src/config/menu.ts | 1 + .../Chat/ChatInterface/ChatInterface.tsx | 4 +-- .../ChatMessages/ContactBar/ContactBar.tsx | 3 +- src/containers/LastLogin/LastLogin.module.css | 35 ++++++++++++++++--- src/containers/LastLogin/LastLogin.tsx | 26 +++++++++++--- src/services/AuthService.tsx | 3 ++ 11 files changed, 86 insertions(+), 29 deletions(-) create mode 100644 src/assets/images/icons/UserIcon.svg diff --git a/src/assets/images/icons/BrownDropdown.svg b/src/assets/images/icons/BrownDropdown.svg index be844f6b1..994ea857e 100644 --- a/src/assets/images/icons/BrownDropdown.svg +++ b/src/assets/images/icons/BrownDropdown.svg @@ -1,16 +1,5 @@ - - - Actions - - - - - - - - - \ No newline at end of file + + + diff --git a/src/assets/images/icons/Delete/Red.svg b/src/assets/images/icons/Delete/Red.svg index de816ec12..6bf41652f 100644 --- a/src/assets/images/icons/Delete/Red.svg +++ b/src/assets/images/icons/Delete/Red.svg @@ -1 +1,9 @@ - Icon/Delete/Red \ No newline at end of file + + + + + + diff --git a/src/assets/images/icons/UserIcon.svg b/src/assets/images/icons/UserIcon.svg new file mode 100644 index 000000000..dc6df6fd9 --- /dev/null +++ b/src/assets/images/icons/UserIcon.svg @@ -0,0 +1,6 @@ + + + + diff --git a/src/components/UI/Form/WhatsAppEditor/WhatsAppEditor.module.css b/src/components/UI/Form/WhatsAppEditor/WhatsAppEditor.module.css index fb31a3263..a74002832 100644 --- a/src/components/UI/Form/WhatsAppEditor/WhatsAppEditor.module.css +++ b/src/components/UI/Form/WhatsAppEditor/WhatsAppEditor.module.css @@ -2,6 +2,7 @@ overflow: auto; width: 100%; min-height: 40px; + margin-top: 4px; } .Editor :global(.public-DraftEditor-content) > div { diff --git a/src/components/UI/Layout/Navigation/SideMenus/SideMenus.tsx b/src/components/UI/Layout/Navigation/SideMenus/SideMenus.tsx index e6b48b35e..715f85601 100644 --- a/src/components/UI/Layout/Navigation/SideMenus/SideMenus.tsx +++ b/src/components/UI/Layout/Navigation/SideMenus/SideMenus.tsx @@ -38,6 +38,11 @@ const SideMenus = ({ opened }: SideMenusProps) => { getNotificationCount(); }, []); + useEffect(() => { + if (location.state && location.state.subMenu) { + setSubMenu(location.state.subMenu); + } + }, [location]); // let's get count specific to menu paths // we should check for menu path if we have badges for other items. // For now we have only one badge for notifications so returning that only diff --git a/src/config/menu.ts b/src/config/menu.ts index e2c715b2d..07d4ddad6 100644 --- a/src/config/menu.ts +++ b/src/config/menu.ts @@ -181,6 +181,7 @@ const menus = (): Menu[] => [ title: 'Account', path: '/user-profile', icon: 'profile', + show: true, type: 'sideDrawer', roles: ['Manager', 'Admin', 'Dynamic'], subMenu: [ diff --git a/src/containers/Chat/ChatInterface/ChatInterface.tsx b/src/containers/Chat/ChatInterface/ChatInterface.tsx index 96fb0d523..a25f57662 100644 --- a/src/containers/Chat/ChatInterface/ChatInterface.tsx +++ b/src/containers/Chat/ChatInterface/ChatInterface.tsx @@ -20,7 +20,7 @@ import HelpIcon from 'components/UI/HelpIcon/HelpIcon'; const tabs = [ { - label: 'Chat', + label: 'Contacts', link: '/chat/', }, { @@ -127,7 +127,7 @@ export const ChatInterface = ({ savedSearches, collectionType }: ChatInterfacePr 0 ? simulatorId : selectedContactId} /> ); - heading = 'Chat'; + heading = 'Contacts'; } else if (savedSearches) { listingContent = ; heading = 'Saved searches'; diff --git a/src/containers/Chat/ChatMessages/ContactBar/ContactBar.tsx b/src/containers/Chat/ChatMessages/ContactBar/ContactBar.tsx index f9afa68c7..3f34e9370 100644 --- a/src/containers/Chat/ChatMessages/ContactBar/ContactBar.tsx +++ b/src/containers/Chat/ChatMessages/ContactBar/ContactBar.tsx @@ -508,8 +508,9 @@ export const ContactBar = ({ {({ TransitionProps }) => ( diff --git a/src/containers/LastLogin/LastLogin.module.css b/src/containers/LastLogin/LastLogin.module.css index fbdb4c516..e030e0b02 100644 --- a/src/containers/LastLogin/LastLogin.module.css +++ b/src/containers/LastLogin/LastLogin.module.css @@ -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; +} diff --git a/src/containers/LastLogin/LastLogin.tsx b/src/containers/LastLogin/LastLogin.tsx index 0a96bac95..ff438be22 100644 --- a/src/containers/LastLogin/LastLogin.tsx +++ b/src/containers/LastLogin/LastLogin.tsx @@ -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 ? ( -
- {t('Last login')}: {moment(lastLogin).format(DATE_TIME_FORMAT)} +
+ navigate('/user-profile', { state: { subMenu: { active: true, value: '/user-profile' } } }) + } + > + +
+ +
+ {userName} +
+ {t('Last login')}: {moment(lastLogin).format(DATE_TIME_FORMAT)} +
+
+
) : null; }; diff --git a/src/services/AuthService.tsx b/src/services/AuthService.tsx index cc9e6ad86..af70e3095 100644 --- a/src/services/AuthService.tsx +++ b/src/services/AuthService.tsx @@ -162,6 +162,9 @@ export const getUserSession = (element?: string) => { case 'language': returnValue = JSON.parse(user).language.locale; break; + case 'name': + returnValue = JSON.parse(user).name; + break; default: returnValue = JSON.parse(user); }