-
Notifications
You must be signed in to change notification settings - Fork 31
[송미진] sprint7 #139
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
dongqui
merged 7 commits into
codeit-bootcamp-frontend:React-송미진
from
songmijin824:React-송미진
Apr 21, 2025
The head ref may contain hidden characters: "React-\uC1A1\uBBF8\uC9C4"
Merged
[송미진] sprint7 #139
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6f3a51b
상품상세보기 페이지 추가
songmijin824 02713a5
스프린트 미션 7 완료!
songmijin824 08c2bbf
스프린트 미션 7 완료! 반응형추가
songmijin824 b24e04b
빌드
songmijin824 a7b64c1
빌드 2차시도
songmijin824 51e8b57
사용자 프로필 스타일 수정
songmijin824 5f6232c
빌드하고 재업
songmijin824 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "cSpell.words": [ | ||
| "kakao", | ||
| "maincomponents", | ||
| "Pretendard", | ||
| "selectbox" | ||
| ] | ||
| } |
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,6 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "baseUrl": "src" | ||
| }, | ||
| "include": ["src"] | ||
| } |
Large diffs are not rendered by default.
Oops, something went wrong.
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,6 @@ | ||
| module.exports = { | ||
| plugins: { | ||
| tailwindcss: {}, | ||
| autoprefixer: {}, | ||
| }, | ||
| } |
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 was deleted.
Oops, something went wrong.
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,92 @@ | ||
| import axios from 'axios'; | ||
|
|
||
| const requestor = axios.create({ | ||
| baseURL: 'https://panda-market-api.vercel.app', | ||
| timeout: 60000, | ||
| headers: { | ||
| 'Content-Type': 'application/json', | ||
| Accept: 'application/json', | ||
| }, | ||
| }); | ||
|
|
||
| // 상품 리스트 가져오기 | ||
| export async function getProducts(query) { | ||
| const objectToQueryString = (obj) => { | ||
| const params = new URLSearchParams(); | ||
| Object.entries(obj).forEach(([key, value]) => { | ||
| if (value !== undefined && value !== null && value !== "") { | ||
| params.set(key, String(value)); | ||
| } | ||
| }); | ||
| return params.toString(); | ||
| }; | ||
|
|
||
| const queryString = objectToQueryString(query); | ||
|
|
||
| try { | ||
| const response = await requestor.get(`/products?${queryString}`); | ||
| return response.data; | ||
| } catch (error) { | ||
| console.error("상품 목록 조회 실패:", error); | ||
| throw error; | ||
| } | ||
| } | ||
|
|
||
| // 상품 상세 | ||
| export async function getProductsDetail(id) { | ||
| try { | ||
| const response = await requestor.get(`/products/${id}`); | ||
| return response.data; | ||
| } catch (error) { | ||
| console.error("상품 상세 조회 실패:", error); | ||
| throw error; | ||
| } | ||
| } | ||
|
|
||
| // 상품 댓글 | ||
| export async function getProductsComments(id, limit = 4, cursor = 0) { | ||
| try { | ||
| const response = await requestor.get(`/products/${id}/comments?limit=${limit}&cursor=${cursor}`); | ||
| return response.data; | ||
| } catch (error) { | ||
| console.error("댓글 목록 조회 실패:", error); | ||
| throw error; | ||
| } | ||
| } | ||
|
|
||
| // 댓글 수정 | ||
| export async function updateComment(commentId, content) { | ||
| console.log('updateComments',commentId); | ||
| try { | ||
| const response = await requestor.patch(`/comments/${commentId}`, { | ||
| content, | ||
| }); | ||
| return response.data; | ||
| } catch (error) { | ||
| console.error(" 댓글 수정 실패:", error); | ||
| throw error; | ||
| } | ||
| } | ||
| // 댓글 삭제 | ||
| export async function deleteComment(commentId) { | ||
| console.log('deleteComments',commentId); | ||
| try { | ||
| await requestor.delete(`/comments/${commentId}`); | ||
| } catch (error) { | ||
| console.error('댓글 삭제 실패:', error); | ||
| throw error; | ||
| } | ||
| } | ||
| // 댓글 등록 | ||
| export async function postProductComment(id, content) { | ||
| console.log('postComments',id); | ||
| try { | ||
| const response = await requestor.post(`/products/${id}/comments`, { | ||
| content, | ||
| }); | ||
| return response.data; | ||
| } catch (error) { | ||
| console.error('댓글 작성 실패:', error); | ||
| throw error; | ||
| } | ||
| } |
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.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,33 @@ | ||
| import React, { useState } from 'react'; | ||
| import { Outlet,useLocation } from 'react-router-dom'; | ||
| import Nav from './layout/Nav'; | ||
| import Footer from './layout/Footer'; | ||
| import ProductNav from './layout/ProductNav'; | ||
| import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
|
|
||
| function App({ Component, pageProps }) { | ||
| const [queryClient] = useState(() => new QueryClient()); | ||
|
|
||
| const location = useLocation(); | ||
| const isItemsDetail = /^\/ItemsBox\/ItemsDetail\/\d+$/.test(location.pathname); | ||
|
|
||
| return ( | ||
| <QueryClientProvider client={queryClient}> | ||
| <div> | ||
| { | ||
| location.pathname === '/ItemsBox' || | ||
| location.pathname === '/ItemsDetail' || | ||
| location.pathname === '/Boards' || | ||
| isItemsDetail ? | ||
| <ProductNav/> | ||
| : | ||
| <Nav/> | ||
| } | ||
| <div><Outlet /></div> | ||
| <Footer/> | ||
| </div> | ||
| </QueryClientProvider> | ||
| ); | ||
| } | ||
|
|
||
| export default App; | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.