-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 로딩스피너 구현 #93
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
feat: 로딩스피너 구현 #93
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 |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import styled from '@emotion/styled'; | ||
| import LoadingSpinnerIcon from '@/assets/common/loadingspinner.svg'; | ||
| import { colors, typography } from '@/styles/global/global'; | ||
|
|
||
| interface LoadingSpinnerProps { | ||
| message?: string; | ||
| size?: 'small' | 'medium' | 'large'; | ||
| fullHeight?: boolean; | ||
| } | ||
|
|
||
| const LoadingSpinner = ({ | ||
| message = '로딩 중...', | ||
| size = 'medium', | ||
| fullHeight = false, | ||
| }: LoadingSpinnerProps) => { | ||
| return ( | ||
| <Container fullHeight={fullHeight}> | ||
| <SpinnerImage size={size} src={LoadingSpinnerIcon} alt="로딩 중" /> | ||
| {message && <LoadingText>{message}</LoadingText>} | ||
| </Container> | ||
| ); | ||
| }; | ||
|
|
||
| const Container = styled.div<{ fullHeight: boolean }>` | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: center; | ||
| align-items: center; | ||
| ${({ fullHeight }) => | ||
| fullHeight && | ||
| ` | ||
| min-height: 100vh; | ||
| background-color: var(--color-black-main); | ||
| `} | ||
| `; | ||
|
|
||
| const SpinnerImage = styled.img<{ size: string }>` | ||
| ${({ size }) => { | ||
| switch (size) { | ||
| case 'small': | ||
| return 'width: 24px; height: 24px;'; | ||
| case 'large': | ||
| return 'width: 48px; height: 48px;'; | ||
| default: // medium | ||
| return 'width: 32px; height: 32px;'; | ||
| } | ||
| }} | ||
| `; | ||
|
|
||
| const LoadingText = styled.p` | ||
| margin-top: 20px; | ||
| color: ${colors.white}; | ||
| font-size: ${typography.fontSize.lg}; | ||
| font-weight: ${typography.fontWeight.semibold}; | ||
| `; | ||
|
|
||
| export default LoadingSpinner; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import styled from '@emotion/styled'; | |
| interface PostHeaderProps { | ||
| creatorProfileImageUrl?: string; | ||
| creatorNickname?: string; | ||
| alias?: string; | ||
| aliasName?: string; | ||
|
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. 💡 Verification agent 🧩 Analysis chain프로퍼티 rename(alias → aliasName) 전파 여부 점검 컴포넌트/타입/데이터 계층 전체에서 레포 전역 점검 스크립트: Also applies to: 37-37 🏁 Script executed: #!/bin/bash
# PostHeader props에서 alias → aliasName 변경 누락 확인
rg -n --hidden -S "\baliasName\b" -A 2
echo "----- 남아있는 alias 단독 사용(의도치 않은 잔존) -----"
rg -n --hidden -S "\balias\b" | rg -v "aliasName"Length of output: 6918 alias → aliasName 전파 누락 – 수정 필요 다음 파일들에서 여전히
추가로, |
||
| aliasColor?: string; | ||
| postDate: string; | ||
| creatorId?: number; | ||
|
|
@@ -13,8 +13,8 @@ interface PostHeaderProps { | |
| const PostHeader = ({ | ||
| creatorProfileImageUrl, | ||
| creatorNickname, | ||
| alias, | ||
| aliasColor = '#FFFFFF', // 기본값 설정 | ||
| aliasName, | ||
| aliasColor, | ||
| postDate, | ||
| creatorId, | ||
| type = 'post', | ||
|
|
@@ -34,7 +34,7 @@ const PostHeader = ({ | |
| <div className="infoBox"> | ||
| <div className="username">{creatorNickname}</div> | ||
| <div className="usertitle" style={{ color: aliasColor }}> | ||
| {alias} | ||
| {aliasName} | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,8 +18,12 @@ const Container = styled.div` | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| const BorderBottom = styled.div` | ||||||||||||||||||||||||||||||||||
| width: 100%; | ||||||||||||||||||||||||||||||||||
| height: 10px; | ||||||||||||||||||||||||||||||||||
| background-color: var(--color-darkgrey-dark); | ||||||||||||||||||||||||||||||||||
| min-width: 280px; | ||||||||||||||||||||||||||||||||||
| max-width: 500px; | ||||||||||||||||||||||||||||||||||
| margin: 0 auto; | ||||||||||||||||||||||||||||||||||
| padding: 0 20px; | ||||||||||||||||||||||||||||||||||
| height: 6px; | ||||||||||||||||||||||||||||||||||
| background: #1c1c1c; | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+21
to
+26
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. BorderBottom: width:100% + padding으로 인한 모바일 가로 오버플로우 가능성 — box-sizing 추가 권장 현재 적용 예시(diff): const BorderBottom = styled.div`
width: 100%;
min-width: 280px;
max-width: 500px;
margin: 0 auto;
padding: 0 20px;
+ box-sizing: border-box;
height: 6px;
background: #1c1c1c;
`;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| `; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| interface FeedDetailPostProps extends FeedDetailData { | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,8 +18,12 @@ const Container = styled.div` | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| const BorderBottom = styled.div` | ||||||||||||||||||||||||||||||||||
| width: 100%; | ||||||||||||||||||||||||||||||||||
| height: 10px; | ||||||||||||||||||||||||||||||||||
| background-color: var(--color-darkgrey-dark); | ||||||||||||||||||||||||||||||||||
| min-width: 280px; | ||||||||||||||||||||||||||||||||||
| max-width: 500px; | ||||||||||||||||||||||||||||||||||
| margin: 0 auto; | ||||||||||||||||||||||||||||||||||
| padding: 0 20px; | ||||||||||||||||||||||||||||||||||
| height: 6px; | ||||||||||||||||||||||||||||||||||
| background: #1c1c1c; | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+21
to
+26
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. BorderBottom: width:100% + padding으로 인한 오버플로우 — box-sizing 추가 권장 FeedDetailPost와 동일한 구조로, 작은 화면에서 가로 스크롤/잘림이 발생할 수 있습니다. 적용 예시(diff): const BorderBottom = styled.div`
width: 100%;
min-width: 280px;
max-width: 500px;
margin: 0 auto;
padding: 0 20px;
+ box-sizing: border-box;
height: 6px;
background: #1c1c1c;
`;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| `; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| const FeedPost = ({ showHeader, isLast, isMyFeed, ...postData }: FeedPostProps) => { | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
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.
💡 Verification agent
🧩 Analysis chain
API 계약 변경(alias → aliasName)으로 인한 런타임 불일치 위험 — 응답 정규화 또는 점진적 전환 장치 필요
서버 응답이 아직
alias로 내려올 경우, 프론트에서는aliasName만 참조하므로 값이undefined가 되어 UI에 누락될 수 있습니다. 백엔드가 모두 반영되기 전까지는 프론트에서 하위 호환 정규화를 적용하는 것을 권장합니다.예시(파일 내 getFeedDetail 함수에서 응답 정규화):
레포 내 남아있는
alias사용처도 함께 점검해 주세요:추가로, 본 PR 제목/설명(로딩 스피너)과 실제 변경 파일이 일치하지 않는 것으로 보입니다. 의도된 분리 PR인지 확인 부탁드립니다.
🏁 Script executed:
Length of output: 6848
getFeedDetail 하위 호환 응답 정규화 필요 (alias → aliasName)
백엔드가 아직
alias키로 응답을 내려줄 경우, 현재aliasName만 참조하도록 타입을 바꾼 상태에서는 UI에 값이 누락될 수 있습니다. 다음을 적용해 주세요.• 적용 위치
src/api/feeds/getFeedDetail.ts(getFeedDetail 함수 내부)• 정규화 예시
• 부가 확인 요청
alias가 남아있는지 (getComments등)🤖 Prompt for AI Agents