OBPIH-6101 Create a reusable Switch component#4492
Merged
awalkowiak merged 4 commits intofeature/product-supplier-list-redesignfrom Feb 7, 2024
Merged
OBPIH-6101 Create a reusable Switch component#4492awalkowiak merged 4 commits intofeature/product-supplier-list-redesignfrom
awalkowiak merged 4 commits intofeature/product-supplier-list-redesignfrom
Conversation
awalkowiak
requested changes
Feb 6, 2024
| }; | ||
|
|
||
| return ( | ||
| <div id="switch-container"> |
Collaborator
There was a problem hiding this comment.
Why you are using id here? What if there are going to be multiple switch fields on the form for some usecase?
| <div id="switch-container"> | ||
| <label htmlFor="toggle" className="switch"> | ||
| <input | ||
| id="toggle" |
Collaborator
There was a problem hiding this comment.
I feel like this could use some sort of additional part of id passed in props 🤔
kchelstowski
reviewed
Feb 6, 2024
|
|
||
| import './style.scss'; | ||
|
|
||
| const Switch = ({ defaultValue, titles, onChange }) => { |
Collaborator
There was a problem hiding this comment.
this should be ready to receive the ...field prop from the react-hook-form. I can't exactly say now what all the props will be, so for now let's at least add it as ...rest (let's name it as ...fieldProps).
13e7a52 to
2e4eea2
Compare
drodzewicz
approved these changes
Feb 6, 2024
dcf845a to
2c41af9
Compare
2c41af9 to
ba21930
Compare
kchelstowski
approved these changes
Feb 7, 2024
awalkowiak
approved these changes
Feb 7, 2024
awalkowiak
pushed a commit
that referenced
this pull request
Mar 12, 2024
* OBPIH-6101 Add images for slider * OBPIH-6101 Add switch component and styling * OBPIH-6101 Changes after reviews * OBPIH-6101 Add unique ids to toggles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.