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

feat(PPDSC-2179): switch stories #212

Merged
merged 6 commits into from
May 30, 2022
Merged

Conversation

mstuartf
Copy link
Contributor

PPDSC-2179

What

  1. Background - changes to Switch storybook scenarios requested by design + slight refactoring
  2. What did you do
  • Simplified typing of Switch component and made sure checked prop passed down to icons (and added test)
  • Added dynamic icon scenario to Storybook
  • Visual changes to other Storybook scenarios

I have done:

  • Written unit tests against changes
  • Written functional tests against the component and/or NewsKit site
  • Updated relevant documentation

I have tested manually:

  • The feature's functionality is working as expected on Chrome, Firefox, Safari and Edge
  • The screen reader reads and flows through the elements as expected.
  • There are no new errors in the browser console coming from this PR.
  • When visual test is not added, it renders correctly on different browsers and mobile viewports (Safari, Firefox, small mobile viewport, tablet)
  • The Playground feature is working as expected

mstuartf added 2 commits May 26, 2022 16:06
- Add dynamic thumb icon Switch scenario to Storybook
- Pass checked prop down to ThumbIcon and add test
- Refactor types for Switch component to simplify
- Increase thumb size and remove track icons for narrow track scenario
- Remove thumb and feedback transitions for reduced motion scenario
@github-actions github-actions bot added the feature This change contains a new feature label May 26, 2022
@newskit-engineering
Copy link
Collaborator

baburay23
baburay23 previously approved these changes May 27, 2022
Copy link
Contributor

@baburay23 baburay23 left a comment

Choose a reason for hiding this comment

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

looks good to me.

Copy link
Contributor

@Xin00163 Xin00163 left a comment

Choose a reason for hiding this comment

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

Just one comment about the reduced motion. The rest looks good.
I noticed a comment "// TODO: Contains similar logic to getComponentOverrides to cast the override icon as a component. But why is this necessary?" Is there anything we need to do?

@mstuartf
Copy link
Contributor Author

Just one comment about the reduced motion. The rest looks good. I noticed a comment "// TODO: Contains similar logic to getComponentOverrides to cast the override icon as a component. But why is this necessary?" Is there anything we need to do?

@Xin00163 I've removed this comment.

Xin00163
Xin00163 previously approved these changes May 27, 2022
@mstuartf mstuartf added the ready for review Please assist in getting this reviewed label May 27, 2022
@baburay23 baburay23 self-requested a review May 27, 2022 14:58
baburay23
baburay23 previously approved these changes May 27, 2022
- When overrides.icon is set as a style override, this object is passed to the CheckIcon component through the overrides prop
- Renaming parentOverrides to overrides meant that this value was overwritten
- Reverted back to parentOverrides and added a test to prevent future regressions
@mstuartf mstuartf dismissed stale reviews from baburay23 and Xin00163 via 781f937 May 27, 2022 17:11
@baburay23 baburay23 self-requested a review May 30, 2022 08:30
@mstuartf mstuartf merged commit 1df680a into main May 30, 2022
@mstuartf mstuartf deleted the feat/PPDSC-2179-switch-stories branch May 30, 2022 11:01
Xin00163 pushed a commit that referenced this pull request Oct 17, 2022
* feat(PPDSC-2179): use dynamic icon in switch story

- Add dynamic thumb icon Switch scenario to Storybook
- Pass checked prop down to ThumbIcon and add test
- Refactor types for Switch component to simplify

* feat(PPDSC-2179): final storybook changes

- Increase thumb size and remove track icons for narrow track scenario
- Remove thumb and feedback transitions for reduced motion scenario

* feat(PPDSC-2179): pr comments

* feat(PPDSC-2179): fix override bug

- When overrides.icon is set as a style override, this object is passed to the CheckIcon component through the overrides prop
- Renaming parentOverrides to overrides meant that this value was overwritten
- Reverted back to parentOverrides and added a test to prevent future regressions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This change contains a new feature ready for review Please assist in getting this reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants