-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tooltip and chart styling fixes #535
base: main
Are you sure you want to change the base?
Conversation
…eterportal-client into Grade-Dist-Styling-Fixes
@@ -70,61 +70,46 @@ export default class Chart extends React.Component<ChartProps> { | |||
id: 'A', | |||
label: 'A', | |||
A: gradeACount, | |||
color: '#2484C6', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing colors[0]
Although ideally, we use a typescript enum to name the colors instead of just putting them in a list.
export enum GradeColors {
A = '#2484C6',
B = '#54B058',
// ...
}
// or Blue = '#2484C6', Green = '#54B058', ...
color: GradeColors.A // or color: GradeColors.Blue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as previous about considering an enum instead of a hard-coded list
@@ -72,7 +72,7 @@ const PrereqTreeNode: FC<TreeProps> = (props) => { | |||
} | |||
content={ | |||
props.prerequisiteNames[ | |||
prereq.prereqType === 'course' ? prereq.courseId.replace(/ /g, '') : (prereq.examName ?? '') | |||
prereq.prereqType === 'course' ? prereq.courseId.replace(/ /g, '') : prereq.examName ?? '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while this is correct, the precedence of ? :
over ??
is not obvious to everyone, so I think this is a change that should be reverted
(unless that was a prettier auto-format)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there's still a diff here since the newline at the end was deleted. We should add it back
Tooltip and chart styling fixes
Description
Moved color constants and tooltip dimensions/styling to separate files and made dimensions the same.
Screenshots
Before
After
Steps to verify/test this change:
Final Checks:
(optional)
Issues
Closes #