-

+
@@ -114,7 +114,7 @@ function HomePage() {
-

+
diff --git a/src/Pages/ProductDetailPage/ProductDetailPage.js b/src/Pages/ProductDetailPage/ProductDetailPage.js
new file mode 100644
index 000000000..93d548ea0
--- /dev/null
+++ b/src/Pages/ProductDetailPage/ProductDetailPage.js
@@ -0,0 +1,39 @@
+import { useEffect, useState } from "react";
+import { useParams } from "react-router-dom";
+import ProductDetail from "../../Components/ProductDetail/ProductDetail";
+import ItemListNav from "../../Components/App/ItemsListNav";
+import InquiryRegister from "../../Components/ProductDetail/InquiryRegister";
+import { createComment, getComments, getProductId } from "../../Api/api";
+
+function ProductDetailPage() {
+ const [productData, setProductData] = useState("");
+ const [commentsData, setCommentsData] = useState("");
+ const [comment, setComment] = useState("");
+
+ const params = useParams();
+ const productId = params.id;
+
+ // API
+ useEffect(() => {
+ getProductId(productId, setProductData);
+ }, []);
+
+ useEffect(() => {
+ getComments(productId, setCommentsData);
+ }, []);
+
+ // 로그인 기능 구현 전이므로 코멘트 API POST 구현 보류 (24.12.08)
+ // useEffect(() => {
+ // createComment(productId, comment);
+ // });
+
+ return (
+ <>
+
+
+
+ >
+ );
+}
+
+export default ProductDetailPage;
diff --git a/src/Pages/ProductListPage/ItemsListPage.js b/src/Pages/ProductListPage/ProductListPage.js
similarity index 70%
rename from src/Pages/ProductListPage/ItemsListPage.js
rename to src/Pages/ProductListPage/ProductListPage.js
index bb28aa7ee..c4438b37a 100644
--- a/src/Pages/ProductListPage/ItemsListPage.js
+++ b/src/Pages/ProductListPage/ProductListPage.js
@@ -1,17 +1,17 @@
import { useState } from "react";
-import styles from "../../Styles/ProductList/ProductList.module.css";
-import ItemListNav from "../../Components/App/ItemListNav";
-import HandlePagiNation from "../../Components/App/Pagination";
-import { BestItemsList } from "../../Components/ProductList/BestItem";
-import GeneralItemsList from "../../Components/ProductList/GeneralItem";
+import styles from "../../styles/productList/productList.module.css";
+import { BestItemsList } from "../../Components/ProductList/BestItemsList";
+import ItemsListNav from "../../Components/App/ItemsListNav";
+import PaginationComponents from "../../Components/App/Pagination";
+import GeneralItemsList from "../../Components/ProductList/GeneralItemsList";
-function ItemsListPage() {
+function ProductList() {
const [page, setPage] = useState(1);
const [pageCount, setPageCount] = useState(1);
const [isDataCount, setIsDataCount] = useState();
return (
<>
-
+
-
-
+
>
);
diff --git a/src/Styles/App/Reset.css b/src/Styles/App/Reset.css
index c8410d26e..c78b3a4f7 100644
--- a/src/Styles/App/Reset.css
+++ b/src/Styles/App/Reset.css
@@ -3,41 +3,41 @@
/* 폰트 */
/* rokaf */
@font-face {
- src: url("../../Assets/fonts/rokaf/ROKAF-Sans-Medium.ttf") format("truetype");
+ src: url("../../assets/fonts/rokaf/ROKAF-Sans-Medium.ttf") format("truetype");
font-family: "Rokaf";
font-weight: 500;
}
@font-face {
- src: url("../../Assets/fonts/rokaf/ROKAF-Sans-Bold.ttf") format("truetype");
+ src: url("../../assets/fonts/rokaf/ROKAF-Sans-Bold.ttf") format("truetype");
font-family: "Rokaf";
font-weight: 700;
}
/* pretendard */
@font-face {
- src: url("../../Assets/fonts/pretendard/Pretendard-Light.woff") format("woff");
+ src: url("../../assets/fonts/pretendard/Pretendard-Light.woff") format("woff");
font-family: "pretendard";
font-weight: 300;
}
@font-face {
- src: url("../../Assets/fonts/pretendard/Pretendard-Regular.woff")
+ src: url("../../assets/fonts/pretendard/Pretendard-Regular.woff")
format("woff");
font-family: "pretendard";
font-weight: 400;
}
@font-face {
- src: url("../../Assets/fonts/pretendard/Pretendard-Medium.woff")
+ src: url("../../assets/fonts/pretendard/Pretendard-Medium.woff")
format("woff");
font-family: "pretendard";
font-weight: 500;
}
@font-face {
- src: url("../../Assets/fonts/pretendard/Pretendard-SemiBold.woff")
+ src: url("../../assets/fonts/pretendard/Pretendard-SemiBold.woff")
format("woff");
font-family: "pretendard";
font-weight: 600;
}
@font-face {
- src: url("../../Assets/fonts/pretendard/Pretendard-Bold.woff") format("woff");
+ src: url("../../assets/fonts/pretendard/Pretendard-Bold.woff") format("woff");
font-family: "pretendard";
font-weight: 700;
}
@@ -57,6 +57,7 @@
--gray-50: #f9fafb;
--gray-100: #f3f4f6;
--gray-200: #e5e7eb;
+ --gray-300: #d1d5db;
--gray-400: #9ca3af;
--gray-500: #6b7280;
--gray-600: #4b5563;
@@ -244,6 +245,6 @@ body {
overflow-y: auto;
font-weight: normal;
font-size: 10px;
- color: var(--balck);
+ color: var(--black);
font-family: "pretendard";
}
diff --git a/src/Styles/ProductDetail/ProductDetail.module.css b/src/Styles/ProductDetail/ProductDetail.module.css
new file mode 100644
index 000000000..17f581b2a
--- /dev/null
+++ b/src/Styles/ProductDetail/ProductDetail.module.css
@@ -0,0 +1,386 @@
+/* 공통 */
+.emptyTopBox {
+ margin-top: 69px;
+}
+.pagiContainer {
+ /* Default */
+ padding: 0 200px;
+
+ /* 1920 이상 */
+ @media (min-width: 1920px) {
+ padding: 0;
+ max-width: 1110px;
+ margin: 69px auto 0;
+ }
+ /* Tablet, Mobile */
+ @media (max-width: 1199px) {
+ padding: 0 24px;
+ }
+}
+.commentContainer {
+ margin-top: 0;
+}
+
+/* 상품 디테일 */
+.section1 {
+ padding: 30px 0 40px;
+ border-bottom: 1px solid var(--gray-200);
+ -webkit-display: flex;
+ display: flex;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+
+ /* Mobile */
+ @media (max-width: 768px) {
+ -webkit-display: flex;
+ display: flex;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ }
+}
+
+.productImg {
+ position: relative;
+ flex: 1;
+ max-width: calc(100vw * (486 / 1920));
+ min-width: 250px;
+ height: max-content;
+ margin-right: 25px;
+ border-radius: 10px;
+ border: 1px solid var(--gray-50);
+ box-sizing: border-box;
+ overflow: hidden;
+
+ /* Mobile */
+ @media (max-width: 768px) {
+ max-width: 100%;
+ margin-right: 0;
+ margin-bottom: 15px;
+ }
+}
+
+.productImg:after {
+ content: "";
+ display: block;
+ padding-bottom: 100%;
+}
+
+.productImg img {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ object-fit: cover;
+}
+
+.descriptionContainer {
+ -webkit-display: flex;
+ display: flex;
+ -webkit-flex-direction: column;
+ flex-direction: column;
+ justify-content: space-between;
+ flex: 1;
+}
+
+.descriptionContainer .cover {
+ -webkit-display: flex;
+ display: flex;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+ align-items: center;
+ padding-top: 60px;
+}
+
+.titleCover {
+ position: relative;
+ border-bottom: 1px solid var(--gray-200);
+}
+
+.titleCover .title {
+ font-size: 2.4em;
+ font-weight: 500;
+
+ /* Mobile */
+ @media (max-width: 768px) {
+ font-size: 1.6em;
+ }
+}
+
+.titleCover .price {
+ padding: 15px 0;
+ font-size: 4em;
+ font-weight: 500;
+
+ /* Mobile */
+ @media (max-width: 768px) {
+ font-size: 2.4em;
+ }
+}
+
+.titleCover img {
+ position: absolute;
+ right: -10px;
+ top: 0;
+}
+
+.btnMore {
+ cursor: pointer;
+}
+
+.subTitle {
+ padding: 25px 0 15px;
+ font-size: 1.6em;
+ font-weight: 500;
+ color: var(--gray-600);
+}
+
+.description {
+ font-size: 1.6em;
+ font-weight: 300;
+ color: var(--gray-600);
+ white-space: pre-line;
+ word-break: keep-all;
+}
+
+.tagsCover ul {
+ -webkit-display: flex;
+ display: flex;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+ flex-wrap: wrap;
+ gap: 8px;
+}
+
+.tagsCover li {
+ height: 36px;
+ line-height: 36px;
+ padding: 0 15px;
+ box-sizing: border-box;
+ border-radius: 26px;
+ font-size: 1.6em;
+ font-weight: 400;
+ background: var(--gray-100);
+ color: var(--gray-800);
+}
+
+.owner {
+ -webkit-dispaly: flex;
+ display: flex;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+ flex: 1;
+ align-items: center;
+ border-right: 1px solid var(--gray-200);
+ font-size: 1.4em;
+}
+
+.profileImg {
+ max-width: 40px;
+ max-height: 40px;
+ border-radius: 50%;
+ overflow: hidden;
+ margin-right: 15px;
+}
+
+.profileImg img {
+ min-height: 32px;
+ object-fit: cover;
+}
+
+.author .profileImg {
+ max-width: 32px;
+ max-height: 32px;
+}
+
+.owner .nickName {
+ font-weight: 500;
+ color: var(--gray-600);
+}
+
+.owner .date {
+ margin-top: 2px;
+ font-weight: 400;
+ color: var(--gray-400);
+}
+
+.favoritCount {
+ height: 40px;
+ -webkit-dispaly: flex;
+ display: flex;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+ align-items: center;
+ margin-left: 25px;
+ padding: 0 12px;
+ border: 1px solid var(--gray-200);
+ border-radius: 35px;
+}
+
+.favoritCount .count {
+ margin-left: 5px;
+ font-size: 1.6em;
+ font-weight: 500;
+ color: var(--gray-500);
+}
+
+.section2 {
+ padding-bottom: calc(env(safe-area-inset-bottom) + 50px);
+}
+
+.section2 .subTitle {
+ display: block;
+ padding: 40px 0 10px;
+ color: var(--gray-900);
+}
+
+textarea {
+ width: 100%;
+ min-height: calc(100vh * (105 / 1200));
+ padding: 15px 25px;
+ border: 0;
+ border-radius: 12px;
+ background: var(--gray-100);
+ color: var(--gray-400);
+ line-height: 1.5;
+}
+
+textarea::placeholder {
+ color: var(--gray-400);
+}
+
+.btnSubmit {
+ display: inline-block;
+ height: 42px;
+ float: right;
+ margin: 15px 0 24px;
+ padding: 3px 25px 0;
+ border-radius: 8px;
+ transition: 0.3s;
+ font-size: 1.6em;
+ font-weight: 400;
+ color: var(--white);
+ cursor: pointer;
+ background: var(--primary);
+}
+
+.btnSubmit:hover {
+ /* PC */
+ @media (min-width: 1200px) {
+ background: var(--primary-foreground);
+ }
+}
+
+.btnSubmit:disabled {
+ background: var(--gray-400);
+}
+
+.commentList {
+ clear: both;
+}
+
+/* 코멘트 */
+.commentList li {
+ position: relative;
+ padding: 12px 0 25px;
+ border-bottom: 1px solid var(--gray-200);
+}
+
+.contentText {
+ -webkit-display: flex;
+ display: flex;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+ justify-content: space-between;
+}
+
+.contentText p {
+ margin-bottom: 25px;
+ font-size: 1.4em;
+ font-weight: 300;
+}
+
+.contentText textarea {
+ margin-bottom: 15px;
+}
+
+.author {
+ -webkit-display: flex;
+ display: flex;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+ align-items: center;
+ padding: 5px 0;
+ font-size: 1.2em;
+ font-weight: 300;
+}
+
+.author .nickName {
+ margin-bottom: 5px;
+ color: var(--gray-600);
+}
+
+.author .date {
+ color: var(--gray-400);
+}
+
+.btnCover {
+ margin-top: calc(100vw * (60 / 1200));
+ justify-items: center;
+}
+
+.btnBack {
+ -webkit-display: flex;
+ display: flex;
+ -webkit-flex-direction: row;
+ flex-direction: row;
+ align-items: center;
+ padding: 0 40px;
+ border-radius: 40px;
+ height: 48px;
+ line-height: 48px;
+ font-size: 1.8em;
+ background: var(--primary);
+ color: var(--white);
+ cursor: pointer;
+ transition: 0.3s;
+}
+
+.btnBack:hover {
+ /* PC */
+ @media (min-width: 1200px) {
+ background: var(--primary-foreground);
+ }
+}
+
+.btnBack img {
+ margin-left: 5px;
+}
+
+.emptyComment {
+ clear: both;
+ justify-items: center;
+}
+
+.editContainer {
+ position: absolute;
+ right: 0;
+ bottom: 25px;
+ font-size: 1.6em;
+}
+
+.editContainer button {
+ height: 42px;
+ font-weight: 400;
+ cursor: pointer;
+}
+
+.editContainer button:first-child {
+ color: var(--gray-500);
+}
+
+.editContainer button:last-child {
+ margin-left: 10px;
+ padding: 0 23px;
+ border-radius: 8px;
+ background: var(--primary);
+ color: var(--white);
+}
diff --git a/src/Styles/ProductDetail/SelectBox.js b/src/Styles/ProductDetail/SelectBox.js
new file mode 100644
index 000000000..3c7501fb4
--- /dev/null
+++ b/src/Styles/ProductDetail/SelectBox.js
@@ -0,0 +1,22 @@
+import styled from "styled-components";
+
+export const SelectBox = styled.div`
+ position: absolute;
+ right: 0;
+ top: 40px;
+ border: 1px solid var(--gray-300);
+ border-radius: 10px;
+ z-index: 1;
+ background: var(--white);
+`;
+
+export const SelectButton = styled.div`
+ padding: 15px 40px;
+ color: var(--gray-500);
+ font-size: 1.6em;
+ cursor: pointer;
+
+ &:first-child {
+ border-bottom: 1px solid var(--gray-300);
+ }
+`;
diff --git a/src/Styles/ProductList/ProductList.module.css b/src/Styles/ProductList/ProductList.module.css
index 912c46150..6fff7e12b 100644
--- a/src/Styles/ProductList/ProductList.module.css
+++ b/src/Styles/ProductList/ProductList.module.css
@@ -274,7 +274,7 @@
min-width: 42px;
padding: 10px 0;
box-sizing: border-box;
- content: url("../../Assets/images/productList/pd_sort.svg");
+ content: url("../../assets/images/productList/pd_sort.svg");
}
}
diff --git a/src/Styles/ProductRgs/ProductRgs.module.css b/src/Styles/ProductRgs/ProductRgs.module.css
index 1a234e3df..e9b03688d 100644
--- a/src/Styles/ProductRgs/ProductRgs.module.css
+++ b/src/Styles/ProductRgs/ProductRgs.module.css
@@ -39,6 +39,7 @@
font-size: 1.6em;
font-weight: 500;
cursor: pointer;
+ transition: 0.3s;
}
.btnSubmit:disabled {
diff --git a/src/Styles/Registration/Registration.module.css b/src/Styles/Registration/Registration.module.css
deleted file mode 100644
index e69de29bb..000000000
diff --git a/src/utils/calculatorPagination.js b/src/utils/calculatorPagination.js
new file mode 100644
index 000000000..c9604aa79
--- /dev/null
+++ b/src/utils/calculatorPagination.js
@@ -0,0 +1,13 @@
+export function calculatePagination({
+ page,
+ pageCount,
+ isDataCount,
+ ITEMS_PER_PAGINATION,
+}) {
+ const totalPages = Math.ceil(pageCount / isDataCount);
+ const currentSet = Math.ceil(page / ITEMS_PER_PAGINATION);
+ const startPage = (currentSet - 1) * ITEMS_PER_PAGINATION + 1;
+ const endPage = Math.min(startPage + ITEMS_PER_PAGINATION - 1, totalPages);
+
+ return { totalPages, currentSet, startPage, endPage };
+}
diff --git a/src/utils/calculatormediaQuery.js b/src/utils/calculatormediaQuery.js
new file mode 100644
index 000000000..59000c546
--- /dev/null
+++ b/src/utils/calculatormediaQuery.js
@@ -0,0 +1,13 @@
+import { useMediaQuery } from "react-responsive";
+
+function CalculatorMediaQuery() {
+ const isTablet = useMediaQuery({
+ query: "(max-width: 1200px)",
+ });
+ const isMobile = useMediaQuery({
+ query: "(max-width: 768px)",
+ });
+ return { isTablet, isMobile };
+}
+
+export default CalculatorMediaQuery;
diff --git a/src/Components/App/EmailValidation.js b/src/utils/emailValidation.js
similarity index 66%
rename from src/Components/App/EmailValidation.js
rename to src/utils/emailValidation.js
index 1c0048485..ad8b4f402 100644
--- a/src/Components/App/EmailValidation.js
+++ b/src/utils/emailValidation.js
@@ -2,7 +2,10 @@
function emailCheck(email) {
let regex =
/([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
- return email !== "" && email !== "undefined" && regex.test(email);
+
+ if (email === "") return false;
+ if (email === "undefined") return false;
+ return regex.test(email);
}
export default emailCheck;