From 52c389450f0979542a792ab2fff25f21842df585 Mon Sep 17 00:00:00 2001 From: aadalal <57609353+AaDalal@users.noreply.github.com> Date: Tue, 26 Mar 2024 01:39:28 -0400 Subject: [PATCH 1/3] restyle ui --- .../degree-plan/components/Course/Course.tsx | 5 +- .../components/FourYearPlan/DegreeModal.tsx | 13 ++--- .../components/FourYearPlan/Semesters.tsx | 13 +++-- .../components/Requirements/QObject.tsx | 1 + .../components/Requirements/ReqPanel.tsx | 7 +-- .../components/Requirements/Rule.tsx | 51 +++++++++++++----- .../degree-plan/pages/FourYearPlanPage.tsx | 5 +- frontend/degree-plan/pages/OnboardingPage.tsx | 54 +++++++++---------- frontend/degree-plan/styles/globals.css | 5 ++ 9 files changed, 90 insertions(+), 64 deletions(-) diff --git a/frontend/degree-plan/components/Course/Course.tsx b/frontend/degree-plan/components/Course/Course.tsx index fac4bec3c..ae7d9cac0 100644 --- a/frontend/degree-plan/components/Course/Course.tsx +++ b/frontend/degree-plan/components/Course/Course.tsx @@ -7,7 +7,7 @@ import { Draggable } from "../common/DnD"; import Skeleton from "react-loading-skeleton" import 'react-loading-skeleton/dist/skeleton.css' -const COURSE_BORDER_RADIUS = "10px"; +const COURSE_BORDER_RADIUS = "9px"; export const BaseCourseContainer = styled.div<{ $isDragging?: boolean, $isUsed: boolean, $isDisabled: boolean }>` display: flex; @@ -16,11 +16,12 @@ export const BaseCourseContainer = styled.div<{ $isDragging?: boolean, $isUsed: min-width: 70px; min-height: 35px; border-radius: ${COURSE_BORDER_RADIUS}; - padding: .5rem; + padding: .75rem; text-wrap: nowrap; cursor: ${props => props.$isDisabled || props.$isUsed ? "not-allowed" : "grab"}; opacity: ${props => props.$isDisabled || props.$isDragging ? 0.7 : 1}; background-color: ${props => props.$isDragging ? "#4B9AE7" : "var(--background-grey)"}; + box-shadow: rgba(0, 0, 0, 0.01) 0px 6px 5px 0px, rgba(0, 0, 0, 0.04) 0px 0px 0px 1px; `; export const PlannedCourseContainer = styled(BaseCourseContainer)` diff --git a/frontend/degree-plan/components/FourYearPlan/DegreeModal.tsx b/frontend/degree-plan/components/FourYearPlan/DegreeModal.tsx index 9de8fae34..e8a0b3a42 100644 --- a/frontend/degree-plan/components/FourYearPlan/DegreeModal.tsx +++ b/frontend/degree-plan/components/FourYearPlan/DegreeModal.tsx @@ -17,7 +17,7 @@ import { import useSWR, { useSWRConfig } from "swr"; import ModalContainer from "../common/ModalContainer"; import Select from "react-select"; -import useSWRMutation from "swr/mutation"; +import { schoolOptions } from "@/pages/OnboardingPage"; export type ModalKey = | "plan-create" @@ -116,7 +116,7 @@ const DegreeAddInterior = styled.div` flex-direction: column; gap: 2rem; width: 100%; - padding: 1.2rem 2rem 280px; + padding: 1.2rem 2rem; `; interface RemoveDegreeProps { @@ -166,12 +166,6 @@ const ModalInterior = ({ const { data: degrees, isLoading: isLoadingDegrees } = useSWR(`/api/degree/degrees`); - const defaultSchools = ["BSE", "BA", "BAS", "BS"]; - const schoolOptions = defaultSchools.map((d) => ({ - value: d, - label: d, - })); - /** Create label for major listings */ const createMajorLabel = (degree: DegreeListing) => { const concentration = @@ -289,11 +283,14 @@ const ModalInterior = ({ isClearable placeholder="Select School or Program" isLoading={false} + styles={{ menuPortal: base => ({ ...base, zIndex: 9999 }) }} + menuPortalTarget={document.body} /> option.value === selectedSeason)} onChange={(option) => setSelectedSeason(option.value)} /> - - - - setName(e.target.value)} - placeholder="" - /> - @@ -356,10 +351,9 @@ const OnboardingPage = ({ onChange={(selectedOption) => setMajors(selectedOption)} isClearable isMulti + isDisabled={schools.length === 0} placeholder={ - schools.length > 0 - ? "Major - Concentration" - : "Please Select Program First" + "Major - Concentration" } styles={customSelectStylesRight} isLoading={isLoadingDegrees} diff --git a/frontend/degree-plan/styles/globals.css b/frontend/degree-plan/styles/globals.css index 89009dfbf..8cc71bd5b 100644 --- a/frontend/degree-plan/styles/globals.css +++ b/frontend/degree-plan/styles/globals.css @@ -97,6 +97,11 @@ } } */ +input, select, textarea, button { + font-family: inherit; + background-color: inherit; + color: inherit; +} * { box-sizing: border-box; From 54b0757ebfa1b165a46942a9bf1e8dd7611c09b6 Mon Sep 17 00:00:00 2001 From: aadalal <57609353+AaDalal@users.noreply.github.com> Date: Tue, 26 Mar 2024 02:51:21 -0400 Subject: [PATCH 2/3] fix degree add modal, try to fix initial semesters, minor style fixes --- .../components/FourYearPlan/DegreeModal.tsx | 18 +++-- .../components/FourYearPlan/PlanPanel.tsx | 2 +- .../components/FourYearPlan/Semesters.tsx | 77 ++++++------------- .../components/Requirements/ReqPanel.tsx | 6 +- .../components/common/ModalContainer.tsx | 68 ++++++++-------- .../components/common/TrashIcon.tsx | 8 ++ frontend/degree-plan/pages/OnboardingPage.tsx | 26 +++---- 7 files changed, 94 insertions(+), 111 deletions(-) diff --git a/frontend/degree-plan/components/FourYearPlan/DegreeModal.tsx b/frontend/degree-plan/components/FourYearPlan/DegreeModal.tsx index e8a0b3a42..093d94996 100644 --- a/frontend/degree-plan/components/FourYearPlan/DegreeModal.tsx +++ b/frontend/degree-plan/components/FourYearPlan/DegreeModal.tsx @@ -133,12 +133,14 @@ interface ModalInteriorProps { modalObject: DegreePlan | null | RemoveSemesterProps | RemoveDegreeProps; setActiveDegreeplan: (arg0: DegreePlan | null) => void; close: () => void; + modalRef: React.RefObject; } const ModalInterior = ({ modalObject, modalKey, setActiveDegreeplan, close, + modalRef }: ModalInteriorProps) => { const { create: createDegreeplan, @@ -283,21 +285,21 @@ const ModalInterior = ({ isClearable placeholder="Select School or Program" isLoading={false} - styles={{ menuPortal: base => ({ ...base, zIndex: 9999 }) }} - menuPortalTarget={document.body} + styles={{ menuPortal: base => ({ ...base, zIndex: 999 }) }} + menuPortalTarget={modalRef.current} />