themesberg / flowbite-react

Official React components built for Flowbite and Tailwind CSS
https://flowbite-react.com
MIT License
1.82k stars 406 forks source link

fix(togglebutton component): fix togglebutton with long label in mobile #1199

Closed nikitadubyk closed 1 month ago

nikitadubyk commented 7 months ago

Fixed display of component with large label on mobile devices

fix #884 and fix #587

Fixed the display of the component with a large label on mobile devices. Now it does not collapse and is displayed correctly

https://github.com/themesberg/flowbite-react/issues/587 https://github.com/themesberg/flowbite-react/issues/884

Summary by CodeRabbit

vercel[bot] commented 7 months ago

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

Name Status Preview Comments Updated (UTC)
flowbite-react ❌ Failed (Inspect) Apr 28, 2024 4:43pm
flowbite-react-storybook ❌ Failed (Inspect) Apr 28, 2024 4:43pm
codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.36%. Comparing base (7461173) to head (3311292). Report is 245 commits behind head on main.

:exclamation: Current head 3311292 differs from pull request most recent head e67ddac. Consider uploading reports for the commit e67ddac to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1199 +/- ## ========================================== - Coverage 99.54% 97.36% -2.18% ========================================== Files 163 214 +51 Lines 6621 9077 +2456 Branches 401 530 +129 ========================================== + Hits 6591 8838 +2247 - Misses 30 239 +209 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

nikitadubyk commented 6 months ago

@SutuSebastian can you please check my pr?

changeset-bot[bot] commented 3 months ago

⚠️ No Changeset found

Latest commit: e67ddacbc579a5699a9583bc196208ee324a5c54

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

coderabbitai[bot] commented 3 months ago

Walkthrough

The recent updates focus on enhancing the ToggleSwitch component by adding a new story for testing long labels and updating styling to handle multi-line labels effectively. These changes aim to improve the component's responsiveness and visual integrity across different devices and scenarios.

Changes

Files Change Summary
.../ToggleSwitch/ToggleSwitch.stories.tsx Added ToggleSwitchWithLongLabel story to test long labels.
.../ToggleSwitch/theme.ts Updated toggle base style and sizes to better support long labels and prevent style collapsing.

Assessment against linked issues

Objective Addressed Explanation
Ensure ToggleSwitch styling remains intact on mobile with long labels (#884, #587)
Prevent ToggleSwitch from collapsing when label spans multiple lines (#884, #587)

Possibly related issues

Poem

🐰🌟 In the realm of UI so bright, A ToggleSwitch now holds the light. Long labels stretch, but do not break, Through screens small, a path they make. CodeRabbit hops with joy, you see, For styled toggles as they should be! 🌟🐰


Recent Review Details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between ee3749f4173d99b15bcbd6a312ddc5da69ba6fcf and e67ddacbc579a5699a9583bc196208ee324a5c54.
Files selected for processing (2) * src/components/ToggleSwitch/ToggleSwitch.stories.tsx (1 hunks) * src/components/ToggleSwitch/theme.ts (2 hunks)
Files skipped from review due to trivial changes (1) * src/components/ToggleSwitch/ToggleSwitch.stories.tsx
Additional comments not posted (2)
src/components/ToggleSwitch/theme.ts (2)
`13-13`: Ensure the `relative shrink-0` classes are visually verified. Nikitadubyk's comment suggests potential issues without `shrink-0`. Please confirm the component's appearance with these classes, possibly referencing the linked visual evidence. --- `38-40`: Adjustments to the `min-w-` classes in sizes are appropriate. These changes should help maintain the visual integrity of the `ToggleSwitch` across different device sizes, as intended.
--- Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
nikitadubyk commented 3 months ago

@SutuSebastian sorry for late update) I fix comments now

SutuSebastian commented 1 month ago

deprecated by #1428