diff --git a/src/pages/RollingPaper/RollingPaperPage.jsx b/src/pages/RollingPaper/RollingPaperPage.jsx index daf85a6..8c6bf9e 100644 --- a/src/pages/RollingPaper/RollingPaperPage.jsx +++ b/src/pages/RollingPaper/RollingPaperPage.jsx @@ -8,16 +8,16 @@ import styled from "styled-components"; import recipientsService from "../../api/services/recipientsService"; // get 요청 const CardContainer = styled.div` - margin: auto; + width: min(100%, 1200px); + margin-inline: auto; + padding: 0 24px; + box-sizing: border-box; display: flex; align-items: center; justify-content: center; - padding: 100px 24px; - width: 100%; - box-sizing: border-box; - @media (max-width: 768px) { - background-attachment: scroll; + @media (max-width: 1248px) { + padding: 0 24px; } `; @@ -25,11 +25,16 @@ const DivWrap = styled.div` display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; + padding-top: 112px; @media (max-width: 1248px) { grid-template-columns: repeat(2, 1fr); } + @media (max-width: 768px) { + grid-template-columns: 1fr; + } + opacity: ${({ isLoaded }) => (isLoaded ? 1 : 0)}; transition: opacity 0.5s ease-in-out; `; @@ -47,7 +52,7 @@ const BackgroundWrap = styled.div` background-attachment: fixed; @media (max-width: 768px) { - grid-template-columns: 1fr; + background-attachment: scroll; } `; @@ -58,7 +63,6 @@ const colorMap = { green: "#D0F5C3", }; - function RollingPaperDetailPage() { const { id } = useParams(); const [loading, setLoading] = useState(true); @@ -89,10 +93,8 @@ function RollingPaperDetailPage() { if (id) fetchInitialData(); }, [id]); - - // 메시지 로드 함수 -const loadMoreMessages = async () => { + const loadMoreMessages = async () => { if (!nextUrl || isFetchingRef.current) return; isFetchingRef.current = true; try { @@ -116,7 +118,6 @@ const loadMoreMessages = async () => { return () => observer.disconnect(); }, [messages]); - useEffect(() => { setTimeout(() => setIsLoaded(true), 100); }, []);