Skip to content

Commit

Permalink
fix: add user avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
alarv committed Jul 16, 2024
1 parent e1a8dff commit 13625f4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'api.dicebear.com',
port: '',
pathname: '/9.x/pixel-art/**',
},
],
},
};

export default nextConfig;
7 changes: 6 additions & 1 deletion src/app/dashboard/components/UserAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ export default function UserAvatar({ session }: { session: Session | null }) {
avatarProps={{
size: 'sm',
showFallback: true,
src: session?.user?.image || undefined,
src:
session?.user?.image ||
`https://api.dicebear.com/9.x/pixel-art/jpg?seed=${session?.user?.name?.replace(
' ',
'',
)}`,
}}
name={session?.user?.name}
/>
Expand Down

0 comments on commit 13625f4

Please sign in to comment.