From 54b17f0fcb9618715bcf7130418c8b9b2c0ad962 Mon Sep 17 00:00:00 2001 From: subsub-e Date: Thu, 22 Aug 2024 18:46:32 +0900 Subject: [PATCH] [feat] react helmet, react prerender add --- service/src/App.jsx | 13 +++++---- service/src/pages/eventIntro/EventIntro.jsx | 17 +++++++++++ .../src/pages/joinEvent/JoinEventIntro.jsx | 18 ++++++++++++ service/src/pages/miniquiz/MiniQuiz.jsx | 21 ++++++++++++++ service/src/pages/newCarIntro/NewCarIntro.jsx | 18 ++++++++++++ service/src/pages/worldCup/WorldCupMain.jsx | 21 ++++++++++++++ service/vite.config.js | 29 ++++++++++++++++++- 7 files changed, 131 insertions(+), 6 deletions(-) diff --git a/service/src/App.jsx b/service/src/App.jsx index 01fed5e..d4f24e4 100644 --- a/service/src/App.jsx +++ b/service/src/App.jsx @@ -3,6 +3,7 @@ import { AuthProvider } from '@/context/authContext'; import Header from '@/components/header/Header'; import Footer from '@/components/footer/Footer'; import { Outlet, useLocation } from 'react-router-dom'; +import { HelmetProvider } from 'react-helmet-async'; function App() { const location = useLocation(); @@ -40,11 +41,13 @@ function App() { return (
- - {!hideHeader &&
} - - - {!hideFooter &&
} + + + {!hideHeader &&
} + + + {!hideFooter &&
} +
); } diff --git a/service/src/pages/eventIntro/EventIntro.jsx b/service/src/pages/eventIntro/EventIntro.jsx index 377a927..7be0f83 100644 --- a/service/src/pages/eventIntro/EventIntro.jsx +++ b/service/src/pages/eventIntro/EventIntro.jsx @@ -4,10 +4,27 @@ import EventIntroNav from '@/pages/eventIntro/EventIntroNav'; import EventIntroRewards from '@/pages/eventIntro/EventIntroRewards'; import { animationVariants } from '@/styles/FramerMotion'; import { motion } from 'framer-motion'; +import { Helmet } from 'react-helmet-async'; function EventIntro() { return (
+ + 캐스퍼 이벤트 소개 + + + + +
diff --git a/service/src/pages/joinEvent/JoinEventIntro.jsx b/service/src/pages/joinEvent/JoinEventIntro.jsx index 58943a2..85b2ec3 100644 --- a/service/src/pages/joinEvent/JoinEventIntro.jsx +++ b/service/src/pages/joinEvent/JoinEventIntro.jsx @@ -5,12 +5,30 @@ import JoinEventIntroMain from '@/pages/joinEvent/JoinEventIntroMain'; import WorldCup from '@/pages/joinEvent/WorldCup'; import MiniQuiz from '@/pages/joinEvent/MiniQuiz'; import useScroll from '@/hooks/useScroll'; +import { Helmet } from 'react-helmet-async'; function JoinEventIntro() { const { refs } = useScroll(); return ( <> + + 캐스퍼 이벤트 참여 + + + + + +
diff --git a/service/src/pages/miniquiz/MiniQuiz.jsx b/service/src/pages/miniquiz/MiniQuiz.jsx index 3f834db..9f3f36b 100644 --- a/service/src/pages/miniquiz/MiniQuiz.jsx +++ b/service/src/pages/miniquiz/MiniQuiz.jsx @@ -2,6 +2,7 @@ import React, { useState } from 'react'; import EventHeader from '@/components/header/EventHeader'; import ExitModal from '@/components/modal/ExitModal'; import MiniQuizMain from '@/pages/miniquiz/MiniQuizMain'; +import { Helmet } from 'react-helmet-async'; function MiniQuiz() { const [openExitModal, setOpenExitModal] = useState(false); @@ -11,6 +12,26 @@ function MiniQuiz() { return ( <>
+ + 캐스퍼 미니퀴즈 + + + + + + + + 캐스퍼 EV 소개 + + + + + +
diff --git a/service/src/pages/worldCup/WorldCupMain.jsx b/service/src/pages/worldCup/WorldCupMain.jsx index 7359332..73eda63 100644 --- a/service/src/pages/worldCup/WorldCupMain.jsx +++ b/service/src/pages/worldCup/WorldCupMain.jsx @@ -4,6 +4,7 @@ import worldCupData from '@/constants/worldCup/worldCupData'; import { useNavigate } from 'react-router-dom'; import shuffleArr from '@/utils/shuffleArr'; import { postWorldCupResult } from '@/api/worldCup/index'; +import { Helmet } from 'react-helmet-async'; const WorldCupMain = () => { const navigate = useNavigate(); @@ -65,6 +66,26 @@ const WorldCupMain = () => { return (
+ + 캐스퍼 상황 월드컵 + + + + + +