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

docs: add appearance control to toast story #894

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

seialkali
Copy link
Contributor

Description

This PR adds an appearance control to the Toaster story. Since the Toast story needs both the Toaster and Toast component, we had to add the Toaster component as a decorator in order to get the appearance control to work properly. However, it only works for the stories that have the Toast component(s) as a direct child/children of the Toaster component (or wrapped in a fragment). It does not work for the stories where there's maps or the Toast component is in an array.

Since the appearance control will only work on some of the stories, I've installed the @storybook/addon-controls package so that I can disable controls on the stories which the appearance control will not work.

Which issue(s) does this PR relate to?

Testing

Go to the Toaster story in story book and confirm that you can change the appearance control for Default, Description, and Multi Toast story. Also confirm that you can not use the controls for the rest of the stories.

Trade-offs

Screenshots

Checklist

  • This PR is associated with a JIRA and it is mentioned in the commit message footer ("Closes …")
  • Significant changes have been tested downstream to avoid breaking changes
  • This PR contains breaking changes and states in the commit message body ("BREAKING CHANGE: …")
  • I have reviewed the changes and provided detail to the sections above

@seialkali seialkali requested a review from a team as a code owner December 2, 2022 22:57
@github-actions
Copy link

github-actions bot commented Dec 2, 2022

Uffizzi Preview Environment deployment-8366

☁️ https://app.uffizzi.com//github.com/dcos-labs/ui-kit/pull/894

📄 View Application Logs etc.

What is Uffizzi? Learn more

Copy link
Contributor

@vacas5 vacas5 left a comment

Choose a reason for hiding this comment

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

looks like it works in the preview PR!

package.json Outdated Show resolved Hide resolved
.storybook/main.js Outdated Show resolved Hide resolved
@seialkali seialkali force-pushed the seialkali/docs/add-toast-appearance-control branch from 6666899 to b58da67 Compare December 5, 2022 16:25
Copy link
Collaborator

@nataliepina nataliepina left a comment

Choose a reason for hiding this comment

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

Nice very clean implementation. Glad you've introduced this pattern to disable controls for specific stories and we can use it elsewhere.

@seialkali seialkali force-pushed the seialkali/docs/add-toast-appearance-control branch 8 times, most recently from c63df4b to 9ada95c Compare December 6, 2022 12:03
@seialkali seialkali changed the base branch from main to seialkali/ci/playwright-install-fix December 6, 2022 12:07
@seialkali seialkali changed the base branch from seialkali/ci/playwright-install-fix to main December 6, 2022 12:08
@seialkali seialkali force-pushed the seialkali/docs/add-toast-appearance-control branch 2 times, most recently from 5155fa2 to a3aed4e Compare December 6, 2022 15:11
@seialkali seialkali force-pushed the seialkali/docs/add-toast-appearance-control branch from a3aed4e to f61ea92 Compare December 7, 2022 18:32
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

Uffizzi Preview deployment-8635 was deleted.

@seialkali seialkali merged commit 2e55425 into main Dec 7, 2022
@seialkali seialkali deleted the seialkali/docs/add-toast-appearance-control branch December 7, 2022 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants