-
-
Notifications
You must be signed in to change notification settings - Fork 455
fix(Alert): remove redundant boolean
from onDismiss
prop type
#1539
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
Conversation
… from stories - Changed the type of `onDismiss` prop in Alert component from boolean to a function type - Removed `onDismiss` default values from various Alert stories to align with the updated prop type
🦋 Changeset detectedLatest commit: bd99e99 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes update the Alert component in the flowbite-react library by modifying the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Alert
participant onDismissCallback
User->>Alert: Click dismiss button
Alert->>onDismissCallback: Invoke onDismiss function
onDismissCallback-->>Alert: Handle dismiss event
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
packages/ui/src/components/Alert/Alert.tsxOops! Something went wrong! :( ESLint: 8.57.0 ESLint couldn't find the plugin "eslint-plugin-react". (The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "/packages/ui".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-react" was referenced from the config file in "packages/ui/.eslintrc.cjs". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.changeset/yummy-feet-attend.md (1)
7-7
: Minor grammar fix neededThere's a missing article in this sentence.
- Changed the type of `onDismiss` prop in Alert component from boolean to a function type + Changed the type of `onDismiss` prop in the Alert component from boolean to a function type🧰 Tools
🪛 LanguageTool
[uncategorized] ~7-~7: You might be missing the article “the” here.
Context: ...Changed the type ofonDismiss
prop in Alert component from boolean to a function ty...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.changeset/yummy-feet-attend.md
(1 hunks)apps/storybook/src/Alert.stories.tsx
(0 hunks)packages/ui/schema.json
(1 hunks)packages/ui/src/components/Alert/Alert.tsx
(1 hunks)
💤 Files with no reviewable changes (1)
- apps/storybook/src/Alert.stories.tsx
🧰 Additional context used
🪛 LanguageTool
.changeset/yummy-feet-attend.md
[uncategorized] ~7-~7: You might be missing the article “the” here.
Context: ...Changed the type of onDismiss
prop in Alert component from boolean to a function ty...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
🔇 Additional comments (3)
packages/ui/src/components/Alert/Alert.tsx (1)
33-33
: Good type improvement for theonDismiss
propThis change improves type safety by ensuring that
onDismiss
prop can only be a function that matches a button'sonClick
event handler, which is exactly how it's used in the implementation. This is more precise than the previousboolean | (() => void)
type and prevents potential type mismatches..changeset/yummy-feet-attend.md (1)
5-8
: Clear and concise changeset descriptionThe changeset accurately describes the refactoring of the
onDismiss
prop and related changes.🧰 Tools
🪛 LanguageTool
[uncategorized] ~7-~7: You might be missing the article “the” here.
Context: ...Changed the type ofonDismiss
prop in Alert component from boolean to a function ty...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
packages/ui/schema.json (1)
144-144
: Verify intent of adding "dark" to required propertiesThis change makes the "dark" property mandatory in the schema, which seems unrelated to the PR's focus on fixing the
onDismiss
prop type. While the property has a default value (true), making it required could potentially affect users who don't explicitly provide this field.Can you confirm if this change is intentional as part of this PR, or if it should be addressed in a separate PR focused on schema updates?
Summary by CodeRabbit
Refactor
Configuration