Skip to content

Commit 198f31e

Browse files
authored
Merge pull request #2176 from sopt-makers/feat/#2175
feat: 타임캡솝 수동 Close
2 parents bb906a8 + 5805230 commit 198f31e

File tree

3 files changed

+31
-35
lines changed

3 files changed

+31
-35
lines changed

src/components/common/Banner/ActiveBannerSlot.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import WelcomeBannerContainer from '@/components/common/Banner/WelcomeBanner/Wel
99
interface ActiveBannerSlotProps {}
1010

1111
const ActiveBannerSlot: FC<ActiveBannerSlotProps> = ({}) => {
12-
const isTimecapsopOpen = true; // 타임캡솝 오픈 기간에만 이 값을 true로 변경
12+
const isTimecapsopOpen = false; // 타임캡솝 오픈 기간에만 이 값을 true로 변경
1313
const { data: myData } = useGetMemberOfMe();
14-
const isBalanceGameOpen = true;
14+
const isBalanceGameOpen = false;
1515

1616
return (
1717
<StyledActiveBanner>

src/components/common/HomePopup/HomePopupContainer.tsx

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,42 @@ const HomePopupContainer = () => {
1313
const { data: homePopupData } = useGetHomePopup();
1414
const isLastGeneration = myData?.generation === LATEST_GENERATION;
1515

16-
// if (!homePopupData || typeof homePopupData === 'string') {
17-
// return null;
18-
// }
16+
if (!homePopupData || typeof homePopupData === 'string') {
17+
return null;
18+
}
1919

20-
// const { startDate, endDate, pcImageUrl, mobileImageUrl, linkUrl, openInNewTab, showOnlyToRecentGeneration } =
21-
// homePopupData;
20+
const { startDate, endDate, pcImageUrl, mobileImageUrl, linkUrl, openInNewTab, showOnlyToRecentGeneration } =
21+
homePopupData;
2222

23-
// // 팝업 표시 기간 설정
24-
// const now = new Date();
25-
// const popupStart = new Date(`${startDate}T00:00:00+09:00`);
26-
// const popupEnd = new Date(`${endDate}T23:59:59+09:00`);
27-
// const isWithinPeriod = now >= popupStart && now <= popupEnd;
23+
// 팝업 표시 기간 설정
24+
const now = new Date();
25+
const popupStart = new Date(`${startDate}T00:00:00+09:00`);
26+
const popupEnd = new Date(`${endDate}T23:59:59+09:00`);
27+
const isWithinPeriod = now >= popupStart && now <= popupEnd;
2828

29-
// 팝업 표시 기간이 아닌 경우
30-
// if (!isWithinPeriod) {
31-
// return null;
32-
// }
29+
//팝업 표시 기간이 아닌 경우
30+
if (!isWithinPeriod) {
31+
return null;
32+
}
3333

34-
// 최신 기수만 보기 옵션이 활성화인 경우
35-
// if (showOnlyToRecentGeneration && !isLastGeneration) {
36-
// return null;
37-
// }
34+
//최신 기수만 보기 옵션이 활성화인 경우
35+
if (showOnlyToRecentGeneration && !isLastGeneration) {
36+
return null;
37+
}
3838

3939
if (!isLastGeneration) {
4040
return null;
4141
}
4242

4343
return (
4444
<>
45-
{/* <HomePopup
45+
<HomePopup
4646
pcImageUrl={pcImageUrl}
4747
mobileImageUrl={mobileImageUrl}
4848
linkUrl={linkUrl}
4949
openInNewTab={openInNewTab}
50-
/> */}
51-
<HomePopup
52-
pcImageUrl="/icons/img/popup/PC.png"
53-
mobileImageUrl="/icons/img/popup/MO.png"
54-
openInNewTab={false}
5550
/>
51+
{/* <HomePopup pcImageUrl='/icons/img/popup/PC.png' mobileImageUrl='/icons/img/popup/MO.png' openInNewTab={false} /> */}
5652
</>
5753
);
5854
};

src/components/common/HomePopup/index.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const HomePopup = ({ pcImageUrl, mobileImageUrl, linkUrl, openInNewTab }:
8686
// 타입캡솝 모달 띄우기
8787
const handleOpenModal = async () => {
8888
await handleClosePopup();
89-
onOpenResolutionModal();
89+
handleResolutionModalOpen();
9090
};
9191

9292
const handleClickPopup = () => {
@@ -99,11 +99,11 @@ export const HomePopup = ({ pcImageUrl, mobileImageUrl, linkUrl, openInNewTab }:
9999
}
100100
};
101101

102-
const {
103-
isOpen: isOpenReadResolutionModal,
104-
onClose: onCloseReadResolutionModal,
105-
onOpen: onOpenResolutionModal,
106-
} = useModalState();
102+
// const {
103+
// isOpen: isOpenReadResolutionModal,
104+
// onClose: onCloseReadResolutionModal,
105+
// onOpen: onOpenResolutionModal,
106+
// } = useModalState();
107107

108108
return (
109109
<>
@@ -113,14 +113,14 @@ export const HomePopup = ({ pcImageUrl, mobileImageUrl, linkUrl, openInNewTab }:
113113
<StPopupModal>
114114
<Responsive only='desktop'>
115115
<LoggingClick eventKey='adPopupBody'>
116-
<StButton onClick={handleOpenModal}>
116+
<StButton onClick={handleClickPopup}>
117117
<StImage src={pcImageUrl} />
118118
</StButton>
119119
</LoggingClick>
120120
</Responsive>
121121
<Responsive only='mobile'>
122122
<LoggingClick eventKey='adPopupBody'>
123-
<StButton onClick={handleOpenModal}>
123+
<StButton onClick={handleClickPopup}>
124124
<StImage src={mobileImageUrl} />
125125
</StButton>
126126
</LoggingClick>
@@ -139,7 +139,7 @@ export const HomePopup = ({ pcImageUrl, mobileImageUrl, linkUrl, openInNewTab }:
139139
)}
140140

141141
{/* 타임캡솝 결과 모달 */}
142-
<ResolutionReadModal isOpen={isOpenReadResolutionModal} onClose={onCloseReadResolutionModal} />
142+
{/* <ResolutionReadModal isOpen={isOpenReadResolutionModal} onClose={onCloseReadResolutionModal} /> */}
143143

144144
{/* 신입 기수 들어올 때 타임캡솝 이동 및 플그 가이드 모달 띄우기 */}
145145
<TimecapsopSubmitModal

0 commit comments

Comments
 (0)