Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions src/pages/RollingPaper/RollingPaperPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,33 @@ 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;
}
`;

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;
`;
Expand All @@ -47,7 +52,7 @@ const BackgroundWrap = styled.div`
background-attachment: fixed;

@media (max-width: 768px) {
grid-template-columns: 1fr;
background-attachment: scroll;
}
`;

Expand All @@ -58,7 +63,6 @@ const colorMap = {
green: "#D0F5C3",
};


function RollingPaperDetailPage() {
const { id } = useParams();
const [loading, setLoading] = useState(true);
Expand Down Expand Up @@ -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 {
Expand All @@ -116,7 +118,6 @@ const loadMoreMessages = async () => {
return () => observer.disconnect();
}, [messages]);


useEffect(() => {
setTimeout(() => setIsLoaded(true), 100);
}, []);
Expand Down
Loading