-
Notifications
You must be signed in to change notification settings - Fork 39
[문주영] Sprint7 #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
GANGYIKIM
merged 29 commits into
codeit-bootcamp-frontend:React-문주영
from
Moon-ju-young:React-문주영-sprint7
May 28, 2025
The head ref may contain hidden characters: "React-\uBB38\uC8FC\uC601-sprint7"
Merged
[문주영] Sprint7 #222
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
aac7d4c
🐛 fix(mentor): tag logic 및 form validity 확인 수정
Moon-ju-young ac49ea2
✨ feat(mentor): price input type number로 변경
Moon-ju-young 6afbd9a
✨ feat(mentor): tag component 구조 및 prop 수정
Moon-ju-young 4122464
✨ feat(mentor): tag 삭제 기능 추가
Moon-ju-young 48483b7
♻️ refactor(mentor): Button component to prop 삭제
Moon-ju-young fb05c81
✨ feat: item 클릭 시 page 이동 기능 추가
Moon-ju-young 3c92e8f
✨ feat: ItemProduct page 추가
Moon-ju-young 1e24ebe
✨ feat: getProduct, getProductComment api 함수 추가
Moon-ju-young 5e1f2c2
✨ feat: data response 추가
Moon-ju-young 83b161f
💄 style: pagenation 버튼 디자인 수정
Moon-ju-young 91f10e5
♻️ refactor: dropdown 파일 이름 변경
Moon-ju-young 32cac9c
♻️ refactor: assets 폴더 분할 및 경로 수정
Moon-ju-young 2c17cb2
✨ feat: 새로운 icon 파일 추가
Moon-ju-young 423213a
💄 style: favoriteCount 색상 미적용 수정
Moon-ju-young 3c1e798
♻️ refactor: disabled button 내부 icon으로 수정
Moon-ju-young 6824aa5
🐛 fix: Pagenation button disabled 조건 변경
Moon-ju-young e84ea6d
✨ feat: Dropdown component 추가
Moon-ju-young 43b8291
✨ feat: ButtonHeart component 추가
Moon-ju-young 0dda2f9
✨ feat: image 추가
Moon-ju-young 2c7834c
✨ feat: tag component 다른 형태 추가 및 내부 수정
Moon-ju-young b107dc0
♻️ refactor: Nav component 시맨틱 태그 변경
Moon-ju-young b1f3a78
♻️ refactor: Button padding 스타일 추가 및 그에 따른 수정
Moon-ju-young 4d711a6
🐛 fix: z-index 수정
Moon-ju-young 80869b0
✨ feat: getDurationString tutil 함수 추가
Moon-ju-young fe371e2
✨ feat: inputRef prop 추가
Moon-ju-young 9221a0c
✨ feat: Dropdown 내부 button type=button 추가
Moon-ju-young bf79c70
✨ feat: back icon 추가
Moon-ju-young 1244e2e
✨ feat: api 함수 Error throw 추가
Moon-ju-young 9ae50ee
✨ feat: ItemProduct (개별 아이템) 페이지 구현
Moon-ju-young File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,20 @@ | ||
| const BASE_URL = "https://panda-market-api.vercel.app"; | ||
|
|
||
| export async function getProducts( { page=1, pageSize=10, orderBy="recent", keyword } ) { | ||
| export async function getProducts({ page=1, pageSize=10, orderBy="recent", keyword }) { | ||
| const query = new URLSearchParams({ page, pageSize, orderBy }).toString(); | ||
| const products = await fetch(`${BASE_URL}/products?${query}${keyword ? "&keyword="+keyword : ''}`); | ||
| return (await products.json()); | ||
| const response = await fetch(`${BASE_URL}/products?${query}${keyword ? "&keyword="+keyword : ''}`); | ||
| if (!response.ok) { throw Error("Request Error"); } | ||
| return (await response.json()); | ||
| } | ||
|
|
||
| export async function getProduct({ productId }) { | ||
| const response = await fetch(`${BASE_URL}/products/${productId}`); | ||
| if (!response.ok) { throw Error("Request Error"); } | ||
| return (await response.json()); | ||
| } | ||
|
|
||
| export async function getProductComments({ productId, limit }) { | ||
| const response = await fetch(`${BASE_URL}/products/${productId}/comments?limit=${limit}`); | ||
| if (!response.ok) { throw Error("Request Error"); } | ||
| return (await response.json()); | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
src/assets/ic_arrow_left.svg → src/assets/arrow/ic_arrow_right_active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import icHeartLargeActive from "../assets/heart/ic_heart_large_active.svg"; | ||
| import icHeartLargeInactive from "../assets/heart/ic_heart_large_inactive.svg"; | ||
| import icHeartMediumActive from "../assets/heart/ic_heart_medium_active.svg"; | ||
| import icHeartMediumInactive from "../assets/heart/ic_heart_medium_inactive.svg"; | ||
| import styles from "./ButtonHeart.module.css"; | ||
|
|
||
| function ButtonHeart({ isActive=false, className='', children, ...props }) { | ||
| return (<button className={styles.btn+' '+className} {...props}> | ||
| <img className={styles.large+' '+styles[isActive]} src={icHeartLargeActive} /> | ||
| <img className={styles.large+' '+styles[!isActive]} src={icHeartLargeInactive} /> | ||
| <img className={styles.medium+' '+styles[isActive]} src={icHeartMediumActive} /> | ||
| <img className={styles.medium+' '+styles[!isActive]} src={icHeartMediumInactive} /> | ||
| {children} | ||
| </button>); | ||
| } | ||
|
|
||
| export default ButtonHeart; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| .btn { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 4px; | ||
| padding: 3px 11px; | ||
| border: 1px solid var(--gray200); | ||
| border-radius: 9999px; | ||
| background-color: white; | ||
| color: var(--gray500); | ||
| font-weight: 500; | ||
| font-size: 16px; | ||
| line-height: 26px; | ||
| } | ||
|
|
||
| .btn img.medium, | ||
| .btn img.false { | ||
| display: none; | ||
| } | ||
|
|
||
| @media (max-width: 1199px) { | ||
| .btn img.medium { | ||
| display: block; | ||
| } | ||
|
|
||
| .btn img.large, | ||
| .btn img.false { | ||
| display: none; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,55 @@ | ||
| .dropdown { | ||
| position: relative; | ||
| display: flex; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| gap: 0; | ||
| width: 130px; | ||
| padding: 0 19px; | ||
| border: 1px solid var(--gray200); | ||
| border-radius: 12px; | ||
| color: var(--gray800); | ||
| font-weight: 400; | ||
| font-size: 16px; | ||
| line-height: 26px; | ||
| } | ||
|
|
||
| .dropdown.small { | ||
| justify-content: center; | ||
| width: 42px; | ||
| padding: 0; | ||
| border: none; | ||
| } | ||
|
|
||
| .dropdownList { | ||
| .dropdown .list { | ||
| z-index: 1; | ||
| position: absolute; | ||
| top: calc(100% + 8px); | ||
| top: calc(100% + 10px); | ||
| right: 0; | ||
| width: 130px; | ||
| margin: 0; | ||
| padding: 0; | ||
| border: 1px solid var(--gray200); | ||
| border-radius: 12px; | ||
| background-color: white; | ||
| width: 139px; | ||
| } | ||
|
|
||
| .dropdownList li input { | ||
| display: block; | ||
| .dropdown .list input { | ||
| cursor: pointer; | ||
| width: 100%; | ||
| height: 41px; | ||
| padding: 8px 0 6px; | ||
| border: none; | ||
| border-bottom: 1px solid var(--gray200); | ||
| background-color: transparent; | ||
| color: var(--gray800); | ||
| border: 1px solid #D1D5DB; | ||
| background-color: white; | ||
| color: var(--gray500); | ||
| font-weight: 400; | ||
| font-size: 16px; | ||
| line-height: 26px; | ||
| } | ||
|
|
||
| .dropdownList li:last-child input { | ||
| border: none; | ||
| .dropdown .list input:first-child { | ||
| padding: 11px 0 8px; | ||
| border-bottom: none; | ||
| border-radius: 8px 8px 0 0; | ||
| } | ||
|
|
||
| .dropdown .list input:last-child { | ||
| padding: 8px 0 11px; | ||
| border-top: none; | ||
| border-radius: 0 0 8px 8px; | ||
| } | ||
|
|
||
| @media (max-width: 767px) { | ||
| .dropdown .list { | ||
| width: 102px; | ||
| } | ||
|
|
||
| .dropdown .list input { | ||
| font-size: 14px; | ||
| line-height: 17px; | ||
| } | ||
|
|
||
| .dropdown .list input:first-child { | ||
| padding: 15px 0 12px; | ||
| } | ||
|
|
||
| .dropdown .list input:last-child { | ||
| padding: 12px 0 15px; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,40 @@ | ||||||
| import { useEffect, useRef, useState } from 'react'; | ||||||
| import icArrowDown from '../assets/ic_arrow_down.svg'; | ||||||
| import icSort from '../assets/ic_sort.svg'; | ||||||
| import styles from './DropdownSort.module.css'; | ||||||
|
|
||||||
| const option = { recent: "최신순", favorite: "좋아요순", } | ||||||
|
|
||||||
| function Dropdown({ state, setState, mode }) { | ||||||
| const [isOpen, setIsOpen] = useState(false); | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💬 여담
Suggested change
|
||||||
| const dropdownRef = useRef(null); | ||||||
|
|
||||||
| useEffect(() => { | ||||||
| const handleClickOutside = (e) => { | ||||||
| if (dropdownRef.current && !dropdownRef.current.contains(e.target)) setIsOpen(false); | ||||||
| }; | ||||||
| document.addEventListener("click", handleClickOutside); | ||||||
| return () => document.removeEventListener("click", handleClickOutside);; | ||||||
| }, []); | ||||||
|
|
||||||
| return ( | ||||||
| <button | ||||||
| type="button" | ||||||
| className={`${styles.dropdown} ${(mode === "Mobile" && styles.small)}`} | ||||||
| onClick={() => setIsOpen((prev) => !prev)} | ||||||
| ref={dropdownRef} | ||||||
| > | ||||||
| { mode !== "Mobile" | ||||||
| ? <> <div>{option[state]}</div> <img src={icArrowDown} /> </> | ||||||
| : <img src={icSort} /> } | ||||||
| { isOpen && | ||||||
| <ul className={styles.dropdownList}> | ||||||
| {Object.entries(option).map(([key, value]) => (<li key={key}> | ||||||
| <input type="button" value={value} onClick={() => setState(key)} /> | ||||||
| </li>))} | ||||||
| </ul>} | ||||||
| </button> | ||||||
| ); | ||||||
| } | ||||||
|
|
||||||
| export default Dropdown; | ||||||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💊 제안
동일한 이미지를 사이즈별로 저장해서 사용하셔야할 필요가 있을까요? 제가 보기엔 하나로 충분해보입니다~