-
Notifications
You must be signed in to change notification settings - Fork 324
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
feat: Enable flexible number of colors for themes #3482
Open
joeng03
wants to merge
19
commits into
nusmodifications:master
Choose a base branch
from
joeng03:joeng03/support-flexible-num-of-colors-in-theme
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f77edcf
feat: Enable flexible number of colors for themes
joeng03 b0392c7
fix: venue timetable renders white color lessons
joeng03 c8f0b38
Merge branch 'master' into joeng03/support-flexible-num-of-colors-in-…
joeng03 8563458
fix: linting errors
joeng03 0888fe2
Merge branch 'joeng03/support-flexible-num-of-colors-in-theme' of htt…
joeng03 bf7e006
refactor: refactor test cases to reflect current code modifications
joeng03 aeafe7c
feat: add action reassignAllModulesColor to reassign the color of the…
joeng03 1885a5c
Merge branch 'master' of https://github.com/joeng03/nusmods into joen…
joeng03 ef26201
fix(SettingsContainer): eslint.no-shadow
joeng03 2c34989
Merge branch 'master' into joeng03/support-flexible-num-of-colors-in-…
joeng03 6ec7da5
Merge branch 'master' into joeng03/support-flexible-num-of-colors-in-…
joeng03 52b4a53
Merge branch 'master' into joeng03/support-flexible-num-of-colors-in-…
joeng03 b97aa26
fix: lint error
joeng03 7ec797f
Merge branch 'master' into joeng03/support-flexible-num-of-colors-in-…
zwliew cbb938b
Merge branch 'master' into joeng03/support-flexible-num-of-colors-in-…
zwliew a4304f4
refactor: address changes requested
joeng03 927e7c9
merge changes from master
joeng03 a7ac61e
Merge branch 'master' into joeng03/support-flexible-num-of-colors-in-…
joeng03 0699b0a
Merge branch 'master' into joeng03/support-flexible-num-of-colors-in-…
zwliew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,67 @@ | ||
[ | ||
{ | ||
"id": "ashes", | ||
"name": " Ashes" | ||
"name": " Ashes", | ||
"numOfColors": 8 | ||
}, | ||
{ | ||
"id": "chalk", | ||
"name": "Chalk" | ||
"name": "Chalk", | ||
"numOfColors": 8 | ||
}, | ||
{ | ||
"id": "eighties", | ||
"name": "Eighties" | ||
"name": "Eighties", | ||
"numOfColors": 8 | ||
}, | ||
{ | ||
"id": "google", | ||
"name": "Google" | ||
"name": "Google", | ||
"numOfColors": 8 | ||
}, | ||
{ | ||
"id": "mocha", | ||
"name": "Mocha" | ||
"name": "Mocha", | ||
"numOfColors": 8 | ||
}, | ||
{ | ||
"id": "monokai", | ||
"name": "Monokai" | ||
"name": "Monokai", | ||
"numOfColors": 8 | ||
}, | ||
{ | ||
"id": "ocean", | ||
"name": "Ocean" | ||
"name": "Ocean", | ||
"numOfColors": 8 | ||
}, | ||
{ | ||
"id": "oceanic-next", | ||
"name": "Oceanic Next" | ||
"name": "Oceanic Next", | ||
"numOfColors": 8 | ||
}, | ||
{ | ||
"id": "paraiso", | ||
"name": "Paraiso" | ||
"name": "Paraiso", | ||
"numOfColors": 8 | ||
}, | ||
{ | ||
"id": "railscasts", | ||
"name": "Railscasts" | ||
"name": "Railscasts", | ||
"numOfColors": 8 | ||
}, | ||
{ | ||
"id": "tequila", | ||
"name": "Tequila", | ||
"numOfColors": 10 | ||
}, | ||
{ | ||
"id": "tomorrow", | ||
"name": "Tomorrow" | ||
"name": "Tomorrow", | ||
"numOfColors": 8 | ||
}, | ||
{ | ||
"id": "twilight", | ||
"name": "Twilight" | ||
"name": "Twilight", | ||
"numOfColors": 8 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since this affects local storage schema, we should be more careful here. In the long run, I don't think we'll want to store
numOfColors
inThemeState
as it only contains user customizable data (i.e. current theme ID, should show title, orientation of timetable).Since
numOfColors
is a static property of a theme, instead of storing it in Redux, we should store it in a predefined readonly map like the one that you've defined inthemes.json
. This has the added benefit of you no longer having to passnumOfColors
around everywhere as you can just read it from the map.That said, if/when we add user-defined themes, they should be stored in Redux, but likely in a different place instead of
ThemeState
.