Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/common/Banner/ActiveBannerSlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import WelcomeBannerContainer from '@/components/common/Banner/WelcomeBanner/Wel
interface ActiveBannerSlotProps {}

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

return (
<StyledActiveBanner>
Expand Down
44 changes: 20 additions & 24 deletions src/components/common/HomePopup/HomePopupContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,42 @@ const HomePopupContainer = () => {
const { data: homePopupData } = useGetHomePopup();
const isLastGeneration = myData?.generation === LATEST_GENERATION;

// if (!homePopupData || typeof homePopupData === 'string') {
// return null;
// }
if (!homePopupData || typeof homePopupData === 'string') {
return null;
}

// const { startDate, endDate, pcImageUrl, mobileImageUrl, linkUrl, openInNewTab, showOnlyToRecentGeneration } =
// homePopupData;
const { startDate, endDate, pcImageUrl, mobileImageUrl, linkUrl, openInNewTab, showOnlyToRecentGeneration } =
homePopupData;

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

// 팝업 표시 기간이 아닌 경우
// if (!isWithinPeriod) {
// return null;
// }
//팝업 표시 기간이 아닌 경우
if (!isWithinPeriod) {
return null;
}

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

if (!isLastGeneration) {
return null;
}

return (
<>
{/* <HomePopup
<HomePopup
pcImageUrl={pcImageUrl}
mobileImageUrl={mobileImageUrl}
linkUrl={linkUrl}
openInNewTab={openInNewTab}
/> */}
<HomePopup
pcImageUrl="/icons/img/popup/PC.png"
mobileImageUrl="/icons/img/popup/MO.png"
openInNewTab={false}
/>
{/* <HomePopup pcImageUrl='/icons/img/popup/PC.png' mobileImageUrl='/icons/img/popup/MO.png' openInNewTab={false} /> */}
</>
);
};
Expand Down
18 changes: 9 additions & 9 deletions src/components/common/HomePopup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const HomePopup = ({ pcImageUrl, mobileImageUrl, linkUrl, openInNewTab }:
// 타입캡솝 모달 띄우기
const handleOpenModal = async () => {
await handleClosePopup();
onOpenResolutionModal();
handleResolutionModalOpen();
};

const handleClickPopup = () => {
Expand All @@ -99,11 +99,11 @@ export const HomePopup = ({ pcImageUrl, mobileImageUrl, linkUrl, openInNewTab }:
}
};

const {
isOpen: isOpenReadResolutionModal,
onClose: onCloseReadResolutionModal,
onOpen: onOpenResolutionModal,
} = useModalState();
// const {
// isOpen: isOpenReadResolutionModal,
// onClose: onCloseReadResolutionModal,
// onOpen: onOpenResolutionModal,
// } = useModalState();

return (
<>
Expand All @@ -113,14 +113,14 @@ export const HomePopup = ({ pcImageUrl, mobileImageUrl, linkUrl, openInNewTab }:
<StPopupModal>
<Responsive only='desktop'>
<LoggingClick eventKey='adPopupBody'>
<StButton onClick={handleOpenModal}>
<StButton onClick={handleClickPopup}>
<StImage src={pcImageUrl} />
</StButton>
</LoggingClick>
</Responsive>
<Responsive only='mobile'>
<LoggingClick eventKey='adPopupBody'>
<StButton onClick={handleOpenModal}>
<StButton onClick={handleClickPopup}>
<StImage src={mobileImageUrl} />
</StButton>
</LoggingClick>
Expand All @@ -139,7 +139,7 @@ export const HomePopup = ({ pcImageUrl, mobileImageUrl, linkUrl, openInNewTab }:
)}

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

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