먼저 피드백부터 수정 후 UI 간단 정렬하기 미션을 진행한다.
<aside> 💡
</aside>
스타일링을 위해 SearchPage.jsx 내부에 직접 스타일을 작성하지 않고, 별도의 SearchPageStyled.js 파일을 생성하여 import하는 방식을 선택했다. 이는 코드의 간결성과 역할 구분을 위한 결정이었다.
import styled from "styled-components";
export const SearchWrapper = styled.div`
padding: 20px;
`;
export const ResultsContainer = styled.div`
display: flex;
flex-wrap: wrap;
gap: 8px;
`;
**export const ImageItem = styled.div`
width: calc(33.3333% - 5.333px);
`;**
export const Image = styled.img`
width: 100%;
height: 100%;
object-fit: cover;
aspect-ratio: 1 / 1;
`;
export const LoadingText = styled.div`
text-align: center;
margin-top: 20px;
`;
export const ErrorText = styled.div`
color: red;
text-align: center;
margin-top: 20px;
`;
export const ScrollArea = styled.div`
text-align: center;
margin-top: 20px;
`;
각 스타일 컴포넌트의 역할과 CSS 속성에 대한 설명:
width 계산에 대한 설명:
원래 calc(33.3333% - 8px)에서 calc(33.3333% - 5.333px)로 변경된 이유는 다음과 같습니다: