From c527f7df8ec8b8b48c5ebc80114774ad2c8bb1db Mon Sep 17 00:00:00 2001 From: Joshua Rodriguez Date: Thu, 1 Feb 2024 18:55:04 -0600 Subject: [PATCH 01/23] Polish profile page UI layout --- frontend/compositions/profile-nav/index.tsx | 26 ++++++------- .../profile-nav/profile-nav.module.css | 22 +++++------ frontend/models/profile.tsx | 26 +++---------- frontend/pages/profile/index.tsx | 38 +++++++++++-------- frontend/pages/profile/profile.module.css | 16 +++----- 5 files changed, 54 insertions(+), 74 deletions(-) diff --git a/frontend/compositions/profile-nav/index.tsx b/frontend/compositions/profile-nav/index.tsx index ccd366d1..c4d6ddeb 100644 --- a/frontend/compositions/profile-nav/index.tsx +++ b/frontend/compositions/profile-nav/index.tsx @@ -1,28 +1,24 @@ import * as React from "react" -import { ProfileMenu } from "../../models/profile" +import { ProfileMenu, profileMenuItems } from "../../models/profile" import styles from "./profile-nav.module.css" interface ProfileNavProps { - currentItem: ProfileMenu - selectNav: Function + activePage: ProfileMenu + setActivePage: React.Dispatch> } -const menuItems = [ - { item: ProfileMenu.USER_INFO, text: "User Information" }, - { item: ProfileMenu.PROFILE_TYPE, text: "Profile Type" }, - { item: ProfileMenu.SAVED_RESULTS, text: "Saved Results" }, - { item: ProfileMenu.SAVED_SEARCHES, text: "Saved Searches" } -] - -export default function ProfileNav({ currentItem, selectNav }: ProfileNavProps) { - const clsName = (itm: string) => (itm === currentItem ? styles.selectedItem : styles.menuItem) +export default function ProfileNav({ activePage, setActivePage }: ProfileNavProps) { + const clsName = (item: string) => (item === activePage ? styles.selectedItem : styles.menuItem) return (
Date: Sun, 11 Feb 2024 17:17:18 -0600 Subject: [PATCH 20/23] get rid of unnecessary console log in `useId` hook --- frontend/helpers/hooks/useId.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/helpers/hooks/useId.ts b/frontend/helpers/hooks/useId.ts index 6d09b541..41ed6ebf 100644 --- a/frontend/helpers/hooks/useId.ts +++ b/frontend/helpers/hooks/useId.ts @@ -12,8 +12,6 @@ const useId = () => { } }, []) - console.log("ID: ", id) - return id } From 2214cedf235a62cd8eeadd99e7b1381ea3d58215 Mon Sep 17 00:00:00 2001 From: Joshua Rodriguez Date: Sun, 11 Feb 2024 17:18:31 -0600 Subject: [PATCH 21/23] fix `CreateOrganizationBtn` import in `NoOrganizations` component --- .../no-organizations/no-organizations.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/compositions/profile-organizations/no-organizations/no-organizations.tsx b/frontend/compositions/profile-organizations/no-organizations/no-organizations.tsx index dd737f33..79d76083 100644 --- a/frontend/compositions/profile-organizations/no-organizations/no-organizations.tsx +++ b/frontend/compositions/profile-organizations/no-organizations/no-organizations.tsx @@ -1,6 +1,5 @@ -import { Logo } from "../../../shared-components" +import { Logo, CreateOrganizationBtn } from "../../../shared-components" import styles from "./no-organizations.module.css" -import CreateOrganizationBtn from "../../../shared-components/create-organization-btn/create-organization-btn" export default function NoOrganizations() { const { headerText } = styles From 95fe5dc9afd3fd7c1f52e551c5f1662f083f5ca7 Mon Sep 17 00:00:00 2001 From: Joshua Rodriguez Date: Sun, 11 Feb 2024 17:26:33 -0600 Subject: [PATCH 22/23] Update "org already exists" text in `CreateOrganizationForm` --- .../sub-comps/create-organization-form.module.css | 5 +++++ .../sub-comps/create-organization-form.tsx | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/shared-components/create-organization-btn/sub-comps/create-organization-form.module.css b/frontend/shared-components/create-organization-btn/sub-comps/create-organization-form.module.css index f098a22e..c418fae2 100644 --- a/frontend/shared-components/create-organization-btn/sub-comps/create-organization-form.module.css +++ b/frontend/shared-components/create-organization-btn/sub-comps/create-organization-form.module.css @@ -3,3 +3,8 @@ font-weight: bold; min-width: max-content; } + +.orgExists { + text-align: center; + font-size: var(--size20); +} diff --git a/frontend/shared-components/create-organization-btn/sub-comps/create-organization-form.tsx b/frontend/shared-components/create-organization-btn/sub-comps/create-organization-form.tsx index 7f78e45c..43f798eb 100644 --- a/frontend/shared-components/create-organization-btn/sub-comps/create-organization-form.tsx +++ b/frontend/shared-components/create-organization-btn/sub-comps/create-organization-form.tsx @@ -15,7 +15,7 @@ const createOrganizationSchema = z.object({ }) export default function CreateOrganizationForm() { - const { organizationCTA } = styles + const { organizationCTA, orgExists } = styles const formMethods = useForm({ resolver: zodResolver(createOrganizationSchema), @@ -36,7 +36,11 @@ export default function CreateOrganizationForm() { } if (!formCanSubmit) { - return

Org already exists! For admission, please contact: org@email.com

+ return ( +

+ The organization already exists! For admission, please contact: org@email.com +

+ ) } return ( From c4e8a5d0436ab1fa2ab8ddf7e17b4da384fd8fb8 Mon Sep 17 00:00:00 2001 From: Joshua Rodriguez Date: Mon, 12 Feb 2024 17:40:27 -0600 Subject: [PATCH 23/23] Downgrade "react-hook-form" to 7.25.0 Solves type errors related to react-hook-form and form validation resolvers --- frontend/package-lock.json | 16 ++++++++-------- frontend/package.json | 2 +- frontend/yarn.lock | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index aa457bab..9ee69373 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -22,7 +22,7 @@ "react": "^17.0.2", "react-accessible-dropdown-menu-hook": "^3.1.0", "react-dom": "^17.0.2", - "react-hook-form": "^7.50.1", + "react-hook-form": "^7.25.0", "react-responsive": "^9.0.0-beta.4", "react-tooltip": "^5.25.1", "topojson-client": "^3.1.0", @@ -30593,9 +30593,9 @@ } }, "node_modules/react-hook-form": { - "version": "7.50.1", - "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.50.1.tgz", - "integrity": "sha512-3PCY82oE0WgeOgUtIr3nYNNtNvqtJ7BZjsbxh6TnYNbXButaD5WpjOmTjdxZfheuHKR68qfeFnEDVYoSSFPMTQ==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.25.0.tgz", + "integrity": "sha512-MyF4YXegIT/vfyZloTm98mpJwLUPfULdX37yPzXeijT1hePCkV8DN1IAnEufxgtqCpc7aFGRinegQwisUGZCnA==", "engines": { "node": ">=12.22.0" }, @@ -30604,7 +30604,7 @@ "url": "https://opencollective.com/react-hook-form" }, "peerDependencies": { - "react": "^16.8.0 || ^17 || ^18" + "react": "^16.8.0 || ^17" } }, "node_modules/react-inspector": { @@ -59241,9 +59241,9 @@ } }, "react-hook-form": { - "version": "7.50.1", - "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.50.1.tgz", - "integrity": "sha512-3PCY82oE0WgeOgUtIr3nYNNtNvqtJ7BZjsbxh6TnYNbXButaD5WpjOmTjdxZfheuHKR68qfeFnEDVYoSSFPMTQ==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.25.0.tgz", + "integrity": "sha512-MyF4YXegIT/vfyZloTm98mpJwLUPfULdX37yPzXeijT1hePCkV8DN1IAnEufxgtqCpc7aFGRinegQwisUGZCnA==", "requires": {} }, "react-inspector": { diff --git a/frontend/package.json b/frontend/package.json index add21331..9b6fa86d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -42,7 +42,7 @@ "react": "^17.0.2", "react-accessible-dropdown-menu-hook": "^3.1.0", "react-dom": "^17.0.2", - "react-hook-form": "^7.50.1", + "react-hook-form": "^7.25.0", "react-responsive": "^9.0.0-beta.4", "react-tooltip": "^5.25.1", "topojson-client": "^3.1.0", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index b377f5eb..ce24325a 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -11906,10 +11906,10 @@ "react-fast-compare" "^3.2.0" "shallowequal" "^1.1.0" -"react-hook-form@^7.0.0", "react-hook-form@^7.50.1": - "integrity" "sha512-3PCY82oE0WgeOgUtIr3nYNNtNvqtJ7BZjsbxh6TnYNbXButaD5WpjOmTjdxZfheuHKR68qfeFnEDVYoSSFPMTQ==" - "resolved" "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.50.1.tgz" - "version" "7.50.1" +"react-hook-form@^7.0.0", "react-hook-form@^7.25.0": + "integrity" "sha512-MyF4YXegIT/vfyZloTm98mpJwLUPfULdX37yPzXeijT1hePCkV8DN1IAnEufxgtqCpc7aFGRinegQwisUGZCnA==" + "resolved" "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.25.0.tgz" + "version" "7.25.0" "react-inspector@^5.1.0": "integrity" "sha512-GURDaYzoLbW8pMGXwYPDBIv6nqei4kK7LPRZ9q9HCZF54wqXz/dnylBp/kfE9XmekBhHvLDdcYeyIwSrvtOiWg==" @@ -12061,7 +12061,7 @@ "@floating-ui/dom" "^1.0.0" "classnames" "^2.3.0" -"react@*", "react@^0.14.0 || ^15.0.0 || ^16.0.0", "react@^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1", "react@^16.0.0 || ^17.0.0", "react@^16.13.1 || ^17.0.0", "react@^16.6.0 || ^17.0.0", "react@^16.8 || ^17.0 || ^18.0", "react@^16.8.0 || ^17", "react@^16.8.0 || ^17 || ^18", "react@^16.8.0 || ^17.0.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^16.8.3 || ^17.0.0-0", "react@^16.8.4 || ^17.0.0", "react@^17.0.2", "react@>= 0.14.0", "react@>= 16.3.0", "react@>= 16.8.0 || 17.x.x || 18.x.x", "react@>=16.12.0", "react@>=16.13.1", "react@>=16.14.0", "react@>=16.3.0", "react@>=16.8.0", "react@>=16.9.0", "react@>=16.x", "react@>=17.0.0", "react@15.x || 16.x || 16.4.0-alpha.0911da3", "react@17.0.2": +"react@*", "react@^0.14.0 || ^15.0.0 || ^16.0.0", "react@^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1", "react@^16.0.0 || ^17.0.0", "react@^16.13.1 || ^17.0.0", "react@^16.6.0 || ^17.0.0", "react@^16.8 || ^17.0 || ^18.0", "react@^16.8.0 || ^17", "react@^16.8.0 || ^17.0.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^16.8.3 || ^17.0.0-0", "react@^16.8.4 || ^17.0.0", "react@^17.0.2", "react@>= 0.14.0", "react@>= 16.3.0", "react@>= 16.8.0 || 17.x.x || 18.x.x", "react@>=16.12.0", "react@>=16.13.1", "react@>=16.14.0", "react@>=16.3.0", "react@>=16.8.0", "react@>=16.9.0", "react@>=16.x", "react@>=17.0.0", "react@15.x || 16.x || 16.4.0-alpha.0911da3", "react@17.0.2": "integrity" "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==" "resolved" "https://registry.npmjs.org/react/-/react-17.0.2.tgz" "version" "17.0.2"