-
Notifications
You must be signed in to change notification settings - Fork 1
feat(client): 사이드바 구글 프로필 추가 #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
073efca
c70255f
83bd130
2896846
31ed69f
045b9cd
76e1870
a3125c7
7100373
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,6 +16,7 @@ import { | |||||
| useGetArcons, | ||||||
| usePutCategory, | ||||||
| useDeleteCategory, | ||||||
| useGetGoogleProfile, | ||||||
| } from '@shared/apis/queries'; | ||||||
| import { useEffect, useState } from 'react'; | ||||||
| import { useQueryClient } from '@tanstack/react-query'; | ||||||
|
|
@@ -33,6 +34,9 @@ export function Sidebar() { | |||||
| const { mutate: createCategory } = usePostCategory(); | ||||||
| const { data, isPending } = useGetArcons(); | ||||||
| const { mutate: deleteCategory } = useDeleteCategory(); | ||||||
| const { data: googleProfileData } = useGetGoogleProfile(); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 프로필 로딩 및 에러 상태 처리 부재.
다음과 같이 수정하세요: - const { data: googleProfileData } = useGetGoogleProfile();
+ const { data: googleProfileData, isLoading: isProfileLoading } = useGetGoogleProfile();그리고 UI에서 로딩 상태를 처리하세요: <button
className="h-[3.6rem] w-[3.6rem] flex-shrink-0 overflow-hidden rounded-full border border-gray-200"
onClick={() => console.log('프로필 클릭', profileImageUrl)}
>
- {profileImageUrl ? (
+ {isProfileLoading ? (
+ <div className="h-full w-full animate-pulse bg-gray-200" />
+ ) : profileImageUrl ? (
<img
src={profileImageUrl}
alt="프로필 이미지"
className="h-full w-full object-cover"
/>
) : (
<div className="h-full w-full bg-gray-200" />
)}
</button>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 해당 API pending관련 처리는 이후에 추가될까요?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @constantly-dev, 좋은 질문입니다! 현재 PR에서 로딩 상태 처리를 추가하실 계획인가요, 아니면 추후 별도 PR에서 진행하실 예정인가요? 만약 이후에 추가하실 계획이시라면, 추적을 위해 별도 이슈를 생성해드릴까요? 이렇게 하면 향후 UX 개선 작업 시 놓치지 않고 처리하실 수 있을 것 같습니다. 😊 🧠 Learnings used |
||||||
|
|
||||||
| const profileImageUrl = googleProfileData?.googleProfile || null; | ||||||
|
Comment on lines
+41
to
+43
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 사이드바 프로필 클릭할때, 그때 유저정보 불러오는게 아니라, |
||||||
|
|
||||||
| const { | ||||||
| activeTab, | ||||||
|
|
@@ -128,12 +132,27 @@ export function Sidebar() { | |||||
| return ( | ||||||
| <aside className="bg-white-bg sticky top-0 h-screen w-[24rem] border-r border-gray-300"> | ||||||
| <div className="flex h-full flex-col px-[0.8rem]"> | ||||||
| <header className="px-[0.8rem] py-[2.8rem]"> | ||||||
| {/* TODO: 사이드바 프로필 클릭이벤트 추가 */} | ||||||
| <header className="flex items-center justify-between px-[0.8rem] py-[2.8rem]"> | ||||||
| <Icon | ||||||
| name="logo" | ||||||
| aria-label="Pinback 로고" | ||||||
| className="h-[2.4rem] w-[8.7rem] cursor-pointer" | ||||||
| /> | ||||||
| <button | ||||||
| className="h-[3.6rem] w-[3.6rem] flex-shrink-0 overflow-hidden rounded-full border border-gray-200" | ||||||
| onClick={() => console.log('프로필 클릭', profileImageUrl)} | ||||||
| > | ||||||
|
Comment on lines
+146
to
+150
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
| {profileImageUrl ? ( | ||||||
| <img | ||||||
| src={profileImageUrl} | ||||||
| alt="프로필 이미지" | ||||||
| className="h-full w-full object-cover" | ||||||
| /> | ||||||
| ) : ( | ||||||
| <div className="h-full w-full bg-gray-200" /> | ||||||
| )} | ||||||
| </button> | ||||||
| </header> | ||||||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| <hr className="my-[0.8rem] border-gray-100" /> | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 따로 바뀌는 경우가 없어서
staleTime을Infinity로 지정하신거죠??