-
Notifications
You must be signed in to change notification settings - Fork 710
feat(webapp): Make <CollapseBox /> component #1474
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
Conversation
size-limit report 📦
|
Codecov Report
@@ Coverage Diff @@
## main #1474 +/- ##
==========================================
+ Coverage 68.66% 68.66% +0.01%
==========================================
Files 131 131
Lines 4316 4342 +26
Branches 1166 1175 +9
==========================================
+ Hits 2963 2981 +18
- Misses 1347 1355 +8
Partials 6 6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
/create-server |
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 good!
Few thoughts:
-
Would be nice to have a storybook example since this is effectively a new, reusable component. This is so that new devs can refer to this "library of components"
-
Behaviour is weird when title is empty:
https://user-images.githubusercontent.com/6951209/189142078-7e9999dc-9881-4aa1-9dfa-7742c83b3e39.mp4
- if a title MUST not be empty, then we should add least document this invariant
- also if we are supporting empty title, chevron should always be on the right, this is so that the user can immediately develop familiarity (if i know one
CollapsibleBoxthen I know all of them)
- Another thing I have strong opinions is to ALWAYS show the chevron. Reason is for discoverability. I want to be able to figure out what the component does immediately, I shouldn't need to hover. Specially because not all people interact with a hover. (yeah i know, we also have tooltips, but still)
| </div> | ||
| </Box> | ||
| <Box> | ||
| <CollapseBox title={`${appName.unwrapOr('')} Descriptive Statistics`}> |
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.
When appName is empty, this renders
Descriptive Statistics
Notice the space at the beginning.
| <CollapseBox title={`${appName.unwrapOr('')} Descriptive Statistics`}> | |
| <CollapseBox | |
| title={`${appName | |
| .map((a) => `${a} Descriptive Statistics`) | |
| .unwrapOr('')}`} | |
| > |
Map only runs if it's a Just, ie. there's an appName defined.
|
updated! @eh-am |
Brief
Changes
https://user-images.githubusercontent.com/7372044/189065862-f43c2f4e-bc53-488f-98ff-fb8259c3e2f9.mp4