-
Notifications
You must be signed in to change notification settings - Fork 2
[Refactor] 데이트 유형 테스트 닉네임이 나오도록 수정 #110
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 all commits
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,8 @@ import { useQuery } from '@tanstack/react-query'; | |||||||||||||||||
| import type IDateTestResult from '@/types/datetest/datetest'; | ||||||||||||||||||
| import type { TRelationTypeResponse } from '@/types/datetest/datetest'; | ||||||||||||||||||
|
|
||||||||||||||||||
| import { useUserGrade } from '@/hooks/home/useUserGrade'; | ||||||||||||||||||
|
|
||||||||||||||||||
| import { getRelationTypes } from '@/api/datetest/datetest'; | ||||||||||||||||||
|
|
||||||||||||||||||
| const resultImages = import.meta.glob('../../images/testResults/*.png', { | ||||||||||||||||||
|
|
@@ -116,6 +118,8 @@ export default function DateTestResultPage() { | |||||||||||||||||
| }; | ||||||||||||||||||
| }); | ||||||||||||||||||
|
|
||||||||||||||||||
| const { data: gradeData } = useUserGrade(); | ||||||||||||||||||
|
|
||||||||||||||||||
| return ( | ||||||||||||||||||
| <div className="flex flex-col p-6 max-w-3xl mx-auto"> | ||||||||||||||||||
| <div className="rounded-[32px] px-[16px] py-[8px] font-bold text-sm text-center mt-[88px] mb-[16px] w-[143px]" style={{ backgroundColor: bgColor }}> | ||||||||||||||||||
|
|
@@ -131,7 +135,7 @@ export default function DateTestResultPage() { | |||||||||||||||||
| </div> | ||||||||||||||||||
|
|
||||||||||||||||||
| <h1 className="text-3xl font-bold mb-[40px]"> | ||||||||||||||||||
| {resultData.typeDescription.preferenceType} 님의 | ||||||||||||||||||
| {gradeData?.result.username} 님의 | ||||||||||||||||||
| <br /> | ||||||||||||||||||
| 데이트 취향 유형 결과 | ||||||||||||||||||
| </h1> | ||||||||||||||||||
|
Comment on lines
+138
to
141
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. 🛠️ Refactor suggestion 잠재적 런타임 오류 방지 및 폴백 텍스트 추가
다음처럼 수정 제안드립니다: - {gradeData?.result.username} 님의
+ {(gradeData?.result?.username ?? '사용자')} 님의📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
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.
🧹 Nitpick (assertive)
등급 데이터 로딩/오류 상태 미처리 → 화면 품질 저하 가능성
현재는 data만 구조분해하여 로딩 중이거나 실패 시에도 헤더가 “ 님의”처럼 비어 보일 수 있습니다. 로딩/실패 시 대체 텍스트를 보여주면 UX가 개선됩니다. 아래 변경(헤더 라인 수정)만으로도 최소한의 폴백 처리가 가능하니 함께 반영 권장드립니다.
원하시면 isLoading/error까지 반영한 스켈레톤/플레이스홀더 처리 코드도 바로 제안드리겠습니다.