From e0b3ca7446cd1159a80a00585e4bc41e36e7a613 Mon Sep 17 00:00:00 2001 From: prathmesh703 <146568950+prathmesh703@users.noreply.github.com> Date: Tue, 21 Jan 2025 22:40:06 +0530 Subject: [PATCH] Fixes: The Login and Organization Screens (#3309) * login and landing ui * ui * ui2 * fixed failing test * re review * global css * testcases fix * color variables * failing test --- .../LeftDrawer/functions/default.md | 2 +- .../interfaces/InterfaceLeftDrawerProps.md | 6 +- .../SuperAdminScreen/functions/default.md | 2 +- .../UserSidebar/functions/default.md | 2 +- .../interfaces/InterfaceUserSidebarProps.md | 6 +- .../Organizations/functions/default.md | 2 +- public/images/svg/angleRight.svg | 7 + src/assets/css/app.css | 8 +- src/components/LeftDrawer/LeftDrawer.spec.tsx | 22 +- src/components/LeftDrawer/LeftDrawer.tsx | 167 ++-- .../LoginPortalToggle.module.css | 34 - .../LoginPortalToggle/LoginPortalToggle.tsx | 2 +- .../OrgListCard/OrgListCard.module.css | 148 --- src/components/OrgListCard/OrgListCard.tsx | 10 +- .../ProfileDropdown.module.css | 75 -- .../ProfileDropdown/ProfileDropdown.tsx | 13 +- .../SuperAdminScreen.module.css | 101 --- .../SuperAdminScreen/SuperAdminScreen.tsx | 4 +- .../OrganizationCard.module.css | 149 --- .../OrganizationCard/OrganizationCard.tsx | 11 +- .../UserSidebar/UserSidebar.module.css | 239 ----- .../UserSidebar/UserSidebar.spec.tsx | 6 +- .../UserPortal/UserSidebar/UserSidebar.tsx | 114 ++- src/screens/ForgotPassword/ForgotPassword.tsx | 10 +- src/screens/LoginPage/LoginPage.tsx | 10 +- src/screens/OrgList/OrgList.tsx | 1 + .../Organizations/Organizations.module.css | 145 --- .../Organizations/Organizations.tsx | 69 +- src/style/app.module.css | 853 ++++++++++++++++-- 29 files changed, 1053 insertions(+), 1165 deletions(-) create mode 100644 public/images/svg/angleRight.svg delete mode 100644 src/components/LoginPortalToggle/LoginPortalToggle.module.css delete mode 100644 src/components/OrgListCard/OrgListCard.module.css delete mode 100644 src/components/ProfileDropdown/ProfileDropdown.module.css delete mode 100644 src/components/SuperAdminScreen/SuperAdminScreen.module.css delete mode 100644 src/components/UserPortal/OrganizationCard/OrganizationCard.module.css delete mode 100644 src/components/UserPortal/UserSidebar/UserSidebar.module.css delete mode 100644 src/screens/UserPortal/Organizations/Organizations.module.css diff --git a/docs/docs/auto-docs/components/LeftDrawer/LeftDrawer/functions/default.md b/docs/docs/auto-docs/components/LeftDrawer/LeftDrawer/functions/default.md index 5a74576457..b6052d20d0 100644 --- a/docs/docs/auto-docs/components/LeftDrawer/LeftDrawer/functions/default.md +++ b/docs/docs/auto-docs/components/LeftDrawer/LeftDrawer/functions/default.md @@ -6,7 +6,7 @@ > **default**(`__namedParameters`): `Element` -Defined in: [src/components/LeftDrawer/LeftDrawer.tsx:24](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/LeftDrawer/LeftDrawer.tsx#L24) +Defined in: [src/components/LeftDrawer/LeftDrawer.tsx:25](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/LeftDrawer/LeftDrawer.tsx#L25) LeftDrawer component for displaying navigation options. diff --git a/docs/docs/auto-docs/components/LeftDrawer/LeftDrawer/interfaces/InterfaceLeftDrawerProps.md b/docs/docs/auto-docs/components/LeftDrawer/LeftDrawer/interfaces/InterfaceLeftDrawerProps.md index a1be16ca7c..270d7a5c1c 100644 --- a/docs/docs/auto-docs/components/LeftDrawer/LeftDrawer/interfaces/InterfaceLeftDrawerProps.md +++ b/docs/docs/auto-docs/components/LeftDrawer/LeftDrawer/interfaces/InterfaceLeftDrawerProps.md @@ -4,7 +4,7 @@ # Interface: InterfaceLeftDrawerProps -Defined in: [src/components/LeftDrawer/LeftDrawer.tsx:12](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/LeftDrawer/LeftDrawer.tsx#L12) +Defined in: [src/components/LeftDrawer/LeftDrawer.tsx:13](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/LeftDrawer/LeftDrawer.tsx#L13) ## Properties @@ -12,7 +12,7 @@ Defined in: [src/components/LeftDrawer/LeftDrawer.tsx:12](https://github.com/Pal > **hideDrawer**: `boolean` -Defined in: [src/components/LeftDrawer/LeftDrawer.tsx:13](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/LeftDrawer/LeftDrawer.tsx#L13) +Defined in: [src/components/LeftDrawer/LeftDrawer.tsx:14](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/LeftDrawer/LeftDrawer.tsx#L14) *** @@ -20,4 +20,4 @@ Defined in: [src/components/LeftDrawer/LeftDrawer.tsx:13](https://github.com/Pal > **setHideDrawer**: `Dispatch`\<`SetStateAction`\<`boolean`\>\> -Defined in: [src/components/LeftDrawer/LeftDrawer.tsx:14](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/LeftDrawer/LeftDrawer.tsx#L14) +Defined in: [src/components/LeftDrawer/LeftDrawer.tsx:15](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/LeftDrawer/LeftDrawer.tsx#L15) diff --git a/docs/docs/auto-docs/components/SuperAdminScreen/SuperAdminScreen/functions/default.md b/docs/docs/auto-docs/components/SuperAdminScreen/SuperAdminScreen/functions/default.md index 31b98bab95..b1df3638d2 100644 --- a/docs/docs/auto-docs/components/SuperAdminScreen/SuperAdminScreen/functions/default.md +++ b/docs/docs/auto-docs/components/SuperAdminScreen/SuperAdminScreen/functions/default.md @@ -6,7 +6,7 @@ > **default**(): `Element` -Defined in: [src/components/SuperAdminScreen/SuperAdminScreen.tsx:15](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/SuperAdminScreen/SuperAdminScreen.tsx#L15) +Defined in: [src/components/SuperAdminScreen/SuperAdminScreen.tsx:14](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/SuperAdminScreen/SuperAdminScreen.tsx#L14) The SuperAdminScreen component manages the layout for the Super Admin screen, including handling the sidebar visibility and page title based on the current route. diff --git a/docs/docs/auto-docs/components/UserPortal/UserSidebar/UserSidebar/functions/default.md b/docs/docs/auto-docs/components/UserPortal/UserSidebar/UserSidebar/functions/default.md index eb891bb0c9..6fc6ef8069 100644 --- a/docs/docs/auto-docs/components/UserPortal/UserSidebar/UserSidebar/functions/default.md +++ b/docs/docs/auto-docs/components/UserPortal/UserSidebar/UserSidebar/functions/default.md @@ -6,7 +6,7 @@ > **default**(`__namedParameters`): `Element` -Defined in: [src/components/UserPortal/UserSidebar/UserSidebar.tsx:28](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/UserPortal/UserSidebar/UserSidebar.tsx#L28) +Defined in: [src/components/UserPortal/UserSidebar/UserSidebar.tsx:29](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/UserPortal/UserSidebar/UserSidebar.tsx#L29) Sidebar component for user navigation, including links to organizations and settings. diff --git a/docs/docs/auto-docs/components/UserPortal/UserSidebar/UserSidebar/interfaces/InterfaceUserSidebarProps.md b/docs/docs/auto-docs/components/UserPortal/UserSidebar/UserSidebar/interfaces/InterfaceUserSidebarProps.md index e8b93fe25a..f9a8d7cab3 100644 --- a/docs/docs/auto-docs/components/UserPortal/UserSidebar/UserSidebar/interfaces/InterfaceUserSidebarProps.md +++ b/docs/docs/auto-docs/components/UserPortal/UserSidebar/UserSidebar/interfaces/InterfaceUserSidebarProps.md @@ -4,7 +4,7 @@ # Interface: InterfaceUserSidebarProps -Defined in: [src/components/UserPortal/UserSidebar/UserSidebar.tsx:10](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/UserPortal/UserSidebar/UserSidebar.tsx#L10) +Defined in: [src/components/UserPortal/UserSidebar/UserSidebar.tsx:11](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/UserPortal/UserSidebar/UserSidebar.tsx#L11) ## Properties @@ -12,7 +12,7 @@ Defined in: [src/components/UserPortal/UserSidebar/UserSidebar.tsx:10](https://g > **hideDrawer**: `boolean` -Defined in: [src/components/UserPortal/UserSidebar/UserSidebar.tsx:11](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/UserPortal/UserSidebar/UserSidebar.tsx#L11) +Defined in: [src/components/UserPortal/UserSidebar/UserSidebar.tsx:12](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/UserPortal/UserSidebar/UserSidebar.tsx#L12) *** @@ -20,4 +20,4 @@ Defined in: [src/components/UserPortal/UserSidebar/UserSidebar.tsx:11](https://g > **setHideDrawer**: `Dispatch`\<`SetStateAction`\<`boolean`\>\> -Defined in: [src/components/UserPortal/UserSidebar/UserSidebar.tsx:12](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/UserPortal/UserSidebar/UserSidebar.tsx#L12) +Defined in: [src/components/UserPortal/UserSidebar/UserSidebar.tsx:13](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/components/UserPortal/UserSidebar/UserSidebar.tsx#L13) diff --git a/docs/docs/auto-docs/screens/UserPortal/Organizations/Organizations/functions/default.md b/docs/docs/auto-docs/screens/UserPortal/Organizations/Organizations/functions/default.md index cf462d91f1..bf89ac62e0 100644 --- a/docs/docs/auto-docs/screens/UserPortal/Organizations/Organizations/functions/default.md +++ b/docs/docs/auto-docs/screens/UserPortal/Organizations/Organizations/functions/default.md @@ -6,7 +6,7 @@ > **default**(): `JSX.Element` -Defined in: [src/screens/UserPortal/Organizations/Organizations.tsx:78](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/screens/UserPortal/Organizations/Organizations.tsx#L78) +Defined in: [src/screens/UserPortal/Organizations/Organizations.tsx:77](https://github.com/PalisadoesFoundation/talawa-admin/blob/main/src/screens/UserPortal/Organizations/Organizations.tsx#L77) Component for displaying and managing user organizations. diff --git a/public/images/svg/angleRight.svg b/public/images/svg/angleRight.svg new file mode 100644 index 0000000000..d26d1e3212 --- /dev/null +++ b/public/images/svg/angleRight.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/assets/css/app.css b/src/assets/css/app.css index 16af7c92fb..34beb0969a 100644 --- a/src/assets/css/app.css +++ b/src/assets/css/app.css @@ -2478,9 +2478,7 @@ progress { .form-control:focus { color: var(--bs-body-color); background-color: #f2f2f2; - border-color: #98ddb5; outline: 0; - box-shadow: 0 0 0 0.25rem rgba(49, 187, 107, 0.25); } .form-control::-webkit-date-and-time-value { @@ -3255,6 +3253,12 @@ textarea.form-control.is-valid { border-color: var(--bs-form-valid-border-color); } +input:-webkit-autofill { + background-color: white !important; + -webkit-box-shadow: 0 0 0px 1000px white inset !important; + -webkit-text-fill-color: initial !important; +} + .was-validated .form-check-input:valid:checked, .form-check-input.is-valid:checked { background-color: var(--bs-form-valid-color); diff --git a/src/components/LeftDrawer/LeftDrawer.spec.tsx b/src/components/LeftDrawer/LeftDrawer.spec.tsx index a0aaf9336c..b73cab654b 100644 --- a/src/components/LeftDrawer/LeftDrawer.spec.tsx +++ b/src/components/LeftDrawer/LeftDrawer.spec.tsx @@ -93,13 +93,9 @@ describe('Testing Left Drawer component for SUPERADMIN', () => { orgsBtn.click(); }); - expect( - orgsBtn.className.includes('text-black btn btn-success'), - ).toBeTruthy(); - expect(rolesBtn.className.includes('text-secondary btn')).toBeTruthy(); - expect( - communityProfileBtn.className.includes('text-secondary btn'), - ).toBeTruthy(); + expect(orgsBtn.className.includes('btn btn-success')).toBeTruthy(); + expect(rolesBtn.className.includes('btn')).toBeTruthy(); + expect(communityProfileBtn.className.includes('btn')).toBeTruthy(); await act(async () => { userEvent.click(rolesBtn); @@ -171,14 +167,6 @@ describe('Testing Left Drawer component for SUPERADMIN', () => { expect(screen.getByText('My Organizations')).toBeInTheDocument(); expect(screen.getByText('Talawa Admin Portal')).toBeInTheDocument(); - - const orgsBtn = screen.getByTestId(/orgsBtn/i); - - await act(async () => { - orgsBtn.click(); - }); - - expect(orgsBtn.className.includes('text-black')).toBeTruthy(); }); }); @@ -207,9 +195,7 @@ describe('Testing Left Drawer component for ADMIN', () => { orgsBtn.click(); }); - expect( - orgsBtn.className.includes('text-black btn btn-success'), - ).toBeTruthy(); + expect(orgsBtn.className.includes('btn btn-success')).toBeTruthy(); // These screens aren't meant for admins, so they should not be present expect(screen.queryByTestId(/rolesBtn/i)).toBeNull(); diff --git a/src/components/LeftDrawer/LeftDrawer.tsx b/src/components/LeftDrawer/LeftDrawer.tsx index 1ef8192ae1..4e824c96c6 100644 --- a/src/components/LeftDrawer/LeftDrawer.tsx +++ b/src/components/LeftDrawer/LeftDrawer.tsx @@ -8,6 +8,7 @@ import SettingsIcon from 'assets/svgs/settings.svg?react'; import TalawaLogo from 'assets/svgs/talawa.svg?react'; import styles from 'style/app.module.css'; import useLocalStorage from 'utils/useLocalstorage'; +import ProfileDropdown from 'components/ProfileDropdown/ProfileDropdown'; export interface InterfaceLeftDrawerProps { hideDrawer: boolean | null; // Controls the visibility of the drawer @@ -63,80 +64,100 @@ const leftDrawer = ({
{tCommon('menu')}
-
- - {({ isActive }) => ( - +
+
+ + {({ isActive }) => ( + + )} + + {superAdmin && ( + <> + + {({ isActive }) => ( + + )} + + + {({ isActive }) => ( + + )} + + )} - - {superAdmin && ( - <> - - {({ isActive }) => ( - - )} - - - {({ isActive }) => ( - - )} - - - )} +
+
+ +
diff --git a/src/components/LoginPortalToggle/LoginPortalToggle.module.css b/src/components/LoginPortalToggle/LoginPortalToggle.module.css deleted file mode 100644 index db51554389..0000000000 --- a/src/components/LoginPortalToggle/LoginPortalToggle.module.css +++ /dev/null @@ -1,34 +0,0 @@ -.navLinkClass { - display: inline-block; - padding: 0.375rem 0.75rem; - font-size: 1rem; - line-height: 1.4; - text-align: center; - vertical-align: middle; - cursor: pointer; - color: var(--bs-gray-900); - border-radius: 0.3rem; - width: 100%; - box-sizing: border-box; - border: 1px solid var(--bs-gray-700); - font-weight: 500; - transition: all 0.25s ease; -} - -.navLinkClass:hover { - color: var(--bs-white); - background-color: var(--bs-gray); - border-color: var(--bs-gray); -} - -.activeLink { - color: white; - border: 1px solid var(--bs-primary); - background-color: var(--toggle-button-bg); -} - -.activeLink:hover { - color: var(--bs-white); - background-color: var(--toggle-button-bg); - border: 1px solid var(--bs-primary); -} diff --git a/src/components/LoginPortalToggle/LoginPortalToggle.tsx b/src/components/LoginPortalToggle/LoginPortalToggle.tsx index 76305b02d3..64fa9317c7 100644 --- a/src/components/LoginPortalToggle/LoginPortalToggle.tsx +++ b/src/components/LoginPortalToggle/LoginPortalToggle.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import styles from './LoginPortalToggle.module.css'; +import styles from '../../style/app.module.css'; import Col from 'react-bootstrap/Col'; import Row from 'react-bootstrap/Row'; import { NavLink } from 'react-router-dom'; diff --git a/src/components/OrgListCard/OrgListCard.module.css b/src/components/OrgListCard/OrgListCard.module.css deleted file mode 100644 index 292456f310..0000000000 --- a/src/components/OrgListCard/OrgListCard.module.css +++ /dev/null @@ -1,148 +0,0 @@ -.orgCard { - background-color: var(--bs-white); - margin: 0.5rem; - height: calc(120px + 2rem); - padding: 1rem; - border-radius: 8px; - outline: 1px solid var(--bs-gray-200); - position: relative; -} - -.orgCard .innerContainer { - display: flex; -} - -.orgCard .innerContainer .orgImgContainer { - display: flex; - justify-content: center; - align-items: center; - position: relative; - overflow: hidden; - border-radius: 4px; -} - -.orgCard .innerContainer .orgImgContainer { - width: 125px; - height: 120px; - object-fit: contain; -} - -.orgCard .innerContainer .orgImgContainer { - width: 125px; - height: 120px; - background-color: var(--bs-gray-200); -} - -.orgCard .innerContainer .content { - flex: 1; - margin-left: 1rem; - width: 70%; - margin-top: 0.7rem; -} - -.orgCard button { - position: absolute; - bottom: 1rem; - right: 1rem; - z-index: 1; -} - -.flaskIcon { - margin-top: 4px; -} - -.manageBtn { - display: flex; - justify-content: space-around; - width: 8rem; - background-color: var(--grey-bg-color) !important; - color: black !important; - border: 1px solid var(--dropdown-border-color); -} - -.manageBtn:hover { - border: 1px solid var(--dropdown-border-color) !important; -} - -.orgName { - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; - font-size: 1rem; -} - -.orgdesc { - font-size: 0.9rem; - color: var(--bs-gray-600); - overflow: hidden; - display: -webkit-box; - -webkit-line-clamp: 1; - line-clamp: 1; - -webkit-box-orient: vertical; - max-width: 20rem; -} - -.orgadmin { - font-size: 0.9rem; -} - -.orgmember { - font-size: 0.9rem; -} - -.address { - overflow: hidden; - display: -webkit-box; - -webkit-line-clamp: 1; - line-clamp: 1; - -webkit-box-orient: vertical; - align-items: center; -} - -.address h6 { - font-size: 0.9rem; - color: var(--bs-gray-600); -} - -@media (max-width: 580px) { - .orgCard { - height: unset; - margin: 0.5rem 0; - padding: 1.25rem 1.5rem; - } - - .orgCard .innerContainer { - flex-direction: column; - } - - .orgCard .innerContainer .orgImgContainer { - margin-bottom: 0.8rem; - } - - .orgCard .innerContainer .orgImgContainer img { - height: auto; - width: 100%; - } - - .orgCard .innerContainer .content { - margin-left: 0; - } - - .orgCard button { - bottom: 0; - right: 0; - position: relative; - margin-left: auto; - display: block; - } - - .flaskIcon { - margin-bottom: 6px; - } - - .manageBtn { - display: flex; - justify-content: space-around; - width: 100%; - } -} diff --git a/src/components/OrgListCard/OrgListCard.tsx b/src/components/OrgListCard/OrgListCard.tsx index cf651e9dfe..a6e1d82dad 100644 --- a/src/components/OrgListCard/OrgListCard.tsx +++ b/src/components/OrgListCard/OrgListCard.tsx @@ -4,7 +4,7 @@ import TruncatedText from './TruncatedText'; import FlaskIcon from 'assets/svgs/flask.svg?react'; import Button from 'react-bootstrap/Button'; import { useTranslation } from 'react-i18next'; -import styles from './OrgListCard.module.css'; +import styles from '../../style/app.module.css'; import { useNavigate } from 'react-router-dom'; import type { InterfaceOrgConnectionInfoType, @@ -112,8 +112,12 @@ function orgListCard(props: InterfaceOrgListCardProps): JSX.Element { )} {/* Display the number of admins and members */}
- {tCommon('admins')}: {admins.length}     -   {tCommon('members')}: {members.length} +
+ {tCommon('admins')}: {admins.length} +
+
+ {tCommon('members')}: {members.length} +
diff --git a/src/components/ProfileDropdown/ProfileDropdown.module.css b/src/components/ProfileDropdown/ProfileDropdown.module.css deleted file mode 100644 index 46af582126..0000000000 --- a/src/components/ProfileDropdown/ProfileDropdown.module.css +++ /dev/null @@ -1,75 +0,0 @@ -.profileContainer { - border: none; - padding: 2.1rem 0.5rem; - height: 52px; - border-radius: 8px 0px 0px 8px; - display: flex; - align-items: center; - background-color: white !important; - box-shadow: - 0 4px 4px 0 rgba(177, 177, 177, 0.2), - 0 6px 44px 0 rgba(246, 246, 246, 0.19); -} -.profileContainer:focus { - outline: none; - background-color: var(--bs-gray-100); -} -.imageContainer { - width: 56px; - height: 56px; - border-radius: 100%; - margin-right: 10px; -} -.imageContainer img { - width: 100%; - height: 100%; - object-fit: cover; - border-radius: 100%; -} -.profileContainer .profileText { - flex: 1; - text-align: start; - overflow: hidden; - margin-right: 4px; -} -.angleDown { - margin-left: 4px; -} -.profileContainer .profileText .primaryText { - font-size: 1rem; - font-weight: 600; - overflow: hidden; - display: -webkit-box; - -webkit-line-clamp: 2; /* number of lines to show */ - -webkit-box-orient: vertical; - word-wrap: break-word; - white-space: normal; -} -.profileContainer .profileText .secondaryText { - font-size: 0.8rem; - font-weight: 400; - color: var(--bs-secondary); - display: block; - text-transform: capitalize; -} -.profileDropdown { - background-color: transparent !important; -} -.profileDropdown .dropdown-toggle .btn .btn-normal { - display: none !important; - background-color: transparent !important; -} -.dropdownToggle { - background-image: url(/public/images/svg/angleDown.svg); - background-repeat: no-repeat; - background-position: center; - background-color: azure; -} - -.dropdownToggle::after { - border-top: none !important; - border-bottom: none !important; -} -.avatarStyle { - border-radius: 100%; -} diff --git a/src/components/ProfileDropdown/ProfileDropdown.tsx b/src/components/ProfileDropdown/ProfileDropdown.tsx index 1148b9da8f..182b0d66db 100644 --- a/src/components/ProfileDropdown/ProfileDropdown.tsx +++ b/src/components/ProfileDropdown/ProfileDropdown.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { ButtonGroup, Dropdown } from 'react-bootstrap'; import { useNavigate, useParams } from 'react-router-dom'; import useLocalStorage from 'utils/useLocalstorage'; -import styles from './ProfileDropdown.module.css'; +import styles from '../../style/app.module.css'; import { REVOKE_REFRESH_TOKEN } from 'GraphQl/Mutations/mutations'; import { useMutation } from '@apollo/client'; import { useTranslation } from 'react-i18next'; @@ -43,7 +43,6 @@ const profileDropdown = (): JSX.Element => { try { await revokeRefreshToken(); } catch (error) { - /*istanbul ignore next*/ console.error('Error revoking refresh token:', error); } localStorage.clear(); @@ -54,16 +53,18 @@ const profileDropdown = (): JSX.Element => { const fullName = `${firstName} ${lastName}`; const displayedName = fullName.length > MAX_NAME_LENGTH - ? /*istanbul ignore next*/ - fullName.substring(0, MAX_NAME_LENGTH - 3) + '...' + ? fullName.substring(0, MAX_NAME_LENGTH - 3) + '...' : fullName; return ( - +
{userImage && userImage !== 'null' ? ( - /*istanbul ignore next*/ {`profile {

{t('title')}

-
diff --git a/src/components/UserPortal/OrganizationCard/OrganizationCard.module.css b/src/components/UserPortal/OrganizationCard/OrganizationCard.module.css deleted file mode 100644 index 15634f7ad0..0000000000 --- a/src/components/UserPortal/OrganizationCard/OrganizationCard.module.css +++ /dev/null @@ -1,149 +0,0 @@ -.orgCard { - background-color: var(--bs-white); - margin: 0.5rem; - height: calc(120px + 2rem); - padding: 1rem; - border-radius: 8px; - outline: 1px solid var(--bs-gray-200); - position: relative; -} - -.orgCard .innerContainer { - display: flex; -} - -.orgCard .innerContainer .orgImgContainer { - display: flex; - justify-content: center; - align-items: center; - position: relative; - overflow: hidden; - border-radius: 4px; - width: 125px; - height: 120px; - object-fit: contain; - background-color: var(--bs-gray-200); -} - -.orgCard .innerContainer .content { - flex: 1; - margin-left: 1rem; - width: 70%; - margin-top: 0.7rem; -} - -.orgCard button { - position: absolute; - bottom: 1rem; - right: 1rem; - z-index: 1; -} - -.joinBtn { - display: flex; - justify-content: space-around; - width: 8rem; - border-width: medium; -} - -.joinedBtn { - display: flex; - justify-content: space-around; - width: 8rem; -} - -.withdrawBtn { - display: flex; - justify-content: space-around; - width: 8rem; -} - -.orgName { - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; - font-size: 1rem; -} - -.orgdesc { - font-size: 0.9rem; - color: var(--bs-gray-600); - overflow: hidden; - display: -webkit-box; - -webkit-line-clamp: 1; - line-clamp: 1; - -webkit-box-orient: vertical; - max-width: 20rem; -} - -.orgadmin { - font-size: 0.9rem; -} - -.orgmember { - font-size: 0.9rem; -} - -.address { - overflow: hidden; - display: -webkit-box; - -webkit-line-clamp: 1; - line-clamp: 1; - -webkit-box-orient: vertical; - align-items: center; -} - -.address h6 { - font-size: 0.9rem; - color: var(--bs-gray-600); -} - -@media (max-width: 1420px) { - .orgCard { - width: 100%; - } -} - -@media (max-width: 550px) { - .orgCard { - width: 100%; - } - - .orgCard { - height: unset; - margin: 0.5rem 0; - padding: 1.25rem 1.5rem; - } - - .orgCard .innerContainer .orgImgContainer { - margin-bottom: 0.8rem; - } - - .orgCard .innerContainer { - flex-direction: column; - } - - .orgCard .innerContainer .orgImgContainer img { - height: auto; - width: 100%; - } - - .orgCard .innerContainer .content { - margin-left: 0; - } - - .orgCard button { - bottom: 0; - right: 0; - position: relative; - margin-left: auto; - display: block; - } - .joinBtn, - .joinedBtn, - .withdrawBtn { - display: flex; - justify-content: space-around; - width: 100%; - } -} diff --git a/src/components/UserPortal/OrganizationCard/OrganizationCard.tsx b/src/components/UserPortal/OrganizationCard/OrganizationCard.tsx index b468f84a22..58eeaa83de 100644 --- a/src/components/UserPortal/OrganizationCard/OrganizationCard.tsx +++ b/src/components/UserPortal/OrganizationCard/OrganizationCard.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import styles from './OrganizationCard.module.css'; +import styles from '../../../style/app.module.css'; import { Button } from 'react-bootstrap'; import { Tooltip } from '@mui/material'; import { useTranslation } from 'react-i18next'; @@ -180,9 +180,12 @@ function organizationCard(props: InterfaceOrganizationCardProps): JSX.Element { )}
- {tCommon('admins')}: {props.admins?.length}   -     {tCommon('members')}:{' '} - {props.members?.length} +
+ {tCommon('admins')}: {props.admins?.length} +
+
+ {tCommon('members')}: {props.members?.length} +
diff --git a/src/components/UserPortal/UserSidebar/UserSidebar.module.css b/src/components/UserPortal/UserSidebar/UserSidebar.module.css deleted file mode 100644 index aafeaeff97..0000000000 --- a/src/components/UserPortal/UserSidebar/UserSidebar.module.css +++ /dev/null @@ -1,239 +0,0 @@ -.leftDrawer { - width: calc(300px); - position: fixed; - top: 0; - bottom: 0; - z-index: 100; - display: flex; - flex-direction: column; - padding: 1rem 1rem 0 1rem; - background-color: var(--bs-white); - transition: 0.5s; - font-family: var(--bs-leftDrawer-font-family); -} - -.activeDrawer { - width: calc(300px); - position: fixed; - top: 0; - left: 0; - bottom: 0; - animation: comeToRightBigScreen 0.5s ease-in-out; -} - -.inactiveDrawer { - position: fixed; - top: 0; - left: calc(-300px - 2rem); - bottom: 0; - animation: goToLeftBigScreen 0.5s ease-in-out; -} - -.leftDrawer .talawaLogo { - width: 100%; - height: 65px; -} - -.leftDrawer .talawaText { - font-size: 20px; - text-align: center; - font-weight: 500; -} - -.leftDrawer .titleHeader { - margin: 2rem 0 1rem 0; - font-weight: 600; -} - -.leftDrawer .optionList button { - display: flex; - align-items: center; - width: 100%; - text-align: start; - margin-bottom: 0.8rem; - border-radius: 16px; - outline: none; - border: none; -} - -.leftDrawer .optionList button .iconWrapper { - width: 36px; -} - -.leftDrawer .profileContainer { - border: none; - width: 100%; - padding: 2.1rem 0.5rem; - height: 52px; - display: flex; - align-items: center; - background-color: var(--bs-white); -} - -.leftDrawer .profileContainer:focus { - outline: none; - background-color: var(--bs-gray-100); -} - -.leftDrawer .imageContainer { - width: 68px; -} - -.leftDrawer .profileContainer img { - height: 52px; - width: 52px; - border-radius: 50%; -} - -.leftDrawer .profileContainer .profileText { - flex: 1; - text-align: start; -} - -.leftDrawer .profileContainer .profileText .primaryText { - font-size: 1.1rem; - font-weight: 600; -} - -.leftDrawer .profileContainer .profileText .secondaryText { - font-size: 0.8rem; - font-weight: 400; - color: var(--bs-secondary); - display: block; - text-transform: capitalize; -} - -@media (max-width: 1120px) { - .leftDrawer { - width: calc(250px + 2rem); - padding: 1rem 1rem 0 1rem; - } -} - -/* For tablets */ -@media (max-width: 820px) { - .hideElemByDefault { - display: none; - } - - .leftDrawer { - width: 100%; - left: 0; - right: 0; - } - - .inactiveDrawer { - opacity: 0; - left: 0; - z-index: -1; - animation: closeDrawer 0.4s ease-in-out; - } - - .activeDrawer { - display: flex; - z-index: 100; - animation: openDrawer 0.6s ease-in-out; - } - - .logout { - margin-bottom: 2.5rem !important; - } -} - -@keyframes goToLeftBigScreen { - from { - left: 0; - } - - to { - opacity: 0.1; - left: calc(-300px - 2rem); - } -} - -/* Webkit prefix for older browser compatibility */ -@-webkit-keyframes goToLeftBigScreen { - from { - left: 0; - } - - to { - opacity: 0.1; - left: calc(-300px - 2rem); - } -} - -@keyframes comeToRightBigScreen { - from { - opacity: 0.4; - left: calc(-300px - 2rem); - } - - to { - opacity: 1; - left: 0; - } -} - -/* Webkit prefix for older browser compatibility */ -@-webkit-keyframes comeToRightBigScreen { - from { - opacity: 0.4; - left: calc(-300px - 2rem); - } - - to { - opacity: 1; - left: 0; - } -} - -@keyframes closeDrawer { - from { - left: 0; - opacity: 1; - } - - to { - left: -1000px; - opacity: 0; - } -} - -/* Webkit prefix for older browser compatibility */ -@-webkit-keyframes closeDrawer { - from { - left: 0; - opacity: 1; - } - - to { - left: -1000px; - opacity: 0; - } -} - -@keyframes openDrawer { - from { - opacity: 0; - left: -1000px; - } - - to { - left: 0; - opacity: 1; - } -} - -/* Webkit prefix for older browser compatibility */ -@-webkit-keyframes openDrawer { - from { - opacity: 0; - left: -1000px; - } - - to { - left: 0; - opacity: 1; - } -} diff --git a/src/components/UserPortal/UserSidebar/UserSidebar.spec.tsx b/src/components/UserPortal/UserSidebar/UserSidebar.spec.tsx index 6435353f89..7476bd8061 100644 --- a/src/components/UserPortal/UserSidebar/UserSidebar.spec.tsx +++ b/src/components/UserPortal/UserSidebar/UserSidebar.spec.tsx @@ -3,7 +3,7 @@ import type { RenderResult } from '@testing-library/react'; import { fireEvent, render, screen } from '@testing-library/react'; import { MockedProvider } from '@apollo/react-testing'; import { I18nextProvider } from 'react-i18next'; -import styles from './UserSidebar.module.css'; +import styles from '../../../style/app.module.css'; import { USER_DETAILS, USER_JOINED_ORGANIZATIONS, @@ -462,9 +462,9 @@ describe('UserSidebar Component Tests in User Portal', () => { const settingsBtn = screen.getByTestId('settingsBtn'); fireEvent.click(orgsBtn); - expect(orgsBtn).toHaveClass('text-white btn btn-success'); + expect(orgsBtn).toHaveClass('btn btn-success'); fireEvent.click(settingsBtn); - expect(settingsBtn).toHaveClass('text-white btn btn-success'); + expect(settingsBtn).toHaveClass('btn btn-success'); }); it('Translation hook displays expected text in UserSidebar', async () => { diff --git a/src/components/UserPortal/UserSidebar/UserSidebar.tsx b/src/components/UserPortal/UserSidebar/UserSidebar.tsx index 010d8d0e52..c350a27cc1 100644 --- a/src/components/UserPortal/UserSidebar/UserSidebar.tsx +++ b/src/components/UserPortal/UserSidebar/UserSidebar.tsx @@ -5,7 +5,8 @@ import { NavLink } from 'react-router-dom'; import OrganizationsIcon from 'assets/svgs/organizations.svg?react'; import SettingsIcon from 'assets/svgs/settings.svg?react'; import TalawaLogo from 'assets/svgs/talawa.svg?react'; -import styles from './UserSidebar.module.css'; +import styles from '../../../style/app.module.css'; +import ProfileDropdown from 'components/ProfileDropdown/ProfileDropdown'; export interface InterfaceUserSidebarProps { hideDrawer: boolean | null; @@ -61,53 +62,70 @@ const userSidebar = ({
{tCommon('menu')}
-
- {/* Link to "My Organizations" page */} - - {({ isActive }) => ( - - )} - - {/* Link to "Settings" page */} - - {({ isActive }) => ( - - )} - +
+
+ {/* Link to "My Organizations" page */} + + + {({ isActive }) => ( + + )} + + {/* Link to "Settings" page */} + + {({ isActive }) => ( + + )} + +
+
+ +
diff --git a/src/screens/ForgotPassword/ForgotPassword.tsx b/src/screens/ForgotPassword/ForgotPassword.tsx index 49c0a2af6e..2986ee1afb 100644 --- a/src/screens/ForgotPassword/ForgotPassword.tsx +++ b/src/screens/ForgotPassword/ForgotPassword.tsx @@ -105,7 +105,7 @@ const ForgotPassword = (): JSX.Element => { }; /** - * Handles the form submission for resetting the password. + * manages the form submission for resetting the password. * * @param e - The form submit event */ @@ -135,7 +135,6 @@ const ForgotPassword = (): JSX.Element => { }, }); - /* istanbul ignore else -- @preserve */ if (data) { toast.success(t('passwordChanges') as string); setShowEnterEmail(true); @@ -164,7 +163,10 @@ const ForgotPassword = (): JSX.Element => {
- +

{tCommon('forgotPassword')} @@ -191,7 +193,7 @@ const ForgotPassword = (): JSX.Element => {

@@ -632,7 +632,7 @@ const loginPage = (): JSX.Element => {