-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Refactor addon-action to use glamorous #2275
Refactor addon-action to use glamorous #2275
Conversation
I'd prefer this: |
lib/components/src/form/button.js
Outdated
@@ -0,0 +1,10 @@ | |||
import glamorous from 'glamorous'; | |||
|
|||
export default glamorous.button({ |
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.
Let's set type="button"
here. By default buttons are type="submit"
, but it's never what we actually want.
With glamorous, you can do it like that:
glamorous.button({
<styles>
}).withProps({ type: 'button' })
Please run |
I have update the snapshot, but I do not know my classnames hashes have not the same that the one generated on the CI 😕 |
That's a bit weird. Please try to run |
I've run:
My snapshots are still the same 😕 |
What does |
That all my change have been commited:
I'm on slack if you want to give me a hand directly ✋ |
lib/components/src/form/button.js
Outdated
padding: '5px 10px', | ||
borderRadius: '4px', | ||
color: 'rgba(0, 0, 0, 0.5)', | ||
outline: 'none', |
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.
Let's either not remove it in a generic button, or provide something instead, using ':focus': {...styles}
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.
We could add some :hover
and :active
states as well
@ndelangen are you familiar with how glamor classNames are generated? Why can it be, for example, |
I've never experienced this.. Maybe Looks like one of the 2 is optimized and the other isn't. This is what I found: |
Yes, glamor will apply the label (which is the |
Codecov Report
@@ Coverage Diff @@
## master #2275 +/- ##
==========================================
+ Coverage 37.48% 37.54% +0.06%
==========================================
Files 434 428 -6
Lines 9389 9176 -213
Branches 908 890 -18
==========================================
- Hits 3519 3445 -74
+ Misses 5301 5192 -109
+ Partials 569 539 -30
Continue to review full report at Codecov.
|
# Conflicts: # addons/actions/package.json # examples/cra-kitchen-sink/src/stories/__snapshots__/addon-info.stories.storyshot # lib/components/src/index.js
lib/components/src/form/button.js
Outdated
background: 'rgba(255, 255, 255, 0.5)', | ||
padding: '5px 10px', | ||
borderRadius: '4px', | ||
color: 'rgba(0, 0, 0, 0.5)', |
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.
lib/components/src/form/button.js
Outdated
.button({ | ||
border: 'solid 1px rgba(0, 0, 0, 0.2)', | ||
background: 'rgba(255, 255, 255, 0.5)', | ||
padding: '5px 10px', |
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 assistance @kentcdodds! 👏 @Spy-Seth can you try finding out why it would appear your node is in production mode when running tests? |
It seems that @kentcdodds have made the good guess 👍
If I set it to @ndelangen: Now I'm able to take some times in the next days to apply the @Hypnosphi comments. Thanks everyone for you're help 👍 |
Actually, it should rather be |
@Spy-Seth anything you need to continue? |
Yeah: times 😅 Like all of us I was stuck on a live reload issue with the monorepo. I could not exactly remember the details sorry. I will have some time in the beginning of 2018. I will try to get back on it but I could not guaranty it. If someone want to take it and finish the move it's fine for me 👍 |
OK I think I'll pick it |
# Conflicts: # addons/actions/package.json # examples/cra-kitchen-sink/src/stories/__snapshots__/storybook-components.stories.storyshot # examples/cra-kitchen-sink/src/stories/storybook-components.stories.js
Ready for review |
Hey storybookers,
This PR is related to #2263
This commit convert the Action addon to glamourous and extract the
button
as a shared component.I don't known how you want to process:
This is my first PR in storybook so I'm probably forgetting somethings ;)