diff --git a/src/apis/monthlyChartApi.js b/src/apis/monthlyChartApi.js index a5f7f58..041eca4 100644 --- a/src/apis/monthlyChartApi.js +++ b/src/apis/monthlyChartApi.js @@ -18,9 +18,14 @@ export async function getLists(gender, cursor = 0, pageSize) { } } -export async function postVotes() { +export async function postVotes(idolId) { try { - const res = await instance.post('/votes'); + const loadData = { idolId }; + const res = await instance.post('/votes', loadData, { + headers: { + 'Content-Type': 'application/json', + }, + }); return res.data; } catch (error) { console.error(error); diff --git a/src/components/Modal.jsx b/src/components/Modal.jsx index 5305d40..6ec390b 100644 --- a/src/components/Modal.jsx +++ b/src/components/Modal.jsx @@ -1,9 +1,11 @@ import closeButton from '@/assets/icons/closeButton.svg'; import leftTopGradient from '@/assets/images/leftTopGradient.png'; import exitArrow from '@/assets/icons/exitArrow.svg'; -import { useEffect } from 'react'; +import { useEffect, useState } from 'react'; function Modal({ title, onClose, children }) { + const [isMobile, setIsMobile] = useState(false); + useEffect(() => { document.body.style.overflow = 'hidden'; // 모달창 열려 있으면 뒤의 배경 스크롤 막기 return () => { @@ -11,15 +13,25 @@ function Modal({ title, onClose, children }) { }; }, []); - if (title.includes('아이돌') && window.innerWidth <= 375) { + useEffect(() => { + const handleResize = () => { + setIsMobile(window.innerWidth < 768); + }; + + window.addEventListener('resize', handleResize); + handleResize(); + return () => window.removeEventListener('resize', handleResize); + }, []); + + if (title.includes('아이돌') && isMobile) { return ( -
+
투표하는 데 1000 크레딧이 소모됩니다.
diff --git a/src/index.css b/src/index.css index 25fd95e..b52abc0 100644 --- a/src/index.css +++ b/src/index.css @@ -6,3 +6,14 @@ html, body { @apply bg-midnightBlack; } + +@layer utilities { + .scrollbar-hidden { + scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* IE 10+ */ + } + + .scrollbar-hidden::-webkit-scrollbar { + display: none; /* Chrome, Safari, Edge */ + } +} diff --git a/src/pages/listPage/ListPage.jsx b/src/pages/listPage/ListPage.jsx index a0fa469..16fa895 100644 --- a/src/pages/listPage/ListPage.jsx +++ b/src/pages/listPage/ListPage.jsx @@ -111,7 +111,9 @@ function ListPage() { {modalStep === 'donationSuccess' && (