Skip to content

Commit

Permalink
[Fix/#325] 진짜 마지막 QA (#326)
Browse files Browse the repository at this point in the history
* fix: Home에서 bannerId 있을 때만 bannerList map 돌고, 없을 땐 배너 1개만 보여주기

* fix: 엠티뷰 텍스트 '전체' 부분 추가 -> switch 문으로 바꾸기
  • Loading branch information
chaeneey authored Sep 22, 2024
1 parent 0077bc3 commit 3314879
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
19 changes: 16 additions & 3 deletions src/pages/guest/page/GuestMyClass/GuestMyClass.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ const GuestMyClass = () => {
'환불 완료': currentData?.filter((data) => data.moimSubmissionState === 'refunded'),
};

const GuestMyClassEmptyViewText = (state: string) => {
switch (state) {
case '전체': {
return '아직 신청한 클래스가 없어요';
}
case '입금 대기':
case '승인 대기': {
return `${state} 중인 클래스가 없어요`;
}
default: {
return `${state}된 클래스가 없어요`;
}
}
};

if (isApplyLoading || isParticipateLoading) {
return <Spinner />;
}
Expand Down Expand Up @@ -112,9 +127,7 @@ const GuestMyClass = () => {
<GuestMyClassEmptyView
text={
activeTab === '신청한'
? selectedStatus === '입금 대기' || selectedStatus === '승인 대기'
? `${selectedStatus} 중인 클래스가 없어요`
: `${selectedStatus}된 클래스가 없어요`
? GuestMyClassEmptyViewText(selectedStatus)
: '아직 참가한 클래스가 없어요'
}
/>
Expand Down
20 changes: 13 additions & 7 deletions src/pages/home/page/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,19 @@ const Home = () => {
modules={[Pagination]}
loop={true}
className="mySwiper">
{bannerList.map((banner, index) => {
return (
<SwiperSlide key={banner.id} onClick={() => handleBannerClick(index)}>
<Lottie animationData={banner.animationData} width={'100%'} loop={true} />
</SwiperSlide>
);
})}
{bannerId ? (
bannerList.map((banner, index) => {
return (
<SwiperSlide key={banner.id} onClick={() => handleBannerClick(index)}>
<Lottie animationData={banner.animationData} width={'100%'} loop={true} />
</SwiperSlide>
);
})
) : (
<SwiperSlide onClick={() => handleBannerClick(1)}>
<Lottie animationData={bannerList[1].animationData} width={'100%'} loop={true} />
</SwiperSlide>
)}
</Swiper>
</div>
<div css={categoryContainer}>
Expand Down

0 comments on commit 3314879

Please sign in to comment.