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: switch component #74

Merged
merged 6 commits into from
Jan 17, 2024
Merged

feat: switch component #74

merged 6 commits into from
Jan 17, 2024

Conversation

ionutanin
Copy link
Contributor

Closes #51

Changes proposed in this pull request

  • add reusable switch component as per graphic design
  • add switch unit tests

@ionutanin ionutanin added the area: popup Improvements or additions to extension popup label Jan 16, 2024
@ionutanin ionutanin self-assigned this Jan 16, 2024
@ionutanin ionutanin changed the title create switch component and add unit tests Switch component Jan 16, 2024
@ionutanin ionutanin changed the title Switch component feat: switch component Jan 16, 2024
@raducristianpopa
Copy link
Member

raducristianpopa commented Jan 16, 2024

Extension builds preview

Name Link
Latest commit 717c7e4
Latest job logs Run #7545675234
BadgeDownload
BadgeDownload
BadgeDownload
BadgeDownload

src/components/switch.tsx Outdated Show resolved Hide resolved
src/components/switch.tsx Show resolved Hide resolved
src/components/switch.tsx Outdated Show resolved Hide resolved
) {
return (
<label>
<input ref={ref} type="checkbox" {...props} className="peer hidden" />
Copy link
Member

@raducristianpopa raducristianpopa Jan 16, 2024

Choose a reason for hiding this comment

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

If we add the hidden class, the element is not gonna be focusable. We need to set it's opacity to 0.

Suggested change
<input ref={ref} type="checkbox" {...props} className="peer hidden" />
<input ref={ref} type="checkbox" {...props} className="peer absolute opacity-0 -translate-x-[100%] pointer-events-none" />

ionutanin and others added 5 commits January 16, 2024 19:53
Co-authored-by: Radu-Cristian Popa <radu.popa@breakpointit.eu>
Co-authored-by: Radu-Cristian Popa <radu.popa@breakpointit.eu>
Co-authored-by: Radu-Cristian Popa <radu.popa@breakpointit.eu>
@ionutanin ionutanin merged commit fe4c099 into main Jan 17, 2024
9 checks passed
@ionutanin ionutanin deleted the ia--switch-component branch January 17, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: popup Improvements or additions to extension popup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add switch/toggle component
2 participants