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

Feature: APP-2700 - Switch component #59

Merged
merged 10 commits into from
Jan 11, 2024
Merged

Conversation

Fabricevladimir
Copy link
Contributor

@Fabricevladimir Fabricevladimir commented Jan 8, 2024

Description

  • Implements the Switch component

Task: APP-2700

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran all tests with success and extended them if necessary.
  • I have updated the CHANGELOG.md file in the root folder of the package after the [UPCOMING] title and before
    the latest version.
  • I have tested my code on the test network.

@Fabricevladimir Fabricevladimir changed the title WIP - Feature: APP-2700 - InputSwitch component WIP - Feature: APP-2700 - Switch component Jan 8, 2024
@Fabricevladimir Fabricevladimir changed the title WIP - Feature: APP-2700 - Switch component Feature: APP-2700 - Switch component Jan 10, 2024
@Fabricevladimir Fabricevladimir force-pushed the f/app-2700-input-switch branch from 8c34515 to f792653 Compare January 10, 2024 10:23
@Fabricevladimir Fabricevladimir marked this pull request as ready for review January 10, 2024 10:25
@Fabricevladimir
Copy link
Contributor Author

@RuggeroCino, noticed we've got a few components that can be either controlled or uncontrolled, this Switch included. I propose we add some sort of warning mechanism so that we can provide proper warnings when the change handler function is missing or a component switches from controlled<=>uncontrolled. It's not a priority right now, but I think it's a definite nice to have.

Here's an interesting library that tries to mirror what Facebook does with react: https://www.npmjs.com/package/warning.

Copy link
Member

@cgero-eth cgero-eth left a comment

Choose a reason for hiding this comment

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

Well done @Fabricevladimir 👏🏻 Left some small comments

src/components/switch/switch.tsx Outdated Show resolved Hide resolved
src/components/switch/switch.stories.tsx Outdated Show resolved Hide resolved
src/components/switch/switch.test.tsx Outdated Show resolved Hide resolved
Copy link
Member

@cgero-eth cgero-eth left a comment

Choose a reason for hiding this comment

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

👏🏻 👏🏻 👏🏻

@Fabricevladimir Fabricevladimir merged commit ef99408 into main Jan 11, 2024
5 checks passed
@Fabricevladimir Fabricevladimir deleted the f/app-2700-input-switch branch January 11, 2024 11:50
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.

2 participants