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 = ({