diff --git a/src/interactions/GiftDetail.jsx b/src/interactions/GiftDetail.jsx index cc9fd1ac..02e39fe3 100644 --- a/src/interactions/GiftDetail.jsx +++ b/src/interactions/GiftDetail.jsx @@ -3,19 +3,19 @@ import Star from "./star.svg?react"; export default function GiftDetail({ contentList }) { return (
- 경품 안내 + 경품 안내 {contentList.map((content, index) => (
경품
- + {content.name} {content.num}명 - + {content.desc}
diff --git a/src/interactions/InteractionAnswer.jsx b/src/interactions/InteractionAnswer.jsx index b491669d..f3cbd335 100644 --- a/src/interactions/InteractionAnswer.jsx +++ b/src/interactions/InteractionAnswer.jsx @@ -1,16 +1,39 @@ -import userStore from "@/auth/store.js"; import scrollTo from "@/scroll/scrollTo"; import style from "./InteractionAnswer.module.css"; -import { useState } from "react"; +import { useEffect, useState } from "react"; +import openModal from "@/modal/openModal.js"; +import AuthModal from "@/auth/AuthModal.jsx"; +// import fcfsStore from "@/fcfs/store"; export default function InteractionAnswer({ isAnswerUp, setIsAnswerUp, answer, close, + isLogin, }) { - const isLogin = userStore((state) => state.isLogin); + // const currentServerTime = fcfsStore((state) => state.currentServerTime); const [isAniPlaying, setIsAniPlaying] = useState(false); + const [isEventToday, setIsEventToday] = useState(false); + const [isJoined, setIsJoined] = useState(false); + const authModal = ( + { + /* + * 비로그인자가 정보등록을 성공시켰을 때 서버로 추첨이벤트 참여 api를 보내는 코드 미구현 + */ + }} + /> + ); + + useEffect(() => { + /* + * 서버에서 해당 날짜의 사용자 응모 여부와, 시간을 받아온 후 이벤트 날짜와 비교하는 코드 미구현 + */ + + setIsEventToday(true); + setIsJoined(false); + }, []); function onClickWrite() { close(); @@ -21,8 +44,11 @@ export default function InteractionAnswer({ setIsAniPlaying(true); /* - * 서버에서 받아온 단축 url을 클립보드에 복사하는 코드 미구현 + * 서버에서 단축 url을 받아오는 코드 미구현 */ + + const simpleURL = "https://youtu.be/KMU0tzLwhbE"; + navigator.clipboard.writeText(simpleURL); } return ( @@ -38,19 +64,20 @@ export default function InteractionAnswer({ -
- +
+ {answer.head} +
- {answer.desc} + {answer.desc} - {answer.subdesc} + {answer.subdesc}
@@ -58,13 +85,17 @@ export default function InteractionAnswer({ {isLogin ? ( <> - 오늘 응모가 완료되었습니다! + {isJoined + ? "오늘 응모가 완료되었습니다!" + : "응모 기간이 지났습니다!"}
-
- +
+ 당첨확률 UP! @@ -73,7 +104,7 @@ export default function InteractionAnswer({ @@ -81,14 +112,17 @@ export default function InteractionAnswer({
) : ( - )} diff --git a/src/interactions/InteractionModal.jsx b/src/interactions/InteractionModal.jsx index db5d22be..32179d43 100644 --- a/src/interactions/InteractionModal.jsx +++ b/src/interactions/InteractionModal.jsx @@ -2,6 +2,7 @@ import Suspense from "@/common/Suspense.jsx"; import { ModalCloseContext } from "@/modal/modal.jsx"; import { lazy, useContext, useRef, useState } from "react"; import InteractionAnswer from "./InteractionAnswer"; +import userStore from "@/auth/store.js"; const lazyInteractionList = [ lazy(() => import("./distanceDriven")), @@ -17,15 +18,25 @@ export default function InteractionModal({ index, answer }) { const [isActive, setIsActive] = useState(false); const [isAnswerUp, setIsAnswerUp] = useState(false); const interactionRef = useRef(null); + const isLogin = userStore((state) => state.isLogin); if (!InteractionComponent) return <>; + function joinEvent() { + setIsAnswerUp(true); + if (isLogin) { + /* + * 로그인 유저가 서버로 추첨이벤트 참여 api 전송하는 코드 미구현 + */ + } + } + return ( Loading...
}>
@@ -37,16 +48,16 @@ export default function InteractionModal({ index, answer }) {
@@ -57,6 +68,7 @@ export default function InteractionModal({ index, answer }) { setIsAnswerUp={setIsAnswerUp} answer={answer} close={close} + isLogin={isLogin} />
diff --git a/src/interactions/InteractionSlide.jsx b/src/interactions/InteractionSlide.jsx index 24dafef1..72903cbb 100644 --- a/src/interactions/InteractionSlide.jsx +++ b/src/interactions/InteractionSlide.jsx @@ -6,7 +6,7 @@ export default function InteractionSlide({ index, isCurrent, joined, - swiperRef, + slideTo, answer, }) { const activeImgPath = `active${index + 1}.png`; @@ -35,10 +35,10 @@ export default function InteractionSlide({ return (
swiperRef.current.swiper.slideTo(index)} - className="w-full h-full flex flex-col items-center select-none" + onClick={() => slideTo(index)} + className="w-full h-full flex flex-col justify-center items-center select-none" > - + {eventDate()} @@ -46,7 +46,7 @@ export default function InteractionSlide({ {interactionDesc} @@ -55,9 +55,9 @@ export default function InteractionSlide({ @@ -76,7 +76,7 @@ export default function InteractionSlide({ activeImage
); diff --git a/src/interactions/IntroductionDetail.jsx b/src/interactions/IntroductionDetail.jsx index 8972b129..09e6f2bb 100644 --- a/src/interactions/IntroductionDetail.jsx +++ b/src/interactions/IntroductionDetail.jsx @@ -1,17 +1,17 @@ export default function IntroductionDetail({ contentList }) { return (
- + 상세 안내 -
+
이벤트 기간 - 2024년 + 2024년 - + 09월09일(월)~13일(금)
@@ -21,12 +21,12 @@ export default function IntroductionDetail({ contentList }) { 당첨자 발표 - + 2024년 9월 말 {` (예정)`} - + * 추후 응모 시 입력한 연락처로 개별 안내
@@ -37,14 +37,14 @@ export default function IntroductionDetail({ contentList }) { {contentList.map((contentSubList, index) => (
- + {index + 1} {contentSubList.map((content, index) => ( {content} diff --git a/src/interactions/TapBar.jsx b/src/interactions/TapBar.jsx index 3ada2767..75925c56 100644 --- a/src/interactions/TapBar.jsx +++ b/src/interactions/TapBar.jsx @@ -5,11 +5,11 @@ export default function TapBar({ currentInteraction, joinedList, swiperRef }) { EVENT 1 - + The 새로워진 IONIQ 5, 인터랙션으로 만나다 - + {`The new IONIQ 5의 새로운 기능을 날마다 체험하고 이벤트에 응모하세요!\n추첨을 통해 IONIQ과 함께하는 제주 여행 패키지를 드립니다`} diff --git a/src/interactions/index.jsx b/src/interactions/index.jsx index 1382228d..f6aa04da 100644 --- a/src/interactions/index.jsx +++ b/src/interactions/index.jsx @@ -18,7 +18,7 @@ export default function InteractionPage() { return (
{JSONData.interaction.map((interactionDesc, index) => ( - + swiperRef.current.swiper.slideTo(_index)} answer={JSONData.answer[index]} /> ))} -
+