mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-21 10:17:24 +02:00
✨ Use profile image from oauth provider (#1330)
This commit is contained in:
parent
be216344e2
commit
364bb8b83f
13 changed files with 95 additions and 29 deletions
|
@ -3,24 +3,8 @@ import { cn } from "@rallly/ui";
|
|||
import { Icon } from "@rallly/ui/icon";
|
||||
import { User2Icon } from "lucide-react";
|
||||
|
||||
import { useUser } from "@/components/user-provider";
|
||||
import { getRandomAvatarColor } from "@/utils/color-hash";
|
||||
|
||||
export const CurrentUserAvatar = ({
|
||||
size = "md",
|
||||
className,
|
||||
}: Omit<UserAvatarProps, "name">) => {
|
||||
const { user } = useUser();
|
||||
|
||||
return (
|
||||
<UserAvatar
|
||||
className={className}
|
||||
name={user.isGuest ? undefined : user.name}
|
||||
size={size}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
interface UserAvatarProps {
|
||||
name?: string;
|
||||
size?: "xs" | "sm" | "md" | "lg";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue