Skip to content

Commit baadf84

Browse files
Updated profile elements
Changed the colors and spacing of a few elements on the profile to assist with readability.
1 parent 67829e7 commit baadf84

11 files changed

Lines changed: 33 additions & 31 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Please note that this repository contains future designs and ideas, so they will
1414
- Add in the next and prev buttons on the bottom left of the learning path detail page for navigating between modules. (In Progress)
1515
- ~~Add in a placeholder flag that allows us to test the challenge and learning path completion.~~
1616
- ~~Add in the challenge completion and learning path completion pages/modals.~~
17-
- Fix the BadgeSVG component—it does not show the symbols that should appear inside of the badge at the moment.
17+
- Fix the BadgeSVG component—it does not show the symbols that should appear inside of the badge at the moment. (In Progress - need feedback on inner text convention)
1818
- Fix the sorting in the EventCard modal—it does not show and hide events in the modal according to the selected tags.
1919
- Add the D3 library for graphs and update the Activity, Challenge Completion, and Skill Distribution widgets on the profile page.
2020
- Add Skeletons across the website for each page and subcomponent. Refer to the BadgesProfileDiv on the profile page and the assignment and classroom areas in the homepage.

frontend/react_app/src/api_interfaces/middleware/EventInfo.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import type { PublicTeam } from "../2023_generated_interfaces/team/publicTeam";
33
import type { EventRegistrationResponse } from "../event/eventRegistrationResponse";
44

55
export interface EventInfoMiddleware {
6+
completedChallenges: number;
67
scoreData: Score["score"]; //The participant's score during the event, get this from the ScoreProgression request
78
registrationData: EventRegistrationResponse; //Info about participant registration
89
teamData: PublicTeam; //Data for the team given the participant and event
10+
totalChallenges: number;
911
}

frontend/react_app/src/components/general/EventCard.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ const EventCard: React.FC<EventCard> = ({ event }) => {
2828
</div>
2929
<div className="flex flex-row gap-8">
3030
{event.has_opened && !event.has_ended ?
31-
<Chip color="success">Registration Open</Chip> : (null)
31+
<Chip className="flex w-fit h-fit h-fit bg-success-50 text-success-700 p-1">Registration Open</Chip> : (null)
32+
}
33+
{event.has_opened && !event.has_ended && event.registered ?
34+
<Button size="md" radius="sm" className="bg-primary-500 text-default-50">Resume</Button> :
35+
event.has_opened && !event.has_ended ?
36+
<Button size="md" radius="sm" className="bg-primary-500 text-default-50">Register</Button> : (null)
3237
}
33-
<Button size="md" radius="sm" color="primary">Resume</Button>
3438
</div>
3539
</div>
3640
</CardHeader>
@@ -64,9 +68,9 @@ const EventCard: React.FC<EventCard> = ({ event }) => {
6468
</div>
6569
<div className="flex flex-row gap-8">
6670
{event.has_opened && !event.has_ended ?
67-
<Chip color="success" className="">Registration Open</Chip> : (null)
71+
<Chip className="flex w-fit h-fit bg-success-50 text-success-700 p-1">Registration Open</Chip> : (null)
6872
}
69-
<Button size="md" radius="sm" color="primary">Resume</Button>
73+
<Button size="md" radius="sm" className="bg-primary-500 text-default-50">Resume</Button>
7074
</div>
7175
</div>
7276
</CardHeader>
@@ -108,11 +112,11 @@ const EventCard: React.FC<EventCard> = ({ event }) => {
108112
<p className="text-default-500">Individual Score</p>
109113
</div>
110114
<div className="flex flex-col">
111-
<h3 className="font-semibold font-sans">NumChallenges/totalChallenges</h3>
115+
<h3 className="font-semibold font-sans">{info.completedChallenges + "/" + info.totalChallenges}</h3>
112116
<p className="text-default-500">Challenges</p>
113117
</div>
114118
</div>
115-
<Button size="md" radius="sm" color="primary">Resume</Button>
119+
<Button size="md" radius="sm" className="bg-primary-500 text-default-50">Resume</Button>
116120
</CardHeader>
117121
<CardBody className="flex flex-row flex-wrap w-full max-w-full h-fit p-0 m-0 gap-6">
118122
{info.teamData.members.map(

frontend/react_app/src/components/general/LearningPathCard.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ function getBottomContent(hasProgress: boolean, numCompletedChallenges: number,
4444
}
4545

4646
const LearningPathCard: React.FC<LearningPathCardProps> = ({ completed, description, difficulty, hasProgress, id, name, numCompletedChallenges, numSolves, numTotalChallenges, variant }) => {
47-
48-
if(id !== null) {
49-
50-
}
51-
47+
5248
const navigate = useNavigate();
5349

5450
//Return a variant if that was specified

frontend/react_app/src/components/profile/BadgesProfileCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const BadgeModal: React.FC<BadgeModalProps> = ({badges, selectedBadges, numUnloc
5252

5353
return (
5454
<>
55-
<Button variant="bordered" color="primary" onPress={onOpen}>See more...</Button>
55+
<Button variant="bordered" className="border-primary-500 text-primary-500" onPress={onOpen}>See more...</Button>
5656
<Modal isOpen={isOpen} onOpenChange={onOpenChange} size="5xl">
5757
<ModalContent>
5858
{() => (

frontend/react_app/src/components/profile/EventProfileCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const EventModal: React.FC<EventModalProps> = ({ list }) => {
9494

9595
return (
9696
<>
97-
<Button variant="bordered" color="primary" onPress={onOpen}>See more...</Button>
97+
<Button variant="bordered" className="border-primary-500 text-primary-500" onPress={onOpen}>See more...</Button>
9898
<Modal isOpen={isOpen} onOpenChange={onOpenChange} size="5xl" className="flex flex-col h-fit">
9999
<ModalContent>
100100
{() => (

frontend/react_app/src/components/profile/LearningPathsProfileCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const LearningPathsProfileCard: React.FC<{}> = () => {
1010
<Card className="flex w-full min-w-fit h-fit min-h-fit max-h-fit bg-content1-base border-small border-default-300" radius="md" shadow="none">
1111
<CardBody className="flex flex-col w-full h-fit gap-6 p-6">
1212
<h2>Learning Paths</h2>
13-
<LearningPathCard description={"Test"} difficulty={{difficultyLvl: "Easy"}} hasProgress={true} id={0} link={""} name={"Learning Path 1"} numCompletedChallenges={2} numSolves={143} numTotalChallenges={8} variant={"compact"}/>
14-
<LearningPathCard description={"Test"} difficulty={{difficultyLvl: "Easy"}} hasProgress={true} id={1} link={""} name={"Learning Path 2"} numCompletedChallenges={4} numSolves={143} numTotalChallenges={8} variant={"compact"}/>
13+
<LearningPathCard description={"Test"} difficulty={{ difficultyLvl: "Easy" }} hasProgress={true} id={0} link={""} name={"Learning Path 1"} numCompletedChallenges={2} numSolves={143} numTotalChallenges={8} variant={"compact"} completed={false}/>
14+
<LearningPathCard description={"Test"} difficulty={{ difficultyLvl: "Easy" }} hasProgress={true} id={1} link={""} name={"Learning Path 2"} numCompletedChallenges={4} numSolves={143} numTotalChallenges={8} variant={"compact"} completed={false}/>
1515
<Link href="/practice/learning-paths" style={{textAlign: "right"}}>See more</Link>
1616
</CardBody>
1717
</Card>

frontend/react_app/src/components/profile/SkillDistributionProfileCard.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,20 @@ const SkillDistributionProfileCard: React.FC<SkillDistributionProfileCardProps>
7878
<CardBody className="flex flex-col w-full min-w-fit h-full min-h-fit p-0 m-0 gap-8">
7979
<h2>Skill Distribution</h2>
8080
<div className="flex flex-col w-full h-full min-w-fit min-h-fit justify-center items-center overflow-auto">
81-
<div className="flex flex-col w-full h-fit">
81+
<div className="flex flex-col w-full h-fit justify-center">
8282
<div className="flex flex-row w-full min-w-fit h-fit gap-1 justify-center items-center">
8383
<p>Web Exploitation</p>
84-
<Icon icon={"material-symbols:language"} width={16} height={16} className={"text-primary"}/>
84+
<Icon icon={"material-symbols:language"} width={16} height={16} className={"text-primary-500"}/>
8585
</div>
86-
<div className="flex flex-row w-fit h-fit min-h-fit max-w-full">
86+
<div className="flex flex-row w-full h-fit min-h-fit max-w-full justify-center">
8787
<div style={{paddingTop: columnPadding, paddingBottom: columnPadding}} className={"flex flex-col w-fit min-w-fit justify-between items-end"}>
8888
<div className="flex flex-row w-fit h-fit gap-1 items-center">
8989
<p>General Skills</p>
90-
<Icon icon={"material-symbols:code"} width={16} height={16} className={"text-primary"}/>
90+
<Icon icon={"material-symbols:code"} width={16} height={16} className={"text-primary-500"}/>
9191
</div>
9292
<div className="flex flex-row w-fit h-fit gap-1 items-center">
9393
<p>Reverse Engineering</p>
94-
<Icon icon={"material-symbols:build-outline"} width={16} height={16} className={"text-primary"}/>
94+
<Icon icon={"material-symbols:build-outline"} width={16} height={16} className={"text-primary-500"}/>
9595
</div>
9696
</div>
9797
<svg className="flex inset-0" xmlns="http://www.w3.org/2000/svg" width={svgSize} height={svgSize} viewBox={"0 0 " + (svgSize+2) + " " + (svgSize+2)} fill="none">
@@ -110,17 +110,17 @@ const SkillDistributionProfileCard: React.FC<SkillDistributionProfileCardProps>
110110
<div style={{paddingTop: columnPadding, paddingBottom: columnPadding}} className={"flex flex-col w-fit min-w-fit h-fill justify-between items-start"}>
111111
<div className="flex flex-row w-fit h-fit gap-1 items-center">
112112
<p>Cryptography</p>
113-
<Icon icon={"material-symbols:key-outline"} width={16} height={16} className={"text-primary"}/>
113+
<Icon icon={"material-symbols:key-outline"} width={16} height={16} className={"text-primary-500"}/>
114114
</div>
115115
<div className="flex flex-row w-fit h-fit gap-1 items-center">
116116
<p>Binary Exploitation</p>
117-
<Icon icon={"material-symbols:memory-outline"} width={16} height={16} className={"text-primary"}/>
117+
<Icon icon={"material-symbols:memory-outline"} width={16} height={16} className={"text-primary-500"}/>
118118
</div>
119119
</div>
120120
</div>
121121
<div className="flex flex-row w-full min-w-fit h-fit gap-1 justify-center items-center">
122122
<p>Forensics</p>
123-
<Icon icon={"material-symbols:search"} width={16} height={16} className={"text-primary"}/>
123+
<Icon icon={"material-symbols:search"} width={16} height={16} className={"text-primary-500"}/>
124124
</div>
125125
</div>
126126
</div>

frontend/react_app/src/components/profile/UserProfileCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const UserProfileCard: React.FC<UserProfileCardProps> = ({ avatar, country, mont
3131
</div>
3232
<p>{"Joined " + monthJoined + ", " + yearJoined}</p>
3333
</div>
34-
<Button variant="flat" color="primary">
34+
<Button variant="flat" className="bg-primary-50">
3535
<p>Account settings</p>
3636
<Icon icon={"material-symbols:settings-outline"} width={24} height={24} className="text-primary-500"/>
3737
</Button>

frontend/react_app/src/components/profile/UserStudiesCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ const UserStudiesCard: React.FC<{}> = () => {
3939
</Accordion>
4040
</CardBody>
4141
<CardFooter className="flex gap-8 p-0 m-0">
42-
<Button color="primary" size="lg" radius="sm">Provide Consent</Button>
43-
<Link className="flex px-6 h-full" href="/practice/learning-paths">Full Terms</Link>
42+
<Button className="bg-primary-500 text-default-50" size="lg" radius="sm">Provide Consent</Button>
43+
<Link className="flex px-6 h-full text-primary-500" href="/practice/learning-paths">Full Terms</Link>
4444
</CardFooter>
4545
</Card>
4646
);

0 commit comments

Comments
 (0)