-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(#3640) : errorFallbackSrc
and loadingFallbackSrc
props to image component
#3665
Conversation
🦋 Changeset detectedLatest commit: 105107b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
@abhinav700 is attempting to deploy a commit to the NextUI Inc Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThis change enhances the Changes
Assessment against linked issues
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? 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 as PR comments)
Additionally, you can add 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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (5)
- .changeset/small-gifts-learn.md (1 hunks)
- apps/docs/content/components/image/fallback.ts (1 hunks)
- apps/docs/content/docs/components/image.mdx (2 hunks)
- packages/components/image/src/use-image.ts (5 hunks)
- packages/components/image/stories/image.stories.tsx (1 hunks)
Additional comments not posted (8)
.changeset/small-gifts-learn.md (1)
1-5
: Changeset looks good.The changeset entry accurately describes the introduction of
errorFallbackSrc
andloadingFallbackSrc
properties as a minor change.apps/docs/content/components/image/fallback.ts (1)
10-11
: Example usage looks good.The example correctly demonstrates how to use
errorFallbackSrc
andloadingFallbackSrc
properties.Consider verifying that this example is referenced in the documentation to ensure users can easily find it.
packages/components/image/stories/image.stories.tsx (1)
135-136
: Storybook example updated correctly.The
Fallback
story now includeserrorFallbackSrc
andloadingFallbackSrc
, providing a clear demonstration of the new functionality.packages/components/image/src/use-image.ts (3)
33-34
: New properties added to Props interface.The
errorFallbackSrc
andloadingFallbackSrc
properties are correctly added to theProps
interface.
190-200
: Fallback logic correctly implemented.The logic for determining which fallback image to display is well-structured and ensures the correct image is shown based on the loading state.
94-95
: New properties integrated into useImage hook.The
useImage
hook now includes logic to handleerrorFallbackSrc
andloadingFallbackSrc
, enhancing the component's flexibility.Consider verifying that existing functionality is not adversely affected by these changes.
apps/docs/content/docs/components/image.mdx (2)
71-82
: Documentation updated with new properties.The documentation correctly explains the usage of
errorFallbackSrc
andloadingFallbackSrc
, providing clear guidance for developers.
118-119
: API table updated with new properties.The API table now includes
errorFallbackSrc
andloadingFallbackSrc
, ensuring comprehensive documentation of the component's capabilities.
will be handled in #3664 |
Closes #3640
📝 Description
⛳️ Current behavior (updates)
Fallback displays same fallback image for error and loading state
🚀 New behavior
errorFallbackSrc
andloadingFallbackSrc
props are added to display different fallbacks for both states.💣 Is this a breaking change (Yes/No):
I don't know
Summary by CodeRabbit
New Features
errorFallbackSrc
andloadingFallbackSrc
properties for improved image handling during loading and error states.Documentation
Image
component.