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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(user): avatar icon not shown in user #3371

5 changes: 5 additions & 0 deletions .changeset/fair-zebras-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/user": patch
---

Removed `name` from `avatarProps` in `use-user.ts` (#3369)
6 changes: 3 additions & 3 deletions packages/components/user/__tests__/user.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ describe("User", () => {
});

it("should have the passed name", () => {
const {container} = render(<User name="Test" />);
const name = container.querySelector("span");
const {getByText} = render(<User name="Test" />);
const nameElement = getByText("Test");

expect(name).toHaveTextContent("Test");
expect(nameElement).toBeInTheDocument();
});

it("should have the passed description", () => {
Expand Down
1 change: 0 additions & 1 deletion packages/components/user/src/use-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export function useUser(props: UseUserProps) {

const avatarProps = {
isFocusable: false,
name: typeof name === "string" ? name : undefined,
...userAvatarProps,
};

Expand Down