refactor: remove light/dark props from Card #41
Labels
No labels
first-task
needs/docs
needs/research
needs/upstream
type/bug
type/external
type/feature
type/refactor
urgency
high
urgency
immediate
urgency
low
urgency
medium
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Depends on
#40 Redundant colors in Card component
ScottyLabs/study
Reference
ScottyLabs/study!41
Loading…
Reference in a new issue
No description provided.
Delete branch "remove-light-dark-props"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The props for card currently contain the "lightColor" and "darkColorProp" which is then used to determine the color of the component. The client calls in the different value depending on whether the card is selected or not. In the components itself, the value are also parsed into selected or not again. We could easily just used selected: boolean as prop instead of putting different prop; this still behave the same.
I understand that future feature might be able to make use of the colorprop but this is what works better at the moment
Related Issue
Closes #40
Type of change
Testing
Screenshots/Recordings
Checklist
eea657e0fefb9880c18cI just added a PR template to the repo. In the future, it will automatically populate new PRs. Since this PR was made before the template existed, please just edit the description, copy the following template into it, and fill in the template:
## Description ## Related Issue Closes # ## Type of change - [ ] Bug fix - [ ] New feature - [ ] Refactor / code improvement - [ ] Test coverage - [ ] Documentation ## Testing - [ ] I added/updated tests. - [ ] I tested my changes locally. - [ ] I tested my changes with a laptop-size screen. - [ ] I tested my changes with a phone-size screen. - [ ] I tested my changes with a tablet-size screen. - [ ] I tested on the dev app (dev.cmustudy.com) ## Screenshots/Recordings ## Checklist - [ ] My code follows the project's existing style. - [ ] I have reviewed my changes. - [ ] Only the necessary files and lines have been changed. - [ ] This PR is ready for review.Can you link the issue in the description and add an explanation to the description of what you did and why, so we can understand the reason behind the changes/why you solved the issue this way?
@annadavi I have explained more in the desc and like the issue.
Can you also add UI tests that verify the colors in light/dark mode and selected/not, just to build up the tests as we implement?
I'm not sure how to implement a test for this kind of component
Take a look at the existing tests (and maybe tests added on other open PRs) and do some research on UI testing with Vitest, which is what we use for our tests. Basically, just add tests to confirm it looks as you expect (colors are correct for light/dark mode and selected vs not, so just 4 cases). This is mostly just to give you practice writing tests for your PRs, even if it seems a little silly on a small change like this!
@annadavi I have added the test to check for cards props. It check for the class.