From 375d5a37d26f4f14a33cd14fc9bca912c5210a80 Mon Sep 17 00:00:00 2001 From: TTPL-RT-52 Date: Fri, 31 May 2024 19:15:39 +0530 Subject: [PATCH 1/2] Issue #PS-652 fix:Login button position should be dynamic --- src/assets/images/account.svg | 3 + src/assets/images/menuIcon.svg | 3 + src/components/Header.tsx | 28 ++- src/pages/dashboard.tsx | 2 + src/pages/login.tsx | 325 +++++++++++++++++---------------- 5 files changed, 191 insertions(+), 170 deletions(-) create mode 100644 src/assets/images/account.svg create mode 100644 src/assets/images/menuIcon.svg diff --git a/src/assets/images/account.svg b/src/assets/images/account.svg new file mode 100644 index 00000000..cf0c8cbc --- /dev/null +++ b/src/assets/images/account.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/images/menuIcon.svg b/src/assets/images/menuIcon.svg new file mode 100644 index 00000000..46ac3798 --- /dev/null +++ b/src/assets/images/menuIcon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 1757dbb7..56304d1b 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -13,8 +13,10 @@ import LogoutOutlinedIcon from '@mui/icons-material/LogoutOutlined'; import MenuIcon from '@mui/icons-material/Menu'; import MenuItem from '@mui/material/MenuItem'; import PersonOutlineOutlinedIcon from '@mui/icons-material/PersonOutlineOutlined'; +import accountIcon from './../assets/images/account.svg'; import dynamic from 'next/dynamic'; import logoLight from '../../public/images/logo-light.png'; +import menuIcon from '../assets/images/menuIcon.svg'; import { useTheme } from '@mui/material/styles'; import { useTranslation } from 'next-i18next'; @@ -120,11 +122,11 @@ const Header: React.FC = () => { > { sx={{ cursor: 'pointer' }} paddingLeft={'1rem'} > - @@ -162,11 +165,18 @@ const Header: React.FC = () => { flexDirection={'column'} mt={'0.5rem'} > - + {/* + /> */}
= () => { /> */} + )} diff --git a/src/pages/login.tsx b/src/pages/login.tsx index 261a23b7..7cd34e9d 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -42,6 +42,7 @@ const LoginPage = () => { const [loading, setLoading] = useState(false); const [selectedLanguage, setSelectedLanguage] = useState('en'); const [language, setLanguage] = useState(selectedLanguage); + const [scrolling, setScrolling] = useState(false); const theme = useTheme(); const router = useRouter(); @@ -158,13 +159,14 @@ const LoginPage = () => { useEffect(() => { const handlePasswordFocus = () => { if (loginButtonRef.current) { - loginButtonRef.current.scrollIntoView({ - behavior: 'smooth', - block: 'center', - }); + setTimeout(() => { + loginButtonRef.current?.scrollIntoView({ + behavior: 'smooth', + block: 'center', + }); + }, 200); // Delay of 200 milliseconds } }; - const passwordField = passwordRef.current; if (passwordField) { passwordField.addEventListener('focus', handlePasswordFocus); @@ -175,180 +177,181 @@ const LoginPage = () => { }, []); return ( -
- - {loading && ( - - )} + + - App Logo{' '} + {loading && ( + + )} + + App Logo{' '} + - - - - - - - - + + + + + - - - - - {showPassword ? : } - - - ), + > + + + - - - - - {t('LOGIN_PAGE.FORGOT_PASSWORD')} - - - - setRememberMe(e.target.checked)} /> - {t('LOGIN_PAGE.REMEMBER_ME')} - - - + + - - {showToastMessage && ( - - - - } - /> - )} - + {showToastMessage && ( + + + + } + /> + )} + + ); }; From 35c98217ea5603de3a66a3058b2b95093707d825 Mon Sep 17 00:00:00 2001 From: TTPL-RT-52 Date: Fri, 31 May 2024 19:19:00 +0530 Subject: [PATCH 2/2] Issue #PS-652 fix:Login button position should be dynamic --- src/pages/dashboard.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/dashboard.tsx b/src/pages/dashboard.tsx index cf35fd30..8a1b0cce 100644 --- a/src/pages/dashboard.tsx +++ b/src/pages/dashboard.tsx @@ -35,7 +35,6 @@ import { isAfter, startOfDay } from 'date-fns'; import ArrowForwardSharpIcon from '@mui/icons-material/ArrowForwardSharp'; import CalendarMonthIcon from '@mui/icons-material/CalendarMonth'; -import CustomRangeModal from '@/components/CustomRangeModal'; import Divider from '@mui/material/Divider'; import Header from '../components/Header'; import Link from 'next/link'; @@ -742,7 +741,6 @@ const Dashboard: React.FC = () => { /> */} - )}