- {items.length === 0 ? (
+ {visibleItems.length === 0 ? (
상품이 없습니다.
) : (
- displayItems.map((item) => (
+ visibleItems.map((item) => (
))
)}
@@ -33,20 +56,26 @@ const CardListWrapper = styled.div`
size === "large"
? `
grid-template-columns: repeat(4, 1fr); // 베스트 상품 (기본)
- @media (max-width: 768px) {
- grid-template-columns: repeat(2, 1fr); // 태블릿
+ @media (max-width: ${BREAKPOINTS.LAPTOP}) {
+ grid-template-columns: repeat(3, 1fr);
+ }
+ @media (max-width: ${BREAKPOINTS.TABLET}px) {
+ grid-template-columns: repeat(2, 1fr);
}
- @media (max-width: 480px) {
- grid-template-columns: repeat(1, 1fr); // 모바일
+ @media (max-width: ${BREAKPOINTS.MOBILE}px) {
+ grid-template-columns: repeat(1, 1fr);
}
`
: `
grid-template-columns: repeat(5, 1fr); // 전체 상품 (기본)
- @media (max-width: 768px) {
- grid-template-columns: repeat(3, 1fr); // 태블릿
+ @media (max-width: ${BREAKPOINTS.LAPTOP}px) {
+ grid-template-columns: repeat(4, 1fr);
+ }
+ @media (max-width: ${BREAKPOINTS.TABLET}px) {
+ grid-template-columns: repeat(3, 1fr);
}
- @media (max-width: 480px) {
- grid-template-columns: repeat(2, 1fr); // 모바일
+ @media (max-width: ${BREAKPOINTS.MOBILE}px) {
+ grid-template-columns: repeat(2, 1fr);
}
`}
`;
diff --git a/src/components/common/Input.jsx b/src/components/common/Input.jsx
new file mode 100644
index 00000000..27ff7641
--- /dev/null
+++ b/src/components/common/Input.jsx
@@ -0,0 +1,23 @@
+import styled from "styled-components";
+import theme from "../../styles/theme";
+
+export default function Input({ placeholder, value, onChange, ...props }) {
+ return (
+
+ );
+}
+
+const StyledInput = styled.input`
+ width: 100%;
+ padding: 16px 24px;
+ gap: 10px;
+ border: none;
+ border-radius: 12px;
+ background-color: ${theme.colors.Gray100};
+ font: ${theme.fonts.H5Regular};
+`;
diff --git a/src/constants/constants.js b/src/constants/constants.js
new file mode 100644
index 00000000..310f57e6
--- /dev/null
+++ b/src/constants/constants.js
@@ -0,0 +1,5 @@
+export const BREAKPOINTS = {
+ MOBILE: 480,
+ TABLET: 768,
+ LAPTOP: 1024,
+};
diff --git a/src/pages/AddItemPage/AddItemPage.css b/src/pages/AddItemPage/AddItemPage.css
deleted file mode 100644
index e69de29b..00000000
diff --git a/src/pages/AddItemPage/AddItemPage.jsx b/src/pages/AddItemPage/AddItemPage.jsx
index e7ba934c..f943f21b 100644
--- a/src/pages/AddItemPage/AddItemPage.jsx
+++ b/src/pages/AddItemPage/AddItemPage.jsx
@@ -1,7 +1,70 @@
-import React from "react";
+// AddItemPage.jsx
+import * as S from "./AddItemPage.styles";
+import { useState, useEffect } from "react";
+import Input from "../../components/common/Input";
+import ImageUploader from "../../components/ImageUploader";
+import TagInput from "../../components/TagInput";
-function AddItemPage() {
- return AddItemPage
;
-}
+export default function AddItemPage() {
+ const [productName, setProductName] = useState("");
+ const [description, setDescription] = useState("");
+ const [price, setPrice] = useState("");
+ const [tags, setTags] = useState([]);
+ const [isFormValid, setIsFormValid] = useState(false);
+
+ useEffect(() => {
+ setIsFormValid(
+ productName.trim() !== "" &&
+ description.trim() !== "" &&
+ Number(price) > 0 &&
+ tags.length > 0
+ );
+ }, [productName, description, price, tags]);
+
+ return (
+
+
+
+ 상품 등록하기
+
+ 등록
+
+
+
+
+ 상품 이미지
+
+
-export default AddItemPage;
+ 상품명
+ setProductName(e.target.value)}
+ />
+
+ 상품 소개
+ setDescription(e.target.value)}
+ style={{ height: "282px", overflowY: "auto" }}
+ />
+
+ 판매가격
+ setPrice(e.target.value)}
+ />
+
+ 태그
+
+
+
+ );
+}
diff --git a/src/pages/AddItemPage/AddItemPage.styles.jsx b/src/pages/AddItemPage/AddItemPage.styles.jsx
new file mode 100644
index 00000000..946b1694
--- /dev/null
+++ b/src/pages/AddItemPage/AddItemPage.styles.jsx
@@ -0,0 +1,47 @@
+import styled from "styled-components";
+import theme from "../../styles/theme";
+
+export const Container = styled.div`
+ max-width: 1200px;
+ margin: 0 auto;
+ padding: 40px;
+ display: flex;
+ flex-direction: column;
+ gap: 24px;
+`;
+
+export const AddHeader = styled.div`
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: space-between;
+`;
+
+export const Wrapper = styled.div`
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+`;
+
+export const Title = styled.div`
+ font: ${theme.fonts.H3Bold};
+`;
+
+export const SubmitBtn = styled.button`
+ width: 74px;
+ height: 42px;
+ background-color: ${({ $isActive }) =>
+ $isActive ? theme.colors.Primary200 : theme.colors.Gray400};
+ font: ${theme.fonts.H5Regular};
+ color: ${theme.colors.Gray100};
+ border: none;
+ border-radius: 8px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ cursor: pointer;
+`;
+
+export const SubTitle = styled.div`
+ font: ${theme.fonts.H4Bold};
+`;
diff --git a/src/pages/MarketPage/ItemsHeader.jsx b/src/pages/MarketPage/ItemsHeader.jsx
index 104272ca..967bae40 100644
--- a/src/pages/MarketPage/ItemsHeader.jsx
+++ b/src/pages/MarketPage/ItemsHeader.jsx
@@ -59,8 +59,7 @@ const SearchInput = styled.input`
border-radius: 12px;
width: 325px;
height: 42px;
- /* position: fixed; */
- /* flex-grow: 1; */
+
color: ${theme.colors.Gray400};
font: ${theme.fonts.H5Bold};