Skip to content
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

Storybook: Adds FormToggle component #18085

Merged
merged 6 commits into from
Apr 17, 2020

Conversation

enejb
Copy link
Contributor

@enejb enejb commented Oct 23, 2019

Description

Adds FormToggle component to storybook

How has this been tested?

Run npm run design-system:dev and confirm component shows up under Form Toggle
Click on the toggle does it work as expected?

Screenshots

Screen Shot 2019-10-23 at 9 15 55 PM

Types of changes

Storybook

@enejb enejb changed the title Adds FormToggle component to storybook Storybook: Adds FormToggle component Oct 23, 2019
@ItsJonQ
Copy link

ItsJonQ commented Oct 24, 2019

@enejb Awesome! Thank you for creating this and helping out with Storybook!

It looks good to me 👍

@gziolo gziolo added Storybook Storybook and its stories for components [Feature] UI Components Impacts or related to the UI component system labels Oct 28, 2019
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enejb great work jumping into creating a story 🥇

I have a more general question in regards to using React hooks in the exports. I saw the same approach in the past and I see it in other PRs so I think we should clarify how we tackle it first.

packages/components/src/form-toggle/stories/index.js Outdated Show resolved Hide resolved
@mkaz
Copy link
Member

mkaz commented Oct 28, 2019

@ItsJonQ My only issue with the <Example/> export you showed is the View Code from the Docs tab isn't quite complete. If you view the source from the Story tab, its fine, so not the biggest deal.

Here's a screen shot of what it looks like in ScrollLock.

Screenshot from 2019-10-28 11-03-39

@ItsJonQ
Copy link

ItsJonQ commented Oct 28, 2019

@mkaz Oh dang! That's a bit of a bummer... :(

@enejb
Copy link
Contributor Author

enejb commented Oct 28, 2019

Thanks for the reviews!
Let me know if there is anything else that I missed.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for the refactor. Looks great now 💯

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing which I discovered while testing:

Screen Shot 2019-10-29 at 07 57 45

We should add the label and it can be integrated with knobs, see:

const title = text( 'children', 'WordPress' );

or
const label = text( 'Label', 'Is author' );

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a commit which formats file with Prettier.

Let's get it in and iterate. @enejb, thank you for doing your part :)

@gziolo gziolo merged commit 63f708a into WordPress:master Apr 17, 2020
@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Apr 17, 2020
@github-actions github-actions bot added this to the Gutenberg 8.0 milestone Apr 17, 2020
@enejb enejb deleted the add/FormToggle-story branch June 1, 2020 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository Storybook Storybook and its stories for components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants