diff --git a/apps/govquests-frontend/public/badges/track1.png b/apps/govquests-frontend/public/badges/track1.png new file mode 100644 index 0000000..7f826d6 Binary files /dev/null and b/apps/govquests-frontend/public/badges/track1.png differ diff --git a/apps/govquests-frontend/src/app/globals.css b/apps/govquests-frontend/src/app/globals.css index e61a5bb..786a982 100644 --- a/apps/govquests-frontend/src/app/globals.css +++ b/apps/govquests-frontend/src/app/globals.css @@ -57,8 +57,8 @@ --primary: 0 0% 100%; /* White */ --primary-foreground: 0 0% 0% /* Black text */; - --secondary: 228 9% 23%; /* Dark grey #333640 */ - --secondary-foreground: 0 0% 100%; + --secondary: 0 0% 82%; /* Dark grey 210 210 210 */ + --secondary-foreground: 0 0% 0%; --muted: 228 9% 23%; --muted-foreground: 0 0% 64%; diff --git a/apps/govquests-frontend/src/components/IndicatorPill.tsx b/apps/govquests-frontend/src/components/IndicatorPill.tsx index 09c3b2a..e02aeb2 100644 --- a/apps/govquests-frontend/src/components/IndicatorPill.tsx +++ b/apps/govquests-frontend/src/components/IndicatorPill.tsx @@ -6,7 +6,12 @@ export const IndicatorPill = ({ ...props }: ComponentProps<"span">) => { return ( -
+
= ({ quest }) => { const status = quest.userQuests?.[0]?.status || "unstarted"; - const disabled = status === "completed"; - - const peelClassName = - "bg-primary/50 text-white backdrop-blur-sm border border-primary/20"; + const isCompleted = status === "completed"; return ( - -
-
- {disabled ? ( - - Completed - - ) : ( - quest.rewardPools - .toReversed() - .map(({ rewardDefinition: reward }) => ( - - )) - )} -
- {quest.displayData.imageUrl ? ( - {`QuestCard - ) : ( -
- )} -
-
-

+
+
- {quest.displayData.title} -

-

- -

+
+ {quest.displayData.title} +
+ + {isCompleted + ? "Completed" + : quest.rewardPools[0].rewardDefinition.amount + " points"} + +
+
+

+ +

+
); diff --git a/apps/govquests-frontend/src/domains/questing/components/track/BadgeCard.tsx b/apps/govquests-frontend/src/domains/questing/components/track/BadgeCard.tsx index ae0f67f..c01c795 100644 --- a/apps/govquests-frontend/src/domains/questing/components/track/BadgeCard.tsx +++ b/apps/govquests-frontend/src/domains/questing/components/track/BadgeCard.tsx @@ -9,6 +9,7 @@ interface BadgeCardProps { } export const BadgeCard = ({ badge, isCompleted }: BadgeCardProps) => { + // TODO - Add badge image - OP-671 return (
diff --git a/apps/govquests-frontend/src/domains/questing/components/track/TrackAccordion.tsx b/apps/govquests-frontend/src/domains/questing/components/track/TrackAccordion.tsx index 0be0d60..4ec090e 100644 --- a/apps/govquests-frontend/src/domains/questing/components/track/TrackAccordion.tsx +++ b/apps/govquests-frontend/src/domains/questing/components/track/TrackAccordion.tsx @@ -10,18 +10,21 @@ import { TrackAccordionHeader } from "./TrackAccordionHeader"; import { TrackDescription } from "./TrackDescription"; export const TrackAccordion = ({ track }: { track: Tracks[number] }) => { + const isCompleted = track.quests + .map((quest) => quest.userQuests[0]?.status) + .every((status) => status === "completed"); return ( - + - + diff --git a/apps/govquests-frontend/src/domains/questing/components/track/TrackAccordionHeader.tsx b/apps/govquests-frontend/src/domains/questing/components/track/TrackAccordionHeader.tsx index 3e7aeef..0e39518 100644 --- a/apps/govquests-frontend/src/domains/questing/components/track/TrackAccordionHeader.tsx +++ b/apps/govquests-frontend/src/domains/questing/components/track/TrackAccordionHeader.tsx @@ -3,9 +3,13 @@ import { Tracks } from "../../types/trackTypes"; interface TrackAccordionHeader { track: Tracks[number]; + isCompleted: boolean; } -export const TrackAccordionHeader = ({ track }: TrackAccordionHeader) => { +export const TrackAccordionHeader = ({ + track, + isCompleted, +}: TrackAccordionHeader) => { return (

@@ -13,7 +17,9 @@ export const TrackAccordionHeader = ({ track }: TrackAccordionHeader) => {

{track.quests.length} quests - {track.points} points + + {isCompleted ? "Completed" : track.points + " points"} +
); diff --git a/apps/govquests-frontend/src/domains/questing/components/track/TrackDescription.tsx b/apps/govquests-frontend/src/domains/questing/components/track/TrackDescription.tsx index 683c259..22e61c4 100644 --- a/apps/govquests-frontend/src/domains/questing/components/track/TrackDescription.tsx +++ b/apps/govquests-frontend/src/domains/questing/components/track/TrackDescription.tsx @@ -1,7 +1,15 @@ import { BadgeCard } from "./BadgeCard"; import { Tracks } from "../../types/trackTypes"; -export const TrackDescription = ({ track }: { track: Tracks[number] }) => { +interface TrackDescriptionProps { + track: Tracks[number]; + isCompleted: boolean; +} + +export const TrackDescription = ({ + track, + isCompleted, +}: TrackDescriptionProps) => { const badge = { id: "1", image: "/badge/track1.png", title: "Track Badge" }; return ( @@ -14,8 +22,15 @@ export const TrackDescription = ({ track }: { track: Tracks[number] }) => {
- -
{track.displayData.description}
+ +
+ {track.displayData.description} + + {isCompleted + ? `Track completed — ${badge.title} unlocked. ` + : "Complete all quests to Unlock this Track Badge."} + +
); diff --git a/apps/govquests-frontend/src/domains/questing/components/track/TrackList.tsx b/apps/govquests-frontend/src/domains/questing/components/track/TrackList.tsx index b210ee8..bdf3a9a 100644 --- a/apps/govquests-frontend/src/domains/questing/components/track/TrackList.tsx +++ b/apps/govquests-frontend/src/domains/questing/components/track/TrackList.tsx @@ -8,8 +8,8 @@ export const TrackList = () => { data && (
-

# Tracks

-

+

# Tracks

+

Complete quests to earn points and unlock rewards.

diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7f2aa57..aa50e8a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1331,8 +1331,8 @@ packages: integrity: sha512-b1oh54x4DMCdGsB4/7ahiSrViXxaBwRPotiZNnYXjLha9vfuURSAZErki6qjDoSIV0eXx5v57XnTGVtGwnfp2g==, } peerDependencies: - "@types/react": "*" - "@types/react-dom": "*" + "@types/react": npm:types-react@19.0.0-rc.1 + "@types/react-dom": npm:types-react-dom@19.0.0-rc.1 react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: @@ -1395,7 +1395,7 @@ packages: integrity: sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==, } peerDependencies: - "@types/react": "*" + "@types/react": npm:types-react@19.0.0-rc.1 react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: "@types/react": @@ -1431,8 +1431,8 @@ packages: integrity: sha512-onrWn/72lQoEucDmJnr8uczSNTujT0vJnA/X5+3AkChVPowr8n1yvIKIabhWyMQeMvvmdpsvcyDqx3X1LEXCPg==, } peerDependencies: - "@types/react": "*" - "@types/react-dom": "*" + "@types/react": npm:types-react@19.0.0-rc.1 + "@types/react-dom": npm:types-react-dom@19.0.0-rc.1 react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: @@ -1459,8 +1459,8 @@ packages: integrity: sha512-01omzJAYRxXdG2/he/+xy+c8a8gCydoQ1yOxnWNcRhrrBW5W+RQJ22EK1SaO8tb3WoUsuEw7mJjBozPzihDFjA==, } peerDependencies: - "@types/react": "*" - "@types/react-dom": "*" + "@types/react": npm:types-react@19.0.0-rc.1 + "@types/react-dom": npm:types-react-dom@19.0.0-rc.1 react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: @@ -1511,8 +1511,8 @@ packages: integrity: sha512-3kn5Me69L+jv82EKRuQCXdYyf1DqHwD2U/sxoNgBGCB7K9TRc3bQamQ+5EPM9EvyPdli0W41sROd+ZU1dTCztw==, } peerDependencies: - "@types/react": "*" - "@types/react-dom": "*" + "@types/react": npm:types-react@19.0.0-rc.1 + "@types/react-dom": npm:types-react-dom@19.0.0-rc.1 react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: @@ -1527,8 +1527,8 @@ packages: integrity: sha512-NciRqhXnGojhT93RPyDaMPfLH3ZSl4jjIFbZQ1b/vxvZEdHsBZ49wP9w8L3HzUQwep01LcWtkUvm0OVB5JAHTw==, } peerDependencies: - "@types/react": "*" - "@types/react-dom": "*" + "@types/react": npm:types-react@19.0.0-rc.1 + "@types/react-dom": npm:types-react-dom@19.0.0-rc.1 react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: @@ -1543,8 +1543,8 @@ packages: integrity: sha512-18TFr80t5EVgL9x1SwF/YGtfG+l0BS0PRAlCWBDoBEiDQjeKgnNZRVJp/oVBl24sr3Gbfwc/Qpj4OcWTQMsAEg==, } peerDependencies: - "@types/react": "*" - "@types/react-dom": "*" + "@types/react": npm:types-react@19.0.0-rc.1 + "@types/react-dom": npm:types-react-dom@19.0.0-rc.1 react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: @@ -1559,8 +1559,8 @@ packages: integrity: sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==, } peerDependencies: - "@types/react": "*" - "@types/react-dom": "*" + "@types/react": npm:types-react@19.0.0-rc.1 + "@types/react-dom": npm:types-react-dom@19.0.0-rc.1 react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: @@ -1691,8 +1691,8 @@ packages: integrity: sha512-vVfA2IZ9q/J+gEamvj761Oq1FpWgCDaNOOIfbPVp2MVPLEomUr5+Vf7kJGwQ24YxZSlQVar7Bes8kyTo5Dshpg==, } peerDependencies: - "@types/react": "*" - "@types/react-dom": "*" + "@types/react": npm:types-react@19.0.0-rc.1 + "@types/react-dom": npm:types-react-dom@19.0.0-rc.1 react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: @@ -6267,6 +6267,12 @@ packages: integrity: sha512-u7IEgvEgACYFDGtaqBgh5tqtYxkfPgtE7sl3RjfsT4QTpRM9FADXoWomFYZVi55Upii3LUcaZYrKFyHqUTHpew==, } + types-react@19.0.0-rc.1: + resolution: + { + integrity: sha512-RshndUfqTW6K3STLPis8BtAYCGOkMbtvYsi90gmVNDZBXUyUc5juf2PE9LfS/JmOlUIRO8cWTS/1MTnmhjDqyQ==, + } + typescript@5.7.2: resolution: { @@ -10948,12 +10954,16 @@ snapshots: types-react-dom@19.0.0-rc.1: dependencies: - "@types/react": 19.0.3 + "@types/react": types-react@19.0.0-rc.1 types-react@19.0.0-alpha.3: dependencies: csstype: 3.1.3 + types-react@19.0.0-rc.1: + dependencies: + csstype: 3.1.3 + typescript@5.7.2: {} ufo@1.5.4: {}