diff --git a/frontend/src/components/Buttons/_Button.scss b/frontend/src/components/Buttons/_Button.scss index 34908d93..ecdeb7d0 100644 --- a/frontend/src/components/Buttons/_Button.scss +++ b/frontend/src/components/Buttons/_Button.scss @@ -102,18 +102,18 @@ $theme-values: ( ), ), "primary-dark": ( - "background-color": $color-blue, - "color": $color-white, + "background-color": $color-white, + "color": $color-blue-dark, "focus": ( - "background-color": $color-blue-focused, + "background-color": $color-blue-dark-focused, ), "hover": ( - "background-color": $color-white, + "background-color": $color-blue-dark-hover, "box-shadow": 0 4px 4px rgb(0 0 0 / 20%), - "color": $color-charcoal, + "color": $color-white, ), "active": ( - "background-color": $color-blue-focused, + "background-color": $color-blue-dark-focused, ), ), ); diff --git a/frontend/src/context/QualifiersContext.tsx b/frontend/src/context/QualifiersContext.tsx index b0b32b20..6056a6a8 100644 --- a/frontend/src/context/QualifiersContext.tsx +++ b/frontend/src/context/QualifiersContext.tsx @@ -6,6 +6,8 @@ type QualifiersType = { COPs: { [copName: string]: string[]; }; + selectedCOP?: string; + skills_matrix?: { [skill: string]: string }; // availabilityTimeSlots: string[]; }; @@ -53,6 +55,7 @@ export const QualifiersProvider: React.FC<{ children: ReactNode }> = ({ const [qualifiers, setQualifiers] = useState(initialState); const updateQualifiers = (newQualifiers: QualifiersType) => { + console.log("Updated Qualifiers:", newQualifiers); // Log the updated qualifiers TO DELETE setQualifiers(newQualifiers); }; diff --git a/frontend/src/pages/QualifierPage/components/ProgressIndicator.tsx b/frontend/src/pages/QualifierPage/components/ProgressIndicator.tsx new file mode 100644 index 00000000..34f4e024 --- /dev/null +++ b/frontend/src/pages/QualifierPage/components/ProgressIndicator.tsx @@ -0,0 +1,60 @@ +import React from "react"; + +interface ProgressIndicatorProps { + currentPart: number; + totalParts: number; + title: string; + progressPercentage: number; // New prop +} + +export const ProgressIndicator: React.FC = ({ + currentPart, + totalParts, + title, + progressPercentage, +}) => { + // Ensure progressPercentage is clamped between 0 and 100 + const validProgressPercentage = Math.min( + Math.max(progressPercentage, 0), + 100, + ); + const strokeDashoffset = 62.8 - (62.8 * validProgressPercentage) / 100; + + return ( +
+ + + + +
+ + Part {currentPart} of {totalParts} + + {title} +
+
+ ); +}; diff --git a/frontend/src/pages/QualifierPage/components/QualifierNav.tsx b/frontend/src/pages/QualifierPage/components/QualifierNav.tsx index eda178ed..9095b919 100644 --- a/frontend/src/pages/QualifierPage/components/QualifierNav.tsx +++ b/frontend/src/pages/QualifierPage/components/QualifierNav.tsx @@ -11,11 +11,13 @@ function QualifierNav({ className, children }: QualifierNavProps) { return (
- {children} +
+ {children} +
); } diff --git a/frontend/src/pages/QualifierPage/components/RadioButtonForm.tsx b/frontend/src/pages/QualifierPage/components/RadioButtonForm.tsx index eb11157b..79c15eb2 100644 --- a/frontend/src/pages/QualifierPage/components/RadioButtonForm.tsx +++ b/frontend/src/pages/QualifierPage/components/RadioButtonForm.tsx @@ -3,7 +3,36 @@ import React from "react"; // Internal Imports import Typography from "tw-components/Typography"; -function RadioButtonForm() { +interface RadioButtonFormProps { + onSkillSelect: (skill: string, level: string) => void; + selectedSkillsLevel: Record; +} + +const skills = [ + { + name: "User Research Methods", + description: "Interviews, surveys, and usability testing", + }, + { + name: "User Personas & Journey Mapping", + description: + "Developing representative user profiles and mapping user journeys", + }, + { + name: "Information Architecture", + description: + "E.g., creating site maps, navigation flows, or using card sorting", + }, + { + name: "Wireframing & Sketching", + description: "low-fidelity layouts to visualize structure and flow", + }, +]; + +function RadioButtonForm({ + onSkillSelect, + selectedSkillsLevel, +}: RadioButtonFormProps) { return ( @@ -29,22 +58,15 @@ function RadioButtonForm() { - - - - + {skills.map((skill) => ( + + ))}
); @@ -53,9 +75,16 @@ function RadioButtonForm() { interface SkillRowProps { skillName: string; description: string; + onSkillSelect: (skill: string, level: string) => void; + selectedLevel?: string; } -function SkillRow({ skillName, description }: SkillRowProps) { +function SkillRow({ + skillName, + description, + onSkillSelect, + selectedLevel, +}: SkillRowProps) { return ( @@ -65,13 +94,28 @@ function SkillRow({ skillName, description }: SkillRowProps) { - + onSkillSelect(skillName, "0-2yrs")} + /> - + onSkillSelect(skillName, "2-4yrs")} + /> - + onSkillSelect(skillName, "4+yrs")} + /> ); @@ -80,14 +124,18 @@ function SkillRow({ skillName, description }: SkillRowProps) { interface RadioButtonProps { value: string; name: string; + checked?: boolean; + onChange: () => void; } -function RadioButton({ value, name }: RadioButtonProps) { +function RadioButton({ value, name, checked, onChange }: RadioButtonProps) { return ( ); diff --git a/frontend/src/pages/QualifierPage/pages/QualifierPage1.tsx b/frontend/src/pages/QualifierPage/pages/QualifierPage1.tsx index 0093643b..f9eca4e6 100644 --- a/frontend/src/pages/QualifierPage/pages/QualifierPage1.tsx +++ b/frontend/src/pages/QualifierPage/pages/QualifierPage1.tsx @@ -1,21 +1,22 @@ // External Imports -import React, { useState, useEffect } from "react"; +import React, { useEffect } from "react"; import { useNavigate } from "react-router-dom"; import clsx from "clsx"; // Internal Imports import { copDatum, fetchAllCopData } from "api_data/copData"; import Typography from "tw-components/Typography"; -import { Button } from "components/components"; +import { Button } from "tw-components/Buttons"; import { QualifierNav } from "../components/QualifierNav"; +import { IconCheckMark } from "assets/images/images"; +import { useQualifiersContext } from "context/QualifiersContext"; function QualifierPage1() { const navigate = useNavigate(); - const [copData, setCopData] = useState([] as copDatum[]); - const [selectedCOP, setSelectedCOP] = useState(-1); + const { copData, qualifiers, updateQualifiers } = useQualifiersContext(); useEffect(() => { - setCopData(fetchAllCopData()); + fetchAllCopData(); }, []); const handleSelectCOP = ( @@ -23,12 +24,17 @@ function QualifierPage1() { cop: copDatum, ) => { e.stopPropagation(); - setSelectedCOP(cop.id); + + const newQualifiers = { + ...qualifiers, + selectedCOP: cop.title, + }; + updateQualifiers(newQualifiers); }; return ( <> -
+
What type of Practice Area are you looking for? @@ -37,54 +43,70 @@ function QualifierPage1() { {/* COP Cards */} -
- {copData.map((cop) => { - const isSelected = selectedCOP === cop.id; +
+
+ {copData.map((cop) => { + const isSelected = qualifiers.selectedCOP === cop.title; - return ( -
handleSelectCOP(e, cop)} - role="button" - tabIndex={0} - > + return (
handleSelectCOP(e, cop)} + role="button" + tabIndex={0} > -
- - {cop.title} - - - {cop.subtitle} - + ); + })} +
+ +
+
+
- ); - })} + + Practice Area: Complete + +
+ +
- - - ); } diff --git a/frontend/src/pages/QualifierPage/pages/QualifierPage2.tsx b/frontend/src/pages/QualifierPage/pages/QualifierPage2.tsx index c88370f5..dae77188 100644 --- a/frontend/src/pages/QualifierPage/pages/QualifierPage2.tsx +++ b/frontend/src/pages/QualifierPage/pages/QualifierPage2.tsx @@ -4,15 +4,29 @@ import { useNavigate } from "react-router-dom"; // Internal Imports import Typography from "tw-components/Typography"; -import { Button, IconButton } from "components/components"; -import { iconArrowLeft } from "assets/images/images"; +import { Button } from "tw-components/Buttons"; import { QualifierNav } from "../components/QualifierNav"; - import { RadioButtonForm } from "../components/RadioButtonForm"; -// import { ChipsSelection } from "../components/ChipsSelection"; +import { ProgressIndicator } from "../components/ProgressIndicator"; +import { useQualifiersContext } from "context/QualifiersContext"; function QualifierPage2() { const navigate = useNavigate(); + const { qualifiers, updateQualifiers } = useQualifiersContext(); + + const handleSkillSelect = (skill: string, level: string) => { + const newSkillsMatrix = { + ...qualifiers.skills_matrix, + [skill]: level, + }; + + const newQualifiers = { + ...qualifiers, + skills_matrix: newSkillsMatrix, + }; + + updateQualifiers(newQualifiers); + }; return ( <> @@ -23,27 +37,38 @@ function QualifierPage2() { Evaluate each skill based on your experience - - - {/* */} -
- - navigate("../1", { relative: "path" })} + - - +
+
+ + +
+ + +
+
+
); } diff --git a/frontend/src/tw-components/Buttons.tsx b/frontend/src/tw-components/Buttons.tsx index 3a5fb91d..4f30901f 100644 --- a/frontend/src/tw-components/Buttons.tsx +++ b/frontend/src/tw-components/Buttons.tsx @@ -52,7 +52,6 @@ const variantStyles: Record = { `, }; -// Base Button, no text, just styling const BaseButton: React.FC = ({ size = "medium", disabled = false, diff --git a/frontend/src/tw-components/Dialog.tsx b/frontend/src/tw-components/Dialog.tsx index 9a4b4fa4..59da9f7b 100644 --- a/frontend/src/tw-components/Dialog.tsx +++ b/frontend/src/tw-components/Dialog.tsx @@ -28,7 +28,6 @@ function Dialog({ open = false, ...props }: DialogProps) { } }, [isBackdropOpen]); - useEffect(() => { if (open) { setIsBackdropOpen(true);