-
Notifications
You must be signed in to change notification settings - Fork 323
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
allow choosing of no color #4008
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@kaze-droid is attempting to deploy a commit to the modsbot's projects Team on Vercel. A member of the Team first needs to authorize it. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4008 +/- ##
==========================================
+ Coverage 54.52% 54.90% +0.38%
==========================================
Files 274 276 +2
Lines 6076 6327 +251
Branches 1455 1548 +93
==========================================
+ Hits 3313 3474 +161
- Misses 2763 2853 +90 ☔ View full report in Codecov by Sentry. |
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.
Thanks for the updates! Looks great just have a few comments for minor aesthetic and quality improvements
@@ -51,7 +51,7 @@ const ColorPicker = memo<Props>((props) => { | |||
className={classnames(styles.palette, { [styles.isClosed]: !isOpen })} | |||
{...getMenuProps()} | |||
> | |||
{_.range(NUM_DIFFERENT_COLORS).map((index: ColorIndex) => ( | |||
{_.range(TOTAL_COLORS).map((index: ColorIndex) => ( |
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.
Suggestion: Since the 8 colors currently form a 4x2 grid, the 9th cell makes it look kinda strange. Should we try to make the current color change to transparent color on click (e.g. if the current course color is blue, clicking on the originally blue cell should disable the color?)
website/src/utils/colors.ts
Outdated
@@ -5,8 +5,12 @@ import { ColorMapping } from 'types/reducers'; | |||
import { ModuleCode } from 'types/modules'; | |||
|
|||
export const NUM_DIFFERENT_COLORS = 8; | |||
export const TRANSPARENT_COLOR_INDEX = NUM_DIFFERENT_COLORS; |
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.
Interestingly, -1
as a color index also appears to force transparent colors. Would this complicate the code less? If so, is that a better alternative than to create the relevant additional scss code?
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.
That makes sense. I've adjusted the color index to use -1 but kept the additional scss code (renamed to transparentColor) so that the button opening the colorPicker is not completely transparent
Context
Resolves #3999
Implementation
Provides an additional option of no color for the color picker by introducing an additional
colorIndex
for transparent cells