Skip to content

Commit

Permalink
Merge pull request #169 from softeerbootcamp4th/feat/#168/MiniQuizRes…
Browse files Browse the repository at this point in the history
…ultModal

Feat/#168/mini quiz result modal
  • Loading branch information
subsub-e authored Aug 23, 2024
2 parents 9ad0d52 + 8711dec commit 8053d11
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 23 deletions.
2 changes: 1 addition & 1 deletion service/public/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<priority>0.8</priority>
</url>
<url>
<loc>https://casper-event.store/introduce</loc>
<loc>https://casper-event.store/intro</loc>
<lastmod>2024-08-21</lastmod>
<priority>0.6</priority>
</url>
Expand Down
4 changes: 2 additions & 2 deletions service/src/components/header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function Header() {
const { userInfo, setUserInfo } = useContext(AuthContext);
const [openPhoneInputModal, setOpenPhoneInputModal] = useState(false);
const textColor =
useLocation().pathname === '/introduce'
useLocation().pathname === '/intro'
? 'text-neutral-white'
: 'text-neutral-black';

Expand Down Expand Up @@ -65,7 +65,7 @@ function Header() {
이벤트 참여하기
</NavLink>
<NavLink
to="introduce"
to="intro"
className={({ isActive }) =>
`text-nowrap pr-[44px] ${textColor} ${
isActive
Expand Down
1 change: 0 additions & 1 deletion service/src/components/modal/GetItemModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ function GetItemModal({ close, item }) {
setUserInfo(updatedUserInfo);
navigate('/event');
} else {
console.log(userInfo);
const updatedUserInfo = { ...userInfo, toolBoxCnt: toolBoxCnt + 1 };
setUserInfo(updatedUserInfo);
close();
Expand Down
2 changes: 1 addition & 1 deletion service/src/pages/eventIntro/EventIntroMain.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function EventIntroMain() {
</p>
</button>
</Link>
<Link to="introduce">
<Link to="intro">
<button className="flex items-center justify-center bg-transparent rounded-full px-1000 py-500 border-[2px] border-solid border-neutral-black hover:scale-105 duration-200">
<p className="text-neutral-black text-detail-2-semibold">
캐스퍼 EV 알아보기
Expand Down
3 changes: 2 additions & 1 deletion service/src/pages/eventIntro/EventIntroRewards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function EventIntroRewards() {
const fetchInfo = async () => {
try {
const data = await getPrizeInfo();
console.log(data);
if (Array.isArray(data)) {
setInfo(data);
} else {
Expand Down Expand Up @@ -46,7 +47,7 @@ function EventIntroRewards() {
응모에 많이 참여할 수록 당첨 확률이 높아져요.
</p>
<p className="text-detail-3-semibold text-primary-blue">
1등 당첨자 발표: nnnn.nn.nn nn시
1등 당첨자 발표: 2024.08.29 13시
</p>
</div>
<div>
Expand Down
14 changes: 9 additions & 5 deletions service/src/pages/miniquiz/MiniQuizResultMain.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ function MiniQuizResultMain({ response }) {
const [userGotPrize, setUserGotPrize] = useState(false);
const [toolBoxModal, setToolBoxModal] = useState(false);
const [orderModal, setOrderModal] = useState(false);
let correctMessage = '정답입니다!';

useEffect(() => {
const check = async () => {
Expand Down Expand Up @@ -53,9 +52,6 @@ function MiniQuizResultMain({ response }) {
return <div>예상치 못한 오류가 발생했습니다.</div>; // MiniQuizResult에 navigate state로 전달된 값이 잘못되었을 때
}

if (successOrder <= 500 && !userGotPrize)
correctMessage = successOrder + '번째 ' + correctMessage;

return (
<>
{isCorrect ? (
Expand All @@ -70,7 +66,15 @@ function MiniQuizResultMain({ response }) {
선착순 당첨
</div>
</div>
<div className="py-500 text-body-1-bold mb-400">{correctMessage}</div>
<div className="flex gap-500">
{successOrder <= 500 && !userGotPrize && (
<span className="py-500 text-body-1-bold mb-400">
{successOrder + '번째 '}
</span>
)}

<span className="py-500 text-body-1-bold mb-400"> 정답입니다!</span>
</div>
</>
) : (
<>
Expand Down
5 changes: 1 addition & 4 deletions service/src/pages/newCarIntro/NewCarIntro.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ function NewCarIntro() {
<Helmet>
<title>캐스퍼 EV 소개</title>
<meta name="description" content="캐스퍼 EV에 대해 알아보세요!" />
<meta
property="og:url"
content="https://casper-event.store/introduce"
/>
<meta property="og:url" content="https://casper-event.store/introd" />
<meta property="og:title" content="캐스퍼 EV 소개" />
<meta
property="og:description"
Expand Down
2 changes: 1 addition & 1 deletion service/src/router.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const router = createBrowserRouter([
],
},
{
path: 'introduce',
path: 'intro',
element: <NewCarIntro />,
},
],
Expand Down
8 changes: 1 addition & 7 deletions service/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ export default defineConfig({
react(),
svgr(),
prerender({
routes: [
'/',
'/event',
'/event/worldCup',
'/event/miniQuiz',
'/introduce',
],
routes: ['/', '/event', '/event/worldCup', '/event/miniQuiz', '/intro'],
renderer: '@prerenderer/renderer-puppeteer',
rendererOptions: {
maxConcurrentRoutes: 1,
Expand Down

0 comments on commit 8053d11

Please sign in to comment.