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

refactor(toggleswitch.tsx): toggleSwitch optional props #928

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

andreaTarascioSophany
Copy link
Contributor

ToggleSwitch optional props

#925

@vercel
Copy link

vercel bot commented Aug 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2023 8:06am

@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Patch coverage: 99.71% and project coverage change: -0.04% ⚠️

Comparison is base (7461173) 99.54% compared to head (126b3e6) 99.51%.
Report is 57 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #928      +/-   ##
==========================================
- Coverage   99.54%   99.51%   -0.04%     
==========================================
  Files         163      167       +4     
  Lines        6621     6942     +321     
  Branches      401      421      +20     
==========================================
+ Hits         6591     6908     +317     
- Misses         30       34       +4     
Files Changed Coverage Δ
src/components/Toast/theme.ts 100.00% <ø> (ø)
src/components/ToggleSwitch/ToggleSwitch.tsx 98.98% <92.30%> (-1.02%) ⬇️
src/components/Dropdown/Dropdown.tsx 99.24% <99.43%> (-0.76%) ⬇️
src/components/Badge/Badge.tsx 100.00% <100.00%> (ø)
src/components/Button/Button.tsx 100.00% <100.00%> (ø)
src/components/Button/ButtonBase.tsx 100.00% <100.00%> (ø)
src/components/Button/theme.ts 100.00% <100.00%> (ø)
src/components/Card/Card.tsx 100.00% <100.00%> (ø)
src/components/Carousel/Carousel.tsx 99.09% <100.00%> (+0.12%) ⬆️
src/components/DarkThemeToggle/DarkThemeToggle.tsx 100.00% <100.00%> (ø)
... and 19 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@tulup-conner tulup-conner left a comment

Choose a reason for hiding this comment

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

Thank you for taking this issue on! I know we have tons of existing code where we do this, but we would like to change the pattern of

{booleanCondition && <SomeJSX />}

to

{booleanCondition ? <SomeJSX /> : null}

The first example will cause a 0 to appear if the condition is false.

Also, if you could add an example to the docs for <ToggleSwitch> where the label is omitted, that would be greatly appreciated.

@andreaTarascioSophany
Copy link
Contributor Author

Okay! I'll make the changes asap

@rluders rluders merged commit 3e443fc into themesberg:main Sep 21, 2023
maman pushed a commit to transkripid/flowbite-react that referenced this pull request Oct 7, 2023
* refactor(toggleswitch.tsx): toggleSwitch optional props

ToggleSwitch optional props

themesberg#925

* refactor(better sintax): improved quality of code

improved quality of code
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.

3 participants