수파베이스 유저 더미 데이터 넣기
테일 윈드 UI 반응형 만들기 얼추
마이페이지 제작 중...
import { createClient } from '@supabase/supabase-js'
// Create Supabase client
const supabase = createClient('your_project_url', 'your_supabase_api_key')
// Upload file using standard upload
async function uploadFile(file) {
const { data, error } = await supabase.storage.from('bucket_name').upload('file_path', file)
if (error) {
// Handle error
} else {
// Handle success
}
}
버킷 이름이야 내가 방금 만들어서 그렇다치고, 파일 경로는... 어떻게 알지? 싶었다... 근데 ㅂ ㅏ보~
그 파일 경로가 그 사람의 파일 경로가 아니다 ....ㅋㅋㅋㅋㅋㅋㅋㅋㅋ 내가 서버에 저장할 경로를 말하는 거 같음...
인풋에 올린 파일 찾는 법이다... 짱이담.... input type에 file 올리면 됨
const file = event.target.files[0];
타겟은 이렇게 잡으면 된다.
라벨에 이미지 달고, 검색 버튼 인풋을 안 보이게 한 다음 처리하는 return 쪽. 폐기 하고 모달 띄워서 해결하기로!
<div className="relative flex items-center">
<img
src={image}
alt="profile-img"
className="relative rounded-full overflow-hidden max-w-[95px] max-h-[95px]"
/>
<label htmlFor="profile_image" className="absolute bottom-1 right-2">
<HiPencilSquare className="w-6 h-6" />
</label>
<input type="file" className="hidden" accept="image/*" id="profile_image" onChange={handleProfileImage} />
수파베이스 오류로 일단 오늘은 종료~~~!