feat: display profile picture

This commit is contained in:
Henry
2025-01-22 13:35:44 +00:00
parent ef8f42a460
commit 0bd23d24ac
12 changed files with 130 additions and 74 deletions

View File

@@ -4,6 +4,7 @@ import { useState } from "react";
import { usePopup } from "~/providers/popup";
import { api } from "~/utils/api";
import createClient from "~/utils/supabase/client";
import { getPublicUrl } from "~/utils/supabase/getPublicUrl";
export default function Avatar({
userId,
@@ -35,9 +36,7 @@ export default function Avatar({
},
});
const avatarUrl = userImage
? supabase.storage.from("avatars").getPublicUrl(userImage).data.publicUrl
: null;
const avatarUrl = userImage ? getPublicUrl(userImage) : undefined;
const uploadAvatar = async (event: React.ChangeEvent<HTMLInputElement>) => {
try {