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

@ -13,6 +13,7 @@
},
"dependencies": {
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.4",
"@radix-ui/react-dropdown-menu": "^2.0.4",

View file

@ -0,0 +1,50 @@
"use client";
import * as React from "react";
import * as AvatarPrimitive from "@radix-ui/react-avatar";
import { cn } from "@rallly/ui";
const Avatar = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
>(({ className, ...props }, ref) => (
<AvatarPrimitive.Root
ref={ref}
className={cn(
"relative flex size-10 shrink-0 overflow-hidden rounded-full",
className,
)}
{...props}
/>
));
Avatar.displayName = AvatarPrimitive.Root.displayName;
const AvatarImage = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Image>,
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
>(({ className, ...props }, ref) => (
<AvatarPrimitive.Image
ref={ref}
className={cn("aspect-square h-full w-full", className)}
{...props}
/>
));
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
const AvatarFallback = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Fallback>,
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
>(({ className, ...props }, ref) => (
<AvatarPrimitive.Fallback
ref={ref}
className={cn(
"bg-muted flex h-full w-full items-center justify-center rounded-full",
className,
)}
{...props}
/>
));
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
export { Avatar, AvatarImage, AvatarFallback };

View file

@ -7,7 +7,7 @@ import * as React from "react";
import { Dialog, DialogContent } from "./dialog";
import { cn } from "./lib/utils";
import { Icon } from "@rallly/ui/icon";
import { Icon } from "./icon";
const Command = React.forwardRef<
React.ElementRef<typeof CommandPrimitive>,

View file

@ -2,6 +2,11 @@
"extends": "@rallly/tsconfig/next.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/utils": ["src/lib/utils.ts"],
"@/components/*": ["src/*"],
"@/ui/*": ["src/*"],
},
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],