From 38093c3741981a96305113003f3a87fa8d1d77a4 Mon Sep 17 00:00:00 2001 From: lybell-art Date: Mon, 12 Aug 2024 18:38:27 +0900 Subject: [PATCH] =?UTF-8?q?[chore]=20=EB=A6=B0=ED=8A=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=ED=94=84=EB=A6=AC=ED=8B=B0=EC=96=B4=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.js | 18 ++++++------- src/adminPage/App.jsx | 8 ++++-- src/adminPage/main-client.jsx | 25 +++++++++++-------- src/common/constants.js | 2 +- src/common/dataFetch/tokenSaver.js | 3 ++- src/common/modal/modal.jsx | 10 ++++---- src/common/utils.js | 2 +- .../interactions/modal/InteractionAnswer.jsx | 2 +- .../interactions/modal/InteractionModal.jsx | 2 +- src/mainPage/features/introSection/index.jsx | 5 ++-- .../simpleInformation/contentSection.jsx | 5 +++- .../shared/realtimeEvent/getEventDateState.js | 2 +- src/mainPage/shared/scroll/constants.js | 2 +- 13 files changed, 48 insertions(+), 38 deletions(-) diff --git a/build.js b/build.js index 3e9142c6..57d04ea4 100644 --- a/build.js +++ b/build.js @@ -1,6 +1,7 @@ import { build } from "vite"; -import { parse, resolve, dirname } from "node:path"; +import { resolve, dirname } from "node:path"; import { fileURLToPath } from "node:url"; +import process from "node:process"; import { readFile, writeFile, rm, mkdir } from "node:fs/promises"; import config from "./vite.config.js"; @@ -30,14 +31,12 @@ const buildConfig = { }, } -async function processBuild(mode) -{ +async function processBuild(mode) { await Promise.all([buildClient(mode), buildSSG(mode)]); await injectSSGToHtml(mode); } -async function buildClient(mode) -{ +async function buildClient(mode) { await build({ ...config, build: { @@ -54,8 +53,7 @@ async function buildClient(mode) await rm(toAbsolute(`dist/${mode}/mockServiceWorker.js`)); } -function buildSSG(mode) -{ +function buildSSG(mode) { return build({ ...config, build: { @@ -72,8 +70,7 @@ function buildSSG(mode) }); } -async function injectSSGToHtml(mode) -{ +async function injectSSGToHtml(mode) { console.log("--ssg result--"); const {default: render} = await import(`./dist-ssg/${mode}/entry.js`); const template = await readFile(`dist/${mode}/${buildConfig[mode].clientEntry}`, "utf-8"); @@ -89,8 +86,7 @@ async function injectSSGToHtml(mode) await mkdir(dir, { recursive: true }); await writeFile(absolutePath, html); console.log(`pre-rendered : ${path}`); - } - catch { + } catch { console.log(`pre-rendered failed : ${path}`); } } ); diff --git a/src/adminPage/App.jsx b/src/adminPage/App.jsx index 45f81d71..68a41729 100644 --- a/src/adminPage/App.jsx +++ b/src/adminPage/App.jsx @@ -4,7 +4,11 @@ function App() { return ( <> - event 생성 화면} /> + event 생성 화면} + /> event 보는 화면} /> 이벤트 목록 화면} /> 기대평 화면} /> @@ -16,4 +20,4 @@ function App() { ); } -export default App; \ No newline at end of file +export default App; diff --git a/src/adminPage/main-client.jsx b/src/adminPage/main-client.jsx index 54ade981..b7b99f54 100644 --- a/src/adminPage/main-client.jsx +++ b/src/adminPage/main-client.jsx @@ -16,17 +16,22 @@ if (import.meta.env.DEV) { }; enableMocking().then(() => { const root = createRoot($root); - root.render( - - - - ); + root.render( + + + + + , + ); }); } else { // 배포 시 - hydrateRoot($root, - - - - ); + hydrateRoot( + $root, + + + + + , + ); } diff --git a/src/common/constants.js b/src/common/constants.js index 609e51e2..15bb2edb 100644 --- a/src/common/constants.js +++ b/src/common/constants.js @@ -1,3 +1,3 @@ export const EVENT_ID = "0"; export const SERVICE_TOKEN_ID = "AWESOME_ORANGE_ACCESS_TOKEN"; -export const ADMIN_TOKEN_ID = "AWESOME_ORANGE_ADMIN_ACCESS_TOKEN"; \ No newline at end of file +export const ADMIN_TOKEN_ID = "AWESOME_ORANGE_ADMIN_ACCESS_TOKEN"; diff --git a/src/common/dataFetch/tokenSaver.js b/src/common/dataFetch/tokenSaver.js index 8bd9ae3d..ae1404bf 100644 --- a/src/common/dataFetch/tokenSaver.js +++ b/src/common/dataFetch/tokenSaver.js @@ -15,7 +15,8 @@ class TokenSaver { } set(token) { this.token = token; - if (typeof window !== "undefined") localStorage.setItem(this.tokenId, token); + if (typeof window !== "undefined") + localStorage.setItem(this.tokenId, token); this.initialzed = true; } has(tokenId = this.tokenId) { diff --git a/src/common/modal/modal.jsx b/src/common/modal/modal.jsx index d98f9b4e..138a8d92 100644 --- a/src/common/modal/modal.jsx +++ b/src/common/modal/modal.jsx @@ -10,15 +10,15 @@ function Modal({ layer }) { const child = useModalStore(layer); const [opacity, setOpacity] = useState(0); const close = useCallback(() => { - return new Promise( (resolve)=>{ + return new Promise((resolve) => { setOpacity(0); - + if (timeoutRef.current !== null) return resolve(); - timeoutRef.current = setTimeout( ()=>{ + timeoutRef.current = setTimeout(() => { closeModal(layer); resolve(); - }, 150 ); - } ); + }, 150); + }); }, [layer]); useEffect(() => { diff --git a/src/common/utils.js b/src/common/utils.js index 7b80d1a6..23a251cb 100644 --- a/src/common/utils.js +++ b/src/common/utils.js @@ -28,5 +28,5 @@ export function convertSecondsToString(time) { } export function delay(ms) { - return new Promise( resolve=>setTimeout(resolve, ms) ); + return new Promise((resolve) => setTimeout(resolve, ms)); } diff --git a/src/mainPage/features/interactions/modal/InteractionAnswer.jsx b/src/mainPage/features/interactions/modal/InteractionAnswer.jsx index 60b15e59..fb05ec65 100644 --- a/src/mainPage/features/interactions/modal/InteractionAnswer.jsx +++ b/src/mainPage/features/interactions/modal/InteractionAnswer.jsx @@ -6,7 +6,7 @@ import AuthModal from "@main/auth/AuthModal.jsx"; import openModal from "@common/modal/openModal.js"; import Button from "@common/components/Button.jsx"; -import style from "./InteractionAnswer.module.css" +import style from "./InteractionAnswer.module.css"; // import useEventStore from "@main/realtimeEvent/store"; export default function InteractionAnswer({ diff --git a/src/mainPage/features/interactions/modal/InteractionModal.jsx b/src/mainPage/features/interactions/modal/InteractionModal.jsx index 9730b6b0..61debf67 100644 --- a/src/mainPage/features/interactions/modal/InteractionModal.jsx +++ b/src/mainPage/features/interactions/modal/InteractionModal.jsx @@ -4,7 +4,7 @@ import InteractionAnswer from "./InteractionAnswer.jsx"; import { ModalCloseContext } from "@common/modal/modal.jsx"; import Suspense from "@common/components/Suspense.jsx"; import Button from "@common/components/Button.jsx"; -import ResetButton from "@main/components/ResetButton.jsx" +import ResetButton from "@main/components/ResetButton.jsx"; import userStore from "@main/auth/store.js"; diff --git a/src/mainPage/features/introSection/index.jsx b/src/mainPage/features/introSection/index.jsx index 19ad230e..f7bcb2aa 100644 --- a/src/mainPage/features/introSection/index.jsx +++ b/src/mainPage/features/introSection/index.jsx @@ -7,7 +7,6 @@ import style from "./index.module.css"; import SpinningCarVideo from "./car-spin.webm"; import Pointer from "./pointer.svg"; - function IntroSection() { const videoRef = useRef(null); const introRef = useRef(null); @@ -106,7 +105,9 @@ function IntroSection() { 더뉴 아이오닉5 신차 출시 이벤트 - 09/09 (mon) - 09/13 (fri) + + 09/09 (mon) - 09/13 (fri) +
diff --git a/src/mainPage/features/simpleInformation/contentSection.jsx b/src/mainPage/features/simpleInformation/contentSection.jsx index 575821e2..c197dc72 100644 --- a/src/mainPage/features/simpleInformation/contentSection.jsx +++ b/src/mainPage/features/simpleInformation/contentSection.jsx @@ -58,7 +58,10 @@ export default function ContentSection({ content }) {
-

+

{makeHighlight(content.desc, style.highlightAnim)}

diff --git a/src/mainPage/shared/realtimeEvent/getEventDateState.js b/src/mainPage/shared/realtimeEvent/getEventDateState.js index 7ad0d42c..c0b1b9ef 100644 --- a/src/mainPage/shared/realtimeEvent/getEventDateState.js +++ b/src/mainPage/shared/realtimeEvent/getEventDateState.js @@ -6,4 +6,4 @@ export default function getEventDateState(currrentTimeDate, eventTimeDate) { if (currentTime < eventTime) return "default"; if (currentTime < eventEndTime) return "active"; return "ended"; -} \ No newline at end of file +} diff --git a/src/mainPage/shared/scroll/constants.js b/src/mainPage/shared/scroll/constants.js index 8c87183b..c8b8bc20 100644 --- a/src/mainPage/shared/scroll/constants.js +++ b/src/mainPage/shared/scroll/constants.js @@ -3,4 +3,4 @@ export const OTHER_SECTION = 0; export const INTERACTION_SECTION = 1; export const DETAIL_SECTION = 2; export const COMMENT_SECTION = 3; -export const FCFS_SECTION = 4; \ No newline at end of file +export const FCFS_SECTION = 4;