Use profile image from oauth provider (#1330)

This commit is contained in:
Luke Vella 2024-09-07 16:57:07 +01:00 committed by GitHub
parent be216344e2
commit 364bb8b83f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 95 additions and 29 deletions

View file

@ -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";