diff --git a/package-lock.json b/package-lock.json index 81c272f..9a34c25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "vite-plugin-svgr": "^2.2.1" }, "devDependencies": { + "@tailwindcss/line-clamp": "^0.4.2", "@types/react": "^18.0.17", "@types/react-dom": "^18.0.6", "@vitejs/plugin-react": "^2.1.0", @@ -845,6 +846,15 @@ "node": ">=6" } }, + "node_modules/@tailwindcss/line-clamp": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/line-clamp/-/line-clamp-0.4.2.tgz", + "integrity": "sha512-HFzAQuqYCjyy/SX9sLGB1lroPzmcnWv1FHkIpmypte10hptf4oPUfucryMKovZh2u0uiS9U5Ty3GghWfEJGwVw==", + "dev": true, + "peerDependencies": { + "tailwindcss": ">=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1" + } + }, "node_modules/@types/hoist-non-react-statics": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", @@ -5694,6 +5704,13 @@ "defer-to-connect": "^1.0.1" } }, + "@tailwindcss/line-clamp": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/line-clamp/-/line-clamp-0.4.2.tgz", + "integrity": "sha512-HFzAQuqYCjyy/SX9sLGB1lroPzmcnWv1FHkIpmypte10hptf4oPUfucryMKovZh2u0uiS9U5Ty3GghWfEJGwVw==", + "dev": true, + "requires": {} + }, "@types/hoist-non-react-statics": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", diff --git a/package.json b/package.json index fb47701..d9eb119 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "vite-plugin-svgr": "^2.2.1" }, "devDependencies": { + "@tailwindcss/line-clamp": "^0.4.2", "@types/react": "^18.0.17", "@types/react-dom": "^18.0.6", "@vitejs/plugin-react": "^2.1.0", diff --git a/src/App.jsx b/src/App.jsx index cfbdad8..fb6c85e 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -35,6 +35,8 @@ import Notice from './pages/Notice' import Faq from './pages/Faq' import CategoryFashion from './components/Category' import MainCategory from './pages/Category/MainCategory' +import AfterSearch from './pages/Search/AfterSearch' +import BeforeSearch from './pages/Search/BeforeSearch' function App() { const location = useLocation() @@ -78,7 +80,8 @@ function App() { } /> }> - + } /> + } /> } /> diff --git a/src/components/CardList/Card.jsx b/src/components/CardList/Card.jsx new file mode 100644 index 0000000..e64b0df --- /dev/null +++ b/src/components/CardList/Card.jsx @@ -0,0 +1,56 @@ +import React from 'react' +import { cls } from '../../utils' +import heart from '/public/assets/heart-on.svg' + +function Card({ data, purchase }) { + const { brand, productName, thumbnail, price, sale } = data + const saleCost = parseInt((price * (100 - sale)) / 100) + + return ( +
+
+
+ {productName} +
+ {!purchase && ( +
+ heart +
+ )} +
+
+
+
+ {brand} +
+
+ {productName} +
+ {!purchase && ( +
{price} ¥
+ )} +
+ {!purchase && ( +
+
{sale}%
+
{saleCost} ¥
+
+ )} +
+
+ ) +} + +export default Card diff --git a/src/components/Category/Container.jsx b/src/components/CardList/Container.jsx similarity index 70% rename from src/components/Category/Container.jsx rename to src/components/CardList/Container.jsx index 8c7d35c..4d72e6d 100644 --- a/src/components/Category/Container.jsx +++ b/src/components/CardList/Container.jsx @@ -1,12 +1,12 @@ import React, { useState } from 'react' import Card from './Card' -import { likedList } from '~/dummy/liked' +import product from '~/dummy/dummy/product.json' -function Container() { +function Container({ list }) { return (
- {likedList.map((item, idx) => ( + {list.map((item, idx) => ( ))}
diff --git a/src/components/Category/Card.jsx b/src/components/Category/Card.jsx deleted file mode 100644 index 8b31226..0000000 --- a/src/components/Category/Card.jsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react' -import heart from '/public/assets/heart-on.svg' - -function Card({ data }) { - const { brand, productName, image, price, sale } = data - const saleCost = parseInt((price * (100 - sale)) / 100) - - return ( -
-
-
- kirsh product -
-
- heart -
-
-
-
-
{brand}
-
- {productName} -
-
{price} ¥
-
-
-
{sale}%
-
{saleCost} ¥
-
-
-
- ) -} - -export default Card diff --git a/src/components/Category/CategoryList.jsx b/src/components/Category/CategoryList.jsx index 575430b..77aaaca 100644 --- a/src/components/Category/CategoryList.jsx +++ b/src/components/Category/CategoryList.jsx @@ -1,4 +1,5 @@ import React from 'react' +import { useMemo } from 'react' import { useEffect } from 'react' import { useState } from 'react' import { useSelector } from 'react-redux' @@ -13,10 +14,11 @@ function CategoryList({ topCG, subCG }) { const [subCategoryList, setSubCategoryList] = useState([]) const [lastCategoryList, setLastSubCategoryList] = useState([]) const userGender = useSelector((state) => state.user).gender + const setCategory = JSON.parse(JSON.stringify(CATEGORY)) // 랜더링과 동시에 코트매틱 category에서 '브랜드' 리스트 삭제 (한번만 실행) useEffect(() => { - CATEGORY.map((top) => { + setCategory.map((top) => { if (top.TopCategory === '뷰티') { top.subCategory.map((sub) => { if (sub.name === '브랜드') { @@ -30,13 +32,14 @@ function CategoryList({ topCG, subCG }) { // topCategory가 바뀌면 디폴트로 subCategory의 첫번째 요소 name이 active 상태가 되도록 // sub카테고리가 바뀔때 last카테고리의 디폴트를 '전체'로 useEffect(() => { - CATEGORY.map((top) => { + console.log(CATEGORY) + setCategory.map((top) => { if (selectTop === top.TopCategory) { setSubCategoryList(top.subCategory) } }) setSelectLast('전체') - }, [selectSub]) + }, [selectSub, userGender]) // 패션 카테고리만 성별에 따라 바뀌므로 useEffect(() => { diff --git a/src/components/Category/index.jsx b/src/components/Category/index.jsx index 49fc160..537fa37 100644 --- a/src/components/Category/index.jsx +++ b/src/components/Category/index.jsx @@ -1,7 +1,8 @@ import React from 'react' import CategoryList from './CategoryList' -import Container from './Container' +import Container from '../CardList/Container' import Capsule from './Capsule' +import product from '~/dummy/dummy/product.json' import { useParams } from 'react-router-dom' import { useEffect } from 'react' @@ -11,7 +12,7 @@ function CategoryFashion() { return (
- +
) diff --git a/src/components/Liked/Card.jsx b/src/components/Liked/Card.jsx index 0753249..672fe62 100644 --- a/src/components/Liked/Card.jsx +++ b/src/components/Liked/Card.jsx @@ -6,7 +6,7 @@ import check from '/public/assets/allCheck.svg' import notCheck from '/public/assets/allNotCheck.svg' function Card({ editMode, data, deleteList, setDeleteList }) { - const { brand, productName, image, price, sale } = data + const { brand, productName, thumbnail, price, sale } = data const saleCost = parseInt((price * (100 - sale)) / 100) const [selected, setSelected] = useState(false) @@ -19,7 +19,7 @@ function Card({ editMode, data, deleteList, setDeleteList }) {
- kirsh product + kirsh product
{editMode ? ( diff --git a/src/dummy/dummy/product.json b/src/dummy/dummy/product.json index c275f94..260a8eb 100644 --- a/src/dummy/dummy/product.json +++ b/src/dummy/dummy/product.json @@ -4,8 +4,8 @@ "brand": "KUME", "brandKo": "쿠메", "brandImg": "https://ifh.cc/g/LKYFDb.png", - "product": "TWEED BOMBER JACKET, BLACK", - "thumnail": "http://asq.kr/XHkPC05q4U", + "productName": "TWEED BOMBER JACKET, BLACK", + "thumbnail": "http://asq.kr/XHkPC05q4U", "price": 36000, "sale": 10, "tags": ["패션", "의류", "상의", "women"], @@ -31,8 +31,8 @@ "brand": "KUME", "brandKo": "쿠메", "brandImg": "https://ifh.cc/g/LKYFDb.png", - "product": "FRAYED SEMI-WIDE DENIM PANTS, BLACK", - "thumnail": "http://asq.kr/XHkPC05q4U", + "productName": "FRAYED SEMI-WIDE DENIM PANTS, BLACK", + "thumbnail": "http://asq.kr/XHkPC05q4U", "price": 19500, "sale": 10, "tags": ["패션", "의류", "하의", "women"], @@ -50,8 +50,8 @@ "brand": "KUME", "brandKo": "쿠메", "brandImg": "https://ifh.cc/g/LKYFDb.png", - "product": "FRAYED SEMI-WIDE DENIM PANTS, IVORY", - "thumnail": "hhttps://img.29cm.co.kr/next-product/2022/09/14/559cadbf295c43aabcba786d6b66d230_20220914184531.jpg?width=700", + "productName": "FRAYED SEMI-WIDE DENIM PANTS, IVORY", + "thumbnail": "hhttps://img.29cm.co.kr/next-product/2022/09/14/559cadbf295c43aabcba786d6b66d230_20220914184531.jpg?width=700", "price": 21500, "sale": 10, "tags": ["패션", "의류", "하의", "women"], @@ -69,8 +69,8 @@ "brand": "KUME", "brandKo": "쿠메", "brandImg": "https://ifh.cc/g/LKYFDb.png", - "product": "DOUBLE POCKET DENIM BLOUSE, MEDIUM BLUE", - "thumnail": "https://img.29cm.co.kr/next-product/2022/09/14/54217e5cfc834210a71809ed6d278b52_20220914184348.jpg?width=700", + "productName": "DOUBLE POCKET DENIM BLOUSE, MEDIUM BLUE", + "thumbnail": "https://img.29cm.co.kr/next-product/2022/09/14/54217e5cfc834210a71809ed6d278b52_20220914184348.jpg?width=700", "price": 19500, "sale": 0, "tags": ["패션", "의류", "상의", "women"], @@ -88,8 +88,8 @@ "brand": "CITYBREEZE for MEN", "brandKo": "시티브리즈 포 맨", "brandImg": "https://ifh.cc/g/FxTvCy.png", - "product": "스티치 포인트 데님 자켓_INDIGO", - "thumnail": "https://image.wconcept.co.kr/productimg/image/img0/36/301870936_GG13506.jpg", + "productName": "스티치 포인트 데님 자켓_INDIGO", + "thumbnail": "https://image.wconcept.co.kr/productimg/image/img0/36/301870936_GG13506.jpg", "price": 7900, "sale": 5, "tags": ["패션", "의류", "상의", "men"], @@ -113,8 +113,8 @@ "brand": "CITYBREEZE for MEN", "brandKo": "시티브리즈 포 맨", "brandImg": "https://ifh.cc/g/FxTvCy.png", - "product": "알파카 오버핏 카라 니트_BEIGE", - "thumnail": "https://image.wconcept.co.kr/productimg/image/img0/15/301871915_HG15179.jpg", + "productName": "알파카 오버핏 카라 니트_BEIGE", + "thumbnail": "https://image.wconcept.co.kr/productimg/image/img0/15/301871915_HG15179.jpg", "price": 17900, "sale": 5, "tags": ["패션", "의류", "상의", "men"], @@ -137,8 +137,8 @@ "brand": "CITYBREEZE for MEN", "brandKo": "시티브리즈 포 맨", "brandImg": "https://ifh.cc/g/FxTvCy.png", - "product": "알파카 오버핏 니트 가디건 _BLACK", - "thumnail": "https://img.29cm.co.kr/next-product/2022/09/14/cfa58947eb794a11a73e6702d09bdd86_20220914183502.jpg?width=700", + "productName": "알파카 오버핏 니트 가디건 _BLACK", + "thumbnail": "https://img.29cm.co.kr/next-product/2022/09/14/cfa58947eb794a11a73e6702d09bdd86_20220914183502.jpg?width=700", "price": 17900, "sale": 5, "tags": ["패션", "의류", "상의", "men"], @@ -163,8 +163,8 @@ "brand": "CITYBREEZE for MEN", "brandKo": "시티브리즈 포 맨", "brandImg": "https://ifh.cc/g/FxTvCy.png", - "product": "로고 자수 베이직 후드 스웻 셔츠_MELANGE GREY", - "thumnail": "https://image.wconcept.co.kr/productimg/image/img0/87/301871887_NL35678.jpg", + "productName": "로고 자수 베이직 후드 스웻 셔츠_MELANGE GREY", + "thumbnail": "https://image.wconcept.co.kr/productimg/image/img0/87/301871887_NL35678.jpg", "price": 8900, "sale": 5, "tags": ["패션", "의류", "상의", "men"], @@ -186,8 +186,8 @@ "brand": "ONITSUKA TIGER", "brandKo": "오니츠카 타이거", "brandImg": "https://blog.kakaocdn.net/dn/b1wXtr/btqy9FuRasZ/cDK7B3KaFX42XUkytKjKW0/img.jpg", - "product": "멕시코 66 사봇 1183A707_103", - "thumnail": "https://image.wconcept.co.kr/productimg/image/img0/02/301215702_add1_IU14475.jpg", + "productName": "멕시코 66 사봇 1183A707_103", + "thumbnail": "https://image.wconcept.co.kr/productimg/image/img0/02/301215702_add1_IU14475.jpg", "price": 15000, "sale": 5, "tags": ["패션", "신발", "운동화", "단화", "women", "men"], @@ -203,8 +203,8 @@ "brand": "ONITSUKA TIGER", "brandKo": "오니츠카 타이거", "brandImg": "https://blog.kakaocdn.net/dn/b1wXtr/btqy9FuRasZ/cDK7B3KaFX42XUkytKjKW0/img.jpg", - "product": "멕시코 66 사봇 1183A707_103", - "thumnail": "https://image.wconcept.co.kr/productimg/image/img0/07/301215707_DI19617.jpg", + "productName": "멕시코 66 사봇 1183A707_103", + "thumbnail": "https://image.wconcept.co.kr/productimg/image/img0/07/301215707_DI19617.jpg", "price": 15000, "sale": 5, "tags": ["패션", "신발", "운동화", "단화", "women", "men"], @@ -220,8 +220,8 @@ "brand": "ONITSUKA TIGER", "brandKo": "오니츠카 타이거", "brandImg": "https://blog.kakaocdn.net/dn/b1wXtr/btqy9FuRasZ/cDK7B3KaFX42XUkytKjKW0/img.jpg", - "product": "멕시코 66 사봇 1183A707_020", - "thumnail": "https://image.wconcept.co.kr/productimg/image/img0/04/301651704_add1_MU87246.jpg", + "productName": "멕시코 66 사봇 1183A707_020", + "thumbnail": "https://image.wconcept.co.kr/productimg/image/img0/04/301651704_add1_MU87246.jpg", "price": 15000, "sale": 5, "tags": ["패션", "신발", "운동화", "단화", "women", "men"], @@ -237,8 +237,8 @@ "brand": "ONITSUKA TIGER", "brandKo": "오니츠카 타이거", "brandImg": "https://blog.kakaocdn.net/dn/b1wXtr/btqy9FuRasZ/cDK7B3KaFX42XUkytKjKW0/img.jpg", - "product": "멕시코 66 사봇 1183A707_750", - "thumnail": "https://image.wconcept.co.kr/productimg/image/img0/05/301651705_YF53600.jpg", + "productName": "멕시코 66 사봇 1183A707_750", + "thumbnail": "https://image.wconcept.co.kr/productimg/image/img0/05/301651705_YF53600.jpg", "price": 15000, "sale": 5, "tags": ["패션", "신발", "운동화", "단화", "women", "men"], @@ -254,8 +254,8 @@ "brand": "around ann", "brandKo": "어라운드앤", "brandImg": "https://aroundann.jp/web/upload/category/editor/2021/11/03/34113214691ad533e76facd4df88e8d3.png", - "product": "troi bag_black", - "thumnail": "https://aroundann.jp/web/product/medium/202209/bcc3644b221ced05bbc40ef69053bb21.jpg", + "productName": "troi bag_black", + "thumbnail": "https://aroundann.jp/web/product/medium/202209/bcc3644b221ced05bbc40ef69053bb21.jpg", "price": 4300, "sale": 10, "tags": ["women", "가방", "aroundann", "troi"], @@ -275,8 +275,8 @@ "brand": "around ann", "brandKo": "어라운드앤", "brandImg": "https://aroundann.jp/web/upload/category/editor/2021/11/03/34113214691ad533e76facd4df88e8d3.png", - "product": "Wrinkle bag_ivory", - "thumnail": "https://aroundann.jp/web/product/medium/202201/0f5794621764cf3a6e5c031838e48284.jpg", + "productName": "Wrinkle bag_ivory", + "thumbnail": "https://aroundann.jp/web/product/medium/202201/0f5794621764cf3a6e5c031838e48284.jpg", "price": 4500, "sale": 10, "tags": ["women", "가방", "aroundann", "Wrinkle"], @@ -296,8 +296,8 @@ "brand": "around ann", "brandKo": "어라운드앤", "brandImg": "https://aroundann.jp/web/upload/category/editor/2021/11/03/34113214691ad533e76facd4df88e8d3.png", - "product": "Double bag_brown", - "thumnail": "https://aroundann.jp/web/product/medium/202205/4747bf78bdcae78e063820faed44af73.jpg", + "productName": "Double bag_brown", + "thumbnail": "https://aroundann.jp/web/product/medium/202205/4747bf78bdcae78e063820faed44af73.jpg", "price": 3800, "sale": 10, "tags": ["women", "가방", "aroundann", "Double"], @@ -320,7 +320,7 @@ "brand": "around ann", "brandKo": "어라운드앤", "brandImg": "https://aroundann.jp/web/upload/category/editor/2021/11/03/34113214691ad533e76facd4df88e8d3.png", - "product": "Ami bag_black", + "productName": "Ami bag_black", "thumbnail": "https://aroundann.jp/web/product/medium/202209/179385189d25e04324f274e2deb33cb9.jpg", "price": 3900, "sale": 10, @@ -341,7 +341,7 @@ "brand": "around ann", "brandKo": "어라운드앤", "brandImg": "https://aroundann.jp/web/upload/category/editor/2021/11/03/34113214691ad533e76facd4df88e8d3.png", - "product": "Sally bag_ivory", + "productName": "Sally bag_ivory", "thumbnail": "https://aroundann.jp/web/product/medium/202208/7aa5e7fb9cb4c0d1714faf73cede1fa2.jpg", "price": 3600, "sale": 10, @@ -364,7 +364,7 @@ "brand": "around ann", "brandKo": "어라운드앤", "brandImg": "https://aroundann.jp/web/upload/category/editor/2021/11/03/34113214691ad533e76facd4df88e8d3.png", - "product": "Sally bag_brown", + "productName": "Sally bag_brown", "thumbnail": "https://aroundann.jp/web/product/medium/202208/07d882c8cffcd95d1ac79ea47059e185.jpg", "price": 3600, "sale": 10, @@ -387,7 +387,7 @@ "brand": "around ann", "brandKo": "어라운드앤", "brandImg": "https://aroundann.jp/web/upload/category/editor/2021/11/03/34113214691ad533e76facd4df88e8d3.png", - "product": "Sally bag_black", + "productName": "Sally bag_black", "thumbnail": "https://aroundann.jp/web/product/medium/202208/8634e1c64521fbeca43a055f5f93f513.jpg", "price": 3600, "sale": 10, @@ -405,5 +405,376 @@ "https://aroundann.co.kr/web/upload/NNEditor/20220827/dd8d7a2b12bde8fc818b623f35910fb5.jpg" ], "sumary": {} + }, + { + "brand": "Kirsh", + "brandKo": "키르시", + "productName": "BIG CHERRY FLEECE CROP HOODIE [CREAM]", + "thumbnail": "https://image.msscdn.net/images/goods_img/20220825/2744629/2744629_1_500.jpg?t=20220825214924", + "price": 7900, + "sale": 5, + "tags": ["패션", "의류", "상의", "women"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20220825/2744629/2744629_1_500.jpg", + "https://image.msscdn.net/images/prd_img/20220825/2744629/detail_2744629_1_500.jpg", + "https://image.msscdn.net/images/prd_img/20220825/2744629/detail_2744629_2_500.jpg", + "https://image.msscdn.net/images/prd_img/20220825/2744629/detail_2744629_3_500.jpg", + "https://image.msscdn.net/images/prd_img/20220825/2744629/detail_2744629_4_500.jpg" + ], + "detailList": [ + "https://kirsh.cafe24.com/web/upload/NNEditor/20220825/copy-1661426815-22AW-CHERRY-UPPER.jpg", + "https://kirsh.cafe24.com/web/upload/NNEditor/20220825/KKQWCTH502M28CR29800-ARCH-HOODIE_01.jpg" + ], + "sumary": {} + }, + { + "brand": "Kirsh", + "brandKo": "키르시", + "productName": "BIG CHERRY FLEECE CROP HOODIE [BLACK]", + "thumbnail": "https://image.msscdn.net/images/goods_img/20220825/2744630/2744630_1_500.jpg?t=20220825214930", + "price": 7900, + "sale": 5, + "tags": ["패션", "의류", "상의", "women", "키르시"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20220825/2744630/2744630_1_500.jpg?t=20220825214930", + "https://image.msscdn.net/images/prd_img/20220825/2744630/detail_2744630_1_500.jpg", + "https://image.msscdn.net/images/prd_img/20220825/2744630/detail_2744630_2_500.jpg", + "https://image.msscdn.net/images/prd_img/20220825/2744630/detail_2744630_3_500.jpg", + "https://image.msscdn.net/images/prd_img/20220825/2744630/detail_2744630_4_500.jpg" + ], + "detailList": [ + "https://kirsh.cafe24.com/web/upload/NNEditor/20220825/copy-1661426815-22AW-CHERRY-UPPER.jpg", + "https://kirsh.cafe24.com/web/upload/NNEditor/20220825/KKQWCTH502M28BK29800-ARCH-HOODIE_01.jpg" + ], + "sumary": {} + }, + { + "brand": "Kirsh", + "brandKo": "키르시", + "productName": "UNBLANCE DOUBLE BUCKLE SHOULDER BAG [BROWN]", + "thumbnail": "https://image.msscdn.net/images/goods_img/20220825/2744629/2744629_1_500.jpg?t=20220825214924", + "price": 8900, + "sale": 5, + "tags": ["패션", "가방", "숄더백", "women", "키르시"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20220929/2831163/2831163_1_500.jpg?t=20220929220203", + "https://image.msscdn.net/images/prd_img/20220929/2831163/detail_2831163_2_500.jpg", + "https://image.msscdn.net/images/prd_img/20220929/2831163/detail_2831163_3_500.jpg", + "https://image.msscdn.net/images/prd_img/20220929/2831163/detail_2831163_4_500.jpg" + ], + "detailList": [ + "https://kirsh.cafe24.com/web/upload/NNEditor/20220929/copy-1664452250-22AW-COLLECTION-UPPER.jpg", + "https://kirsh.cafe24.com/web/upload/NNEditor/20220929/KCQWBBG540M28BR29800-SHOULDER-BAG_01.jpg", + "https://kirsh.cafe24.com/web/upload/NNEditor/20220929/KCQWBBG540M28BR29800-SHOULDER-BAG_02.jpg" + ], + "sumary": {} + }, + { + "brand": "SCULPTOR", + "brandKo": "스컬프터", + "productName": "Velour Soccer Jersey Black", + "thumbnail": "https://image.msscdn.net/images/prd_img/20220822/2731288/detail_2731288_1_500.jpg", + "price": 11900, + "sale": 15, + "tags": ["패션", "의류", "상의", "women", "men"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20220822/2731288/2731288_2_500.jpg?t=20220907010854", + "https://image.msscdn.net/images/prd_img/20220822/2731288/detail_2731288_1_500.jpg", + "https://image.msscdn.net/images/prd_img/20220822/2731288/detail_2731288_2_500.jpg", + "https://image.msscdn.net/images/prd_img/20220822/2731288/detail_2731288_3_500.jpg", + "https://image.msscdn.net/images/prd_img/20220822/2731288/detail_2731288_4_500.jpg", + "https://image.msscdn.net/images/prd_img/20220822/2731288/detail_2731288_5_500.jpg" + ], + "detailList": [ + "https://scptor123.cafe24.com/web/product/big/22AW/Archive3rd/Velour_Soccer_Jersey_Black_1.jpg", + "https://scptor123.cafe24.com/web/product/big/22AW/Archive3rd/Velour_Soccer_Jersey_Black_2.jpg" + ] + }, + { + "brand": "PLAC", + "brandKo": "플랙", + "productName": "KKANG STYLIST X PLAC STEEZE K75 gray black", + "thumbnail": "https://image.msscdn.net/images/goods_img/20220812/2715054/2715054_5_500.jpg", + "price": 14900, + "sale": 40, + "tags": ["패션", "의류", "하의", "men", "청바지", "흑청"], + "detailThumbList": [ + "https://image.msscdn.net/images/prd_img/20220812/2715054/detail_2715054_2_500.jpg", + "https://image.msscdn.net/images/goods_img/20220812/2715054/2715054_5_500.jpg", + "https://image.msscdn.net/images/prd_img/20220812/2715054/detail_2715054_7_500.jpg", + "https://image.msscdn.net/images/prd_img/20220812/2715054/detail_2715054_6_500.jpg", + "https://image.msscdn.net/images/prd_img/20220812/2715054/detail_2715054_3_500.jpg", + "https://image.msscdn.net/images/prd_img/20220812/2715054/detail_2715054_4_500.jpg" + ], + "detailList": [ + "https://image.msscdn.net/images/goods/goods_event_banner/2022093009103900000028262.jpg", + "https://plac01.openhost.cafe24.com/img/22FW/MAIN/22FW_KKANG_INTRO.jpg", + "https://plac01.openhost.cafe24.com/img/22FW/MAIN/PJTT5SZK755_01.jpg", + "https://plac01.openhost.cafe24.com/img/22FW/MAIN/PJTT5SZK755_02.jpg" + ] + }, + { + "brand": "ANDERSSON BELL", + "brandKo": "앤더슨벨", + "productName": "Military Denim Patch Skirt apa542w(KHAKI)", + "brandImg": "https://image.msscdn.net/images/prd_img/20220825/2743823/detail_2743823_1_500.jpg", + "thumbnail": "https://image.msscdn.net/images/goods_img/20220825/2743823/2743823_1_500.jpg?t=20220825171744", + "price": 29700, + "sale": 10, + "tags": ["패션", "의류", "하의", "women", "롱스커트"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20220825/2743823/2743823_1_500.jpg?t=20220825171744" + ], + "detailList": [ + "https://anderssonbell.cafe24.com/web/md/22fw/apa542w_kh_1.jpg", + "https://anderssonbell.cafe24.com/web/md/22fw/apa542w_mm_1.jpg", + "https://anderssonbell.cafe24.com/web/md/22fw/apa542w_mm_2.jpg" + ] + }, + { + "brand": "Mur", + "brandKo": "무어", + "productName": "[3way]ATTE BAG", + "brandImg": "https://image.msscdn.net/images/goods_img/20220124/2324898/2324898_4_500.jpg", + "thumbnail": "https://image.msscdn.net/images/goods_img/20220124/2324898/2324898_4_500.jpg", + "price": 9800, + "sale": 40, + "tags": ["패션", "가방", "토트백", "women"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20220124/2324898/2324898_4_500.jpg" + ], + "detailList": [ + "https://image.musinsa.com/images/prd_img/2022021020215500000024329.jpg" + ] + }, + { + "brand": "ETUDE", + "brandKo": "에뛰드", + "productName": "Play Color Eyes Muhly Romance", + "brandImg": "https://image.msscdn.net/images/goods_img/20210224/1812161/1812161_14_500.jpg", + "thumbnail": "https://image.msscdn.net/images/goods_img/20210224/1812161/1812161_14_500.jpg", + "price": 2500, + "sale": 35, + "tags": ["코스매틱", "메이크업", "포인트 메이크업", "아이쉐도우", "팔레트"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20210224/1812161/1812161_14_500.jpg", + "https://image.msscdn.net/images/prd_img/20210224/1812161/detail_1812161_1_500.jpg" + ], + "detailList": [ + "https://etude.speedgabia.com/webcatalogue/2020/08/muhly_romance/images/playcolor_img1.jpg", + "https://etude.speedgabia.com/webcatalogue/2020/08/muhly_romance/images/playcolor_img6.jpg", + "https://etude.speedgabia.com/webcatalogue/2020/08/muhly_romance/images/playcolor_img7.jpg", + "https://etude.speedgabia.com/webcatalogue/2020/08/muhly_romance/images/playcolor_img8.jpg" + ] + }, + { + "brand": "NAMING", + "brandKo": "네이밍", + "productName": "FLUFFY POWDER BLUSH 3.2g", + "brandImg": "https://image.msscdn.net/images/goods_img/20210607/1985364/1985364_5_500.jpg?t=20220824151612", + "thumbnail": "https://image.msscdn.net/images/goods_img/20210607/1985364/1985364_5_500.jpg?t=20220824151612", + "price": 1500, + "sale": 15, + "tags": ["코스매틱", "메이크업", "포인트 메이크업", "아이쉐도우"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20210607/1985364/1985364_5_500.jpg?t=20220824151612", + "https://image.msscdn.net/images/prd_img/20210607/1985364/detail_1985364_1_500.jpg" + ], + "detailList": [ + "https://image.musinsa.com/images/prd_img/2022082416200200000039017.jpg", + "https://image.musinsa.com/images/prd_img/2022082416200300000067840.jpg", + "https://image.musinsa.com/images/prd_img/2022082416200300000098405.jpg", + "https://image.musinsa.com/images/prd_img/2022082416200400000020815.jpg", + "https://image.musinsa.com/images/prd_img/2022082416200500000008655.jpg" + ] + }, + { + "brand": "Peripera", + "brandKo": "페리페라", + "productName": "Ink Mood Matte Tint [Fall in Acorn Collection]", + "brandImg": "https://image.msscdn.net/images/goods_img/20220831/2758851/2758851_6_500.jpg?t=20220831223232", + "thumbnail": "https://image.msscdn.net/images/goods_img/20220831/2758851/2758851_6_500.jpg?t=20220831223232", + "price": 1000, + "sale": 20, + "tags": ["코스매틱", "메이크업", "포인트 메이크업", "립"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20220831/2758851/2758851_6_500.jpg?t=20220831223232" + ], + "detailList": [ + "https://clubclioimg.co.kr/images/peri/Moodmat-Tint_Acorn_810_01.jpg", + "https://clubclioimg.co.kr/images/peri/Moodmat-Tint_Acorn_810_04.jpg" + ] + }, + { + "brand": "NEW BALANCE", + "brandKo": "뉴발란스", + "productName": "NBPDCF701G / ML725P (GRAY)", + "brandImg": "https://image.msscdn.net/images/goods_img/20211130/2252756/2252756_1_500.jpg?t=20211130153413", + "thumbnail": "https://image.msscdn.net/images/goods_img/20220831/2758851/2758851_6_500.jpg?t=20220831223232", + "price": 12900, + "sale": 0, + "tags": ["패션", "신발", "운동화", "725"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20220831/2758851/2758851_6_500.jpg?t=20220831223232" + ], + "detailList": [ + "https://gi.esmplus.com/nbkorea01/2022/detail/NBPDCF701Gdetail.jpg" + ] + }, + { + "brand": "TWN", + "brandKo": "티떠블유엔", + "productName": "Slake Hood Olive HHHD3397", + "brandImg": "https://image.msscdn.net/images/goods_img/20210902/2106705/2106705_1_500.jpg", + "thumbnail": "https://image.msscdn.net/images/goods_img/20210902/2106705/2106705_1_500.jpg", + "price": 4190, + "sale": 5, + "tags": ["패션", "의류", "상의", "women", "men", "올리브", "후드"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20210902/2106705/2106705_1_500.jpg" + ], + "detailList": [ + "https://efairplay.img2.kr/TWN/2021/02_21FW/20210812_twn_slake_intro_jh_olive.jpg", + "https://efairplay.img2.kr/TWN/2021/02_21FW/20210812_twn_slake_model_jh_14.jpg", + "https://efairplay.img2.kr/TWN/2021/02_21FW/20210812_twn_slake_image_jh_06.jpg", + "https://efairplay.img2.kr/TWN/2021/02_21FW/20210812_twn_slake_model_jh_17.jpg", + "https://efairplay.img2.kr/TWN/2021/02_21FW/20210812_twn_slake_image_jh_05.jpg", + "https://efairplay.img2.kr/TWN/2021/02_21FW/20210812_twn_slake_model_jh_16.jpg", + "https://efairplay.img2.kr/TWN/2021/02_21FW/20210812_twn_slake_detail_olive_jh_02.jpg" + ] + }, + { + "brand": "Dr.esthe", + "brandKo": "닥터에스떼", + "productName": "Whitening A Serum 50ml", + "brandImg": "http://shop2.dresthemall.com/web/upload/malllab/images/comm_logoTop.png", + "thumbnail": "http://shop2.dresthemall.com/web/product/big/202203/151901584778f58df194323f2239fe58.png", + "price": 5990, + "sale": 5, + "tags": ["코스매틱", "스킨케어", "세럼", "화이트닝"], + "detailThumbList": [ + "http://shop2.dresthemall.com/web/product/big/202203/151901584778f58df194323f2239fe58.png" + ], + "detailList": [ + "http://shop2.dresthemall.com/web/upload/NNEditor/20220628/5BEN5DED9994EC9DB4ED8AB8EB8B9DAEC84B8EB9FBC.jpg" + ] + }, + { + "brand": "ETUDE", + "brandKo": "에뛰드", + "productName": "NEW Double Lasting Poundation", + "brandImg": "https://image.msscdn.net/mfile_s01/_brand/free_medium/etude.png?202206291707", + "thumbnail": "https://image.msscdn.net/images/goods_img/20210224/1812484/1812484_12_500.jpg?t=20220203164128", + "price": 2200, + "sale": 40, + "tags": ["코스매틱", "메이크업", "베이스 메이크업", "파운데이션"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20210224/1812484/1812484_12_500.jpg?t=20220203164128" + ], + "detailList": [ + "https://etude.speedgabia.com/webcatalogue/2020/06/double/images/double_img1.jpg", + "https://etude.speedgabia.com/webcatalogue/2020/06/double/images/double_img2.jpg", + "https://etude.speedgabia.com/webcatalogue/2020/06/double/images/double_img3.jpg", + "https://etude.speedgabia.com/webcatalogue/2020/06/double/images/double_img4.jpg", + "https://etude.speedgabia.com/webcatalogue/2020/06/double/images/double_img5.jpg", + "https://etude.speedgabia.com/webcatalogue/2020/06/double/images/double_img6.jpg" + ] + }, + { + "brand": "ETUDE", + "brandKo": "에뛰드", + "productName": "Soon Jung pH 5.5 Relief Toner", + "brandImg": "https://image.msscdn.net/mfile_s01/_brand/free_medium/etude.png?202206291707", + "thumbnail": "https://image.msscdn.net/images/goods_img/20210607/1986512/1986512_34_500.jpg", + "price": 3000, + "sale": 30, + "tags": [ + "코스매틱", + "스킨케어", + "스킨토너", + "순정", + "비건", + "토너", + "약산성", + "저자극", + "진정" + ], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20210607/1986512/1986512_34_500.jpg", + "https://image.msscdn.net/images/prd_img/20210607/1986512/detail_1986512_21_500.jpg" + ], + "detailList": [ + "https://etude.speedgabia.com/webcatalogue/2021/06/Soonjung_toner500/image/Line_up.jpg", + "https://etude.speedgabia.com/webcatalogue/2021/06/Soonjung_toner500/image/SJ_Toner500_2.jpg", + "https://etude.speedgabia.com/webcatalogue/2021/06/Soonjung_toner500/image/SJ_Toner500_3.jpg", + "https://etude.speedgabia.com/webcatalogue/2021/06/Soonjung_toner500/image/SJ_Toner500_4.jpg", + "https://etude.speedgabia.com/webcatalogue/2021/06/Soonjung_toner500/image/SJ_Toner500_6.jpg" + ] + }, + { + "brand": "ETUDE", + "brandKo": "에뛰드", + "productName": "Soon Jung 10 Free Moist Emulsion", + "brandImg": "https://image.msscdn.net/mfile_s01/_brand/free_medium/etude.png?202206291707", + "thumbnail": "https://image.msscdn.net/images/prd_img/20210225/1814055/detail_1814055_16_500.jpg", + "price": 3000, + "sale": 30, + "tags": [ + "코스매틱", + "스킨케어", + "에센스", + "순정", + "비건", + "에멀전", + "무첨가", + "저자극", + "진정" + ], + "detailThumbList": [ + "https://image.msscdn.net/images/prd_img/20210225/1814055/detail_1814055_16_500.jpg", + "https://image.msscdn.net/images/prd_img/20210225/1814055/detail_1814055_13_500.jpg" + ], + "detailList": [ + "https://etude.speedgabia.com/webcatalogue/2021/06/Soonjung_toner500/image/Line_up.jpg", + "https://etude.speedgabia.com/webcatalogue/2021/05/Soonjung_2021AD/3_AD_EMULSION/image/SJ_Emulsion_3.jpg", + "https://etude.speedgabia.com/webcatalogue/2021/05/Soonjung_2021AD/3_AD_EMULSION/image/SJ_Emulsion_4.jpg", + "https://etude.speedgabia.com/webcatalogue/2021/05/Soonjung_2021AD/3_AD_EMULSION/image/SJ_Emulsion_5.jpg", + "https://etude.speedgabia.com/webcatalogue/2021/05/Soonjung_2021AD/3_AD_EMULSION/image/SJ_Emulsion_6.jpg" + ] + }, + { + "brand": "CLIO", + "brandKo": "클리오", + "productName": "Stay Perfect Finish Pact", + "brandImg": "https://image.msscdn.net/mfile_s01/_brand/free_medium/clio.png?202209141217", + "thumbnail": "https://image.msscdn.net/images/goods_img/20220502/2533516/2533516_2_500.jpg?t=20220503143201", + "price": 2600, + "sale": 30, + "tags": ["코스매틱", "메이크업", "팩트", "픽서", "쿠션", "파우더"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20220502/2533516/2533516_2_500.jpg?t=20220503143201" + ], + "detailList": [ + "https://clubclioimg.co.kr/images/clio/Stay-Finish-Pact_810_01.jpg", + "https://clubclioimg.co.kr/images/clio/Stay-Finish-Pact_810_03.jpg" + ] + }, + { + "brand": "CLIO", + "brandKo": "클리오", + "productName": "Kill Cover Foundation", + "brandImg": "https://image.msscdn.net/mfile_s01/_brand/free_medium/clio.png?202209141217", + "thumbnail": "https://image.msscdn.net/images/goods_img/20220928/2824769/2824769_5_500.jpg?t=20221004094826", + "price": 2600, + "sale": 30, + "tags": ["코스매틱", "메이크업", "파운데이션", "킬커버"], + "detailThumbList": [ + "https://image.msscdn.net/images/goods_img/20220928/2824769/2824769_5_500.jpg?t=20221004094826" + ], + "detailList": [ + "https://clubclioimg.co.kr/images/clio/KillCoverFounwearFoundation_810_01.jpg", + "https://clubclioimg.co.kr/images/clio/KillCoverFounwearFoundation_810_02.jpg", + "https://clubclioimg.co.kr/images/clio/KillCoverFounwearFoundation_810_05.jpg" + ] } ] diff --git a/src/dummy/liked.js b/src/dummy/liked.js index 29b0d59..24f63e9 100644 --- a/src/dummy/liked.js +++ b/src/dummy/liked.js @@ -1,8 +1,8 @@ export const likedList = [ { brand: 'Kirsh', - product: 'BIG CHERRY FLEECE CROP HOODIE', - image: + productName: 'BIG CHERRY FLEECE CROP HOODIE', + thumbnail: 'https://image.msscdn.net/images/goods_img/20220825/2744629/2744629_1_500.jpg?t=20220825214924', price: 6500, sale: 30, @@ -10,8 +10,8 @@ export const likedList = [ }, { brand: 'SCULPTOR', - product: 'Velour Soccer Jersey Black', - image: + productName: 'Velour Soccer Jersey Black', + thumbnail: 'https://image.msscdn.net/images/prd_img/20220822/2731288/detail_2731288_1_500.jpg', price: 11900, sale: 15, @@ -19,8 +19,8 @@ export const likedList = [ }, { brand: 'PLAC', - product: 'KKANG STYLIST X PLAC STEEZE K75 gray black', - image: + productName: 'KKANG STYLIST X PLAC STEEZE K75 gray black', + thumbnail: 'https://image.msscdn.net/images/goods_img/20220812/2715054/2715054_5_500.jpg', price: 14900, sale: 40, @@ -28,8 +28,8 @@ export const likedList = [ }, { brand: 'ANDERSSON BELL', - product: 'Military Denim Patch Skirt apa542w(KHAKI)', - image: + productName: 'Military Denim Patch Skirt apa542w(KHAKI)', + thumbnail: 'https://image.msscdn.net/images/prd_img/20220825/2743823/detail_2743823_1_500.jpg', price: 29700, sale: 10, @@ -37,8 +37,8 @@ export const likedList = [ }, { brand: 'Mur', - product: '[3way]ATTE BAG(9color)', - image: + productName: '[3way]ATTE BAG(9color)', + thumbnail: 'https://image.msscdn.net/images/goods_img/20220124/2324898/2324898_4_500.jpg', price: 9800, sale: 40, @@ -46,8 +46,8 @@ export const likedList = [ }, { brand: 'ETUDE', - product: 'Play Color Eyes Muhly Romance', - image: + productName: 'Play Color Eyes Muhly Romance', + thumbnail: 'https://image.msscdn.net/images/goods_img/20210224/1812161/1812161_14_500.jpg', price: 2500, sale: 35, @@ -55,8 +55,8 @@ export const likedList = [ }, { brand: 'NAMING', - product: 'FLUFFY POWDER BLUSH 3.2g', - image: + productName: 'FLUFFY POWDER BLUSH 3.2g', + thumbnail: 'https://image.msscdn.net/images/goods_img/20210607/1985364/1985364_5_500.jpg?t=20220824151612', price: 1500, sale: 15, @@ -64,8 +64,8 @@ export const likedList = [ }, { brand: 'Peripera', - product: 'Ink Mood Matte Tint [Fall in Acorn Collection]', - image: + productName: 'Ink Mood Matte Tint [Fall in Acorn Collection]', + thumbnail: 'https://image.msscdn.net/images/goods_img/20220831/2758851/2758851_6_500.jpg?t=20220831223232', price: 1000, sale: 20, @@ -73,8 +73,8 @@ export const likedList = [ }, { brand: 'NEW BALANCE', - product: 'NBPDCF701G / ML725P (GRAY)', - image: + productName: 'NBPDCF701G / ML725P (GRAY)', + thumbnail: 'https://image.msscdn.net/images/goods_img/20211130/2252756/2252756_1_500.jpg?t=20211130153413', price: 12900, sale: 0, @@ -82,8 +82,8 @@ export const likedList = [ }, { brand: 'TWN', - product: 'Slake Hood Olive HHHD3397', - image: + productName: 'Slake Hood Olive HHHD3397', + thumbnail: 'https://image.msscdn.net/images/goods_img/20210902/2106705/2106705_1_500.jpg', price: 4190, sale: 5, diff --git a/src/pages/Search/AfterSearch.jsx b/src/pages/Search/AfterSearch.jsx new file mode 100644 index 0000000..3fdd4a8 --- /dev/null +++ b/src/pages/Search/AfterSearch.jsx @@ -0,0 +1,14 @@ +import React from 'react' +import HaveResult from './HaveResult' +import NoResult from './NoResult' + +function AfterSearch() { + return ( +
+ {/* */} + +
+ ) +} + +export default AfterSearch diff --git a/src/pages/Search/HaveResult.jsx b/src/pages/Search/HaveResult.jsx new file mode 100644 index 0000000..b8ee7aa --- /dev/null +++ b/src/pages/Search/HaveResult.jsx @@ -0,0 +1,19 @@ +import React from 'react' +import Container from '../../components/CardList/Container' +import product from '~/dummy/dummy/product.json' + +function HaveResult() { + return ( +
+
+ 총 {4}개의 검색결과 +
+
+
상품
+ +
+
+ ) +} + +export default HaveResult diff --git a/src/pages/Search/NoResult.jsx b/src/pages/Search/NoResult.jsx new file mode 100644 index 0000000..75e1d78 --- /dev/null +++ b/src/pages/Search/NoResult.jsx @@ -0,0 +1,40 @@ +import React from 'react' +import { useParams } from 'react-router-dom' +import { likedList } from '~/dummy/liked' +import Card from '../../components/CardList/Card' + +function NoResult() { + const { search } = useParams() + + return ( +
+
+ "{search}"에 대한 검색 결과가 + 없습니다
+ 검색어를 다시 한번 확인해보세요 +
+
+
구매한 상품
+
+ {likedList.map((item) => ( +
+ +
+ ))} +
+
+
+
최근 본 상품
+
+ {likedList.map((item) => ( +
+ +
+ ))} +
+
+
+ ) +} + +export default NoResult diff --git a/src/pages/Search/index.jsx b/src/pages/Search/index.jsx index 7487272..e200062 100644 --- a/src/pages/Search/index.jsx +++ b/src/pages/Search/index.jsx @@ -1,34 +1,17 @@ import React, { useState } from 'react' import { useEffect } from 'react' +import { Outlet } from 'react-router-dom' +import AfterSearch from './AfterSearch' import BeforeSearch from './BeforeSearch' import SearchHeader from './SearchHeader' function Search() { - const [focus, setFocus] = useState(false) - const [inputAnimation, setInputAnimation] = useState('') - - useEffect(() => { - setFocus(true) - setInputAnimation('openSearchBar') - setTimeout(() => { - setInputAnimation('') - }, 1000) - }, []) + const [goSearch, setGoSearch] = useState(false) return (
- - + +
) } diff --git a/tailwind.config.cjs b/tailwind.config.cjs index fbdcd57..e3e69e5 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -22,5 +22,5 @@ module.exports = { }, }, }, - plugins: [], + plugins: [require('@tailwindcss/line-clamp')], } diff --git a/vite.config.js b/vite.config.js index a9ea584..96b6274 100644 --- a/vite.config.js +++ b/vite.config.js @@ -10,15 +10,15 @@ export default defineConfig({ resolve: { alias: [{ find: '~', replacement: resolve(__dirname) }], }, - // server: { - // proxy: { - // '/api': { - // target: 'http://43.200.38.47:9090', - // changeOrigin: true, - // rewrite: (path) => path.replace(/^\/api/, ''), - // secure: false, - // ws: true, - // }, - // }, - // }, + server: { + // proxy: { + // '/api': { + // target: 'http://43.200.38.47:9090', + // changeOrigin: true, + // rewrite: (path) => path.replace(/^\/api/, ''), + // secure: false, + // ws: true, + // }, + // }, + }, })