Component Switcher #169
Labels
No Label
Bug
Component
Config
Good First Issue
Low-Priority
Page
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: www/cs-2022-class-profile#169
Loading…
Reference in New Issue
No description provided.
Delete Branch "richardshuai/component-switcher"
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?
This is specifically for Issue #142.
Created a new PR for component switcher changes.
https://richardshuai-component-switcher-csc-class-pr-snedadah.k8s.csclub.cloud/samplePage/
@ -0,0 +23,4 @@
}
.btn:hover {
--button-color: #CA634D;
I think we should choose differnet colors for the hover vs selected states.
Also, if you go here: https://richardshuai-component-switcher-csc-class-pr-snedadah.k8s.csclub.cloud/playground/ you can see some of the different colors that we already have as variables, it might be better to reuse one of those if possible? (if none of them look good, thats totally fine to use a new one then!, but maybe try those as well!)
I chose the colors from the global theme. I can definitely change the hover to a different color. Let me know if I need to change the button colors too :)
@ -0,0 +34,4 @@
key={idx}
className={`${styles.btn} ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
selectedButton === buttonName && styles.selectedBtn
I'm not sure if this is exactly correct? Doesn't this just evalute to 'true' or false?
I think what you meant to do is
selectedButton === buttonName ? styles.selectedBtn : ""
Thats the ternary operator which is basically an inline if statment.
I think this expression works like
if (selectedButton === buttonName) styles.selectedBtn
in JSX. I will change to the ternary to make it more readble though!And you don't need the @ts-ignore anymore too!
On mobile, the buttons are very close together, and also the left most button is cutoff a bit.
With moving it outside of the intenral wrapper and also changing it to display inline:
Maybe thats one solution (not saying this is the best one, just one option maybe, though this has other issues)
@ -0,0 +31,4 @@
}
.btnContainer {
display: flex;
To fix the container issues, maybe a changing this to "display: inline" is better?
Not sure if this is the best solution, but it seems to work better.
Right I think inline definitely looks better. But I also tried block, and it works well too!
Please review the new commit, thank you :)
It should be displaying normally on mobile now.
Looks good to me, nice work!!
I just quickly changed the color to something I think looks better given our color scheme, and I also changed the px values to `calc(..rem/16) which is something we do which I can explain more later. Thanks for working on this!