-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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(user): avatar icon not shown in user #3371
fix(user): avatar icon not shown in user #3371
Conversation
🦋 Changeset detectedLatest commit: 90c4bdc 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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@abhinandan-verma is attempting to deploy a commit to the NextUI Inc Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe changes resolve a bug where the Changes
Sequence Diagram(s)Not applicable as the changes are mainly bug fixes and internal adjustments rather than new features or significant modifications to control flow. Assessment against linked issues
Tip Early access features: enabledWe are currently testing the following features in early access:
Note:
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 Configration 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
Outside diff range and nitpick comments (2)
packages/components/user/src/use-user.ts (2)
Line range hint
1-2
: Unused ImportsThe
useUser
function no longer uses theSlotsToClasses
andUserSlots
imports. Consider removing them.-import type {SlotsToClasses, UserSlots} from "@nextui-org/theme"; +import type {AvatarProps} from "@nextui-org/avatar";
Line range hint
3-3
: Import OptimizationThe
AvatarProps
import is used and should be retained.-import type {AvatarProps} from "@nextui-org/avatar"; +import type {AvatarProps} from "@nextui-org/avatar";
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- packages/components/user/src/use-user.ts (1 hunks)
Additional comments not posted (1)
packages/components/user/src/use-user.ts (1)
Line range hint
32-32
: Remove Unusedname
PropertyThe
name
property assignment inavatarProps
has been removed, which aligns with the PR objective to ensure the default avatar icon is shown when no name is passed. This change addresses the issue correctly.
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 (1)
- .changeset/few-stingrays-lay.md (1 hunks)
Files skipped from review due to trivial changes (1)
- .changeset/few-stingrays-lay.md
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.
a test case is missing. please add one to cover the reported case.
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 (3)
- .changeset/nice-penguins-work.md (1 hunks)
- .changeset/ten-donuts-tease.md (1 hunks)
- packages/components/user/tests/user.test.tsx (2 hunks)
Files not reviewed due to errors (1)
- packages/components/user/tests/user.test.tsx (no review received)
Files skipped from review due to trivial changes (1)
- .changeset/nice-penguins-work.md
Additional comments not posted (1)
.changeset/ten-donuts-tease.md (1)
1-5
: Changeset description is accurate.The changeset correctly describes the removal of the
name
attribute fromavatarProps
inuse-user.ts
as per the PR objectives.
it("should render the default icon if no name passed to avatar", () => { | ||
const {queryByTestId} = render( | ||
<User | ||
avatarProps={{ | ||
radius: "full", | ||
size: "sm", | ||
icon: <AvatarIcon />, | ||
classNames: { | ||
base: "bg-gradient-to-br from-[#FFB457] to-[#FF705B]", | ||
icon: "text-black/80", | ||
}, | ||
name: "avatar-icon", | ||
}} | ||
name="Test" | ||
/>, | ||
); | ||
|
||
expect(queryByTestId("avatar-icon")).toBeNull(); |
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.
this test case doesn't match with the title. also the issue is that the attribute name
in User component got forwarded to Avatar component. in your test case, it shouldn't have name
in avatarProps
.
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.
Ok, I Will try again to make it perfect.
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 (2)
- .changeset/fair-zebras-fetch.md (1 hunks)
- packages/components/user/tests/user.test.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/components/user/tests/user.test.tsx
Additional comments not posted (1)
.changeset/fair-zebras-fetch.md (1)
1-5
: Changeset is accurate and complete.The changeset correctly documents the removal of the
name
property fromavatarProps
inuse-user.ts
.
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.
previous comment hasn't been resolved. besides, the test for this issue is missing.
Closes #3369
📝 Description
Fixed the bug to show the default avatar icon, when no name(prop) is passed inside avatarProps
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
No
📝 Additional Information
removed the code passing name(of user) to avatarProps
Summary by CodeRabbit
Bug Fixes
Tests