diff --git a/components/productdetail/LikeButton.tsx b/components/productdetail/LikeButton.tsx
index 17187f24d..22bc6f007 100644
--- a/components/productdetail/LikeButton.tsx
+++ b/components/productdetail/LikeButton.tsx
@@ -1,8 +1,8 @@
import React, { useState } from "react";
-import { ReactComponent as Heart } from "../../../image/ic_heart.svg";
+import Heart from "@/public/images/ic_heart.svg";
interface LikeButtonProps {
- productId: string;
+ productId: number;
isFavorite: boolean;
favoriteCount: number;
}
diff --git a/components/ui/DeleteButton.tsx b/components/ui/DeleteButton.tsx
index 8693e93f1..19618dba3 100644
--- a/components/ui/DeleteButton.tsx
+++ b/components/ui/DeleteButton.tsx
@@ -1,5 +1,6 @@
import React from "react";
-import CloseIcon from "../public/images/ic_close.svg";
+import CloseIcon from "@/public/images/ic_close.svg";
+import Image from "next/image";
interface DeleteButtonProps {
onClick: () => void;
@@ -9,7 +10,7 @@ interface DeleteButtonProps {
function DeleteButton({ onClick, label }: DeleteButtonProps) {
return (
);
}
diff --git a/components/ui/Dropdown.tsx b/components/ui/Dropdown.tsx
index a3b2ff9e9..e618f54f6 100644
--- a/components/ui/Dropdown.tsx
+++ b/components/ui/Dropdown.tsx
@@ -1,6 +1,6 @@
import React, { useState } from "react";
// import "./Dropdown.css";
-// import SortIcon from "../../public/images/ic_sort.svg";
+import SortIcon from "../../public/images/ic_sort.svg";
import Image from "next/image";
interface DropdownProps {
@@ -18,12 +18,7 @@ function Dropdown({ onSortSelection, sortOptions }: DropdownProps) {
return (
{isDropdownView && (
diff --git a/components/ui/ImageUpload.tsx b/components/ui/ImageUpload.tsx
index 3d9e3ecc4..59ea4853d 100644
--- a/components/ui/ImageUpload.tsx
+++ b/components/ui/ImageUpload.tsx
@@ -1,6 +1,6 @@
import React, { useRef, useState } from "react";
// import { useEffect } from "react";
-import PlusIcon from "../public/images/ic_plus.svg";
+import PlusIcon from "@/public/images/ic_plus.svg";
import DeleteButton from "./DeleteButton";
import Image from "next/image";
@@ -60,7 +60,7 @@ const ImageUpload = ({ title }: ImageUploadProps) => {
>
diff --git a/components/ui/Pagination.tsx b/components/ui/Pagination.tsx
index 762df54d4..cd305195e 100644
--- a/components/ui/Pagination.tsx
+++ b/components/ui/Pagination.tsx
@@ -2,7 +2,7 @@ import React from "react";
import Left from "@/public/images/left.svg";
import Right from "@/public/images/right.svg";
import "../../styles/Pagination.module.css";
-// import Image from "next/image";
+import Image from "next/image";
interface PaginationProps {
totalPageNum: number;
@@ -37,7 +37,7 @@ export default function Pagination({
disabled={activePageNum === 1}
onClick={() => onPageChange(activePageNum - 1)}
>
-
+
{/*
*/}
{pages.map((page) => (
@@ -56,7 +56,7 @@ export default function Pagination({
disabled={activePageNum === totalPageNum}
onClick={() => onPageChange(activePageNum + 1)}
>
-
+
{/*
*/}
diff --git a/components/ui/Search.tsx b/components/ui/Search.tsx
index 11e35f55c..1b8e35d75 100644
--- a/components/ui/Search.tsx
+++ b/components/ui/Search.tsx
@@ -1,6 +1,7 @@
import SearchIcon from "@/public/images/ic_search.svg";
import { useEffect, useState } from "react";
import { useRouter } from "next/router";
+import Image from "next/image";
interface SearchProps {
onSearch: (keyword: string) => void;
@@ -31,7 +32,7 @@ const Search = ({
return (
-
+
{
+ const [product, setProduct] = useState
(null);
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState(null);
- const { productId } = useParams();
+ const router = useRouter();
+ const { id } = router.query;
+
+ const productId = Number(id);
useEffect(() => {
async function fetchProduct() {
@@ -24,12 +28,12 @@ export default function ProductDetail() {
setIsLoading(true);
try {
- const data = await getDetailComments(productId);
+ const data: Product = await getDetailComments(productId);
if (!data) {
throw new Error("해당 상품의 데이터를 찾을 수 없습니다.");
}
setProduct(data);
- } catch (error) {
+ } catch (error: any) {
setError(error.message);
} finally {
setIsLoading(false);
@@ -63,9 +67,17 @@ export default function ProductDetail() {
{/* 목록으로 돌아가기 버튼 */}
목록으로 돌아가기
-
+
);
-}
+};
+
+export default ItemPage;
diff --git a/pages/addboard/index.tsx b/pages/addboard/index.tsx
new file mode 100644
index 000000000..18e93fdef
--- /dev/null
+++ b/pages/addboard/index.tsx
@@ -0,0 +1,49 @@
+import ImageUpload from "@/components/ui/ImageUpload";
+import InputItem from "@/components/ui/InputItem";
+import { FormEvent, useState } from "react";
+
+const AddBoard = () => {
+ const [title, setTitle] = useState("");
+ const [content, setContent] = useState("");
+
+ // 이미지 제외 모든 input에 값이 입력
+ const isSubmit = !title.trim() || !content.trim();
+
+ const handleSubmit = (e: FormEvent) => {
+ e.preventDefault();
+ };
+
+ return (
+
+ );
+};
+
+export default AddBoard;
diff --git a/pages/board/index.tsx b/pages/board/index.tsx
index 42b5d5ea7..276604b38 100644
--- a/pages/board/index.tsx
+++ b/pages/board/index.tsx
@@ -1,30 +1,65 @@
-import React from "react";
+import React, { useEffect, useState } from "react";
import BestArticle from "@/components/board/BestArticle";
import AllArticle from "@/components/board/AllArticle";
import { Article, ArticleList } from "@/types/Types";
-export async function getServerSideProps() {
- const response = await fetch(
- `https://panda-market-api.vercel.app/articles?orderBy=recent`
- );
- const data: ArticleList = await response.json();
+// export async function getStaticProps() {
+// const response = await fetch(
+// `https://panda-market-api.vercel.app/articles?orderBy=recent`
+// );
+// const data: ArticleList = await response.json();
- return {
- props: {
- initialArticles: data.list,
- },
- };
-}
+// return {
+// props: {
+// initialArticles: data.list,
+// },
+// };
+// }
-interface BoardsPageProps {
- initialArticles: Article[];
-}
+// interface BoardsPageProps {
+// initialArticles: Article[];
+// }
+
+// export default function BoardsPage({ initialArticles }: BoardsPageProps) {
+// return (
+//
+// );
+// }
+
+export default function BoardsPage() {
+ const [articles, setArticles] = useState