-
Notifications
You must be signed in to change notification settings - Fork 2
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] 무한 스크롤, 로딩 인디케이터, 엠티 뷰, 오류 alert #279
Merged
+577
−225
Merged
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
815ff90
feat: Tab 공통 컴포넌트에서 value와 label을 분리하여 사용하도록 수정
simeunseo 4d51092
feat: 변경된 Tab 공통 컴포넌트에 맞춰서 DashboardTab 사용 방식 변경
simeunseo d5e90bf
feat: Tab story 수정
simeunseo 473f406
feat: 티클 리스트에서 진행예정/종료 탭 추가
simeunseo dbc3e4c
feat: Loading 컴포넌트 수정
simeunseo 46d16e8
feat: Loading 컴포넌트 story 추가
simeunseo 735c37a
feat: 티클 목록 조회시 기존 useQuery를 useInfiniteQuery로 변경
simeunseo d705e30
feat: 무한 스크롤 커스텀훅 구현
simeunseo 9b6e32c
feat: 티클 리스트 조회시 무한스크롤과 로딩 인디케이터 추가
simeunseo 888e6d8
feat: 기존 대시보드 조회 쿼리를 useInfiniteQuery로 변경
simeunseo b204788
design: 대시보드 카드에서 개설자 명이 길때 레이아웃이 깨지지 않도록 고정된 width 추가
simeunseo 533a455
feat: 신청한 티클, 개설한 티클에 대해 10개씩 무한 스크롤 적용
simeunseo aafaba9
feat: 대시보드에서 티클 카드 클릭시 해당 티클 상세페이지로 이동
simeunseo 2a841f3
feat: Link태그 내 Link태그가 중첩되는 문제 해결
simeunseo 04c2fe3
feat: DashboardTab에서 state가 아닌 url에 따라서 tab을 전환하도록 변경
simeunseo e965652
feat: Header를 root에 조건부 렌더링하는 것이 아닌 필요한 곳에 직접 삽입하여 리렌더링 이슈 해결
simeunseo d003f97
feat: 메인 페이지에서 탭 전환에 따른 리렌더링 개선
simeunseo 4b890d5
feat: 티클 리스트, 대시보드에 대해 Empty 뷰 추가
simeunseo b0eaf1b
feat: 티클 신청시 alert
simeunseo 53dd259
design: Empty 뷰에 점선 border 적용
simeunseo fd62076
feat: 개설한 티클 목록에서 참여자 목록 모달 열 때 link 태그 동작 없애기
simeunseo 2799faf
feat: 참여자 목록 모달에 Empty 뷰 추가
simeunseo e6f49ce
feat: 티클 생성시 대시보드 조회 invalidateQueries
simeunseo 2e550e7
design: 태그의 최대 크기에 맞춰서 티클 카드 레이아웃 조정
simeunseo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import TicleCharacter from '@/assets/images/ticle-character.png'; | ||
import cn from '@/utils/cn'; | ||
|
||
interface EmptyProps { | ||
title?: string; | ||
className?: string; | ||
} | ||
|
||
function Empty({ title = '항목이 비어있어요!', className }: EmptyProps) { | ||
return ( | ||
<div className={cn('flex h-96 w-full flex-col items-center justify-center gap-8', className)}> | ||
<img | ||
src={TicleCharacter} | ||
alt="흑백 티클 캐릭터" | ||
className="grayscale" | ||
width={180} | ||
height={180} | ||
/> | ||
<h1 className="text-head2 text-weak">{title}</h1> | ||
</div> | ||
); | ||
} | ||
|
||
export default Empty; |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { cva } from 'class-variance-authority'; | ||
|
||
const dotVariants = cva('h-4 w-4 rounded-full', { | ||
variants: { | ||
variant: { | ||
white: ['animate-[flashWhite_1.5s_ease-out_infinite_alternate] bg-altWeak'], | ||
primary: ['animate-[flashPrimary_1.5s_ease-out_infinite_alternate] bg-secondary'], | ||
}, | ||
position: { | ||
first: '', | ||
second: '[animation-delay:0.5s]', | ||
third: '[animation-delay:1s]', | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: 'white', | ||
}, | ||
}); | ||
|
||
type LoadingProps = { | ||
color?: 'white' | 'primary'; | ||
}; | ||
|
||
const Loading = ({ color = 'white' }: LoadingProps) => ( | ||
<div className="flex gap-5"> | ||
<div className={dotVariants({ variant: color, position: 'first' })} /> | ||
<div className={dotVariants({ variant: color, position: 'second' })} /> | ||
<div className={dotVariants({ variant: color, position: 'third' })} /> | ||
</div> | ||
); | ||
|
||
export default Loading; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Q:
제네릭을 통해 props에 대한 타입을 정의한 이유가 있을까요? 그냥 string으로 할당하지 않은 이유가 궁금합니다!
p3:
컨벤션에 맞춰서 화살표 함수로 부탁드리겠습니다!
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.
탭 정보에 대한 타입 안정성을 위해서입니다!
탭 정보는 위에 정의한 TabData interface에 맞게 value, label, onClick 속성으로 정의하게 되는데요!
예를 들어 탭 정보가 다음과 같이 정의되었을 때
아래와 같이 selectedTab에 정의도지 않은 Tab value를 넣으면 타입에러가 나게 됩니다.
제너릭으로 정의하지 않으면 이 부분에 대해 캐치가 안됩니다!