Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 24 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@testing-library/user-event": "^13.5.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-router-dom": "^7.9.5",
"react-router-dom": "^6.30.1",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
Expand Down
27 changes: 19 additions & 8 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
import { BrowserRouter, Routes, Route } from "react-router-dom";
import React from "react";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import Main from "./pages/Main";
import Login from "./pages/Login";
import SignUp from "./pages/SignUp";
import Market from "./pages/Market"
import MarketPage from "./pages/MarketPage/MarketPage";
import Login from "./pages/login/Login";
import SignUp from "./pages/signup/SignUp";
import Item from "./pages/item/Item";
import Privacy from "./pages/privacy/Privacy";
import Faq from "./pages/faq/Faq";
import RegistrationPage from "./pages/registration/RegistrationPage";
import ProductDetailPage from "./pages/product/ProductDetailPage";

function App() {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<Main />} />
<Route path="./pages/Login" element={<Login />} />
{/* <Route path="/signup" element={<SignUp />} /> */}
{/* <Route path="/Market" element={<Market />} /> */}
<Route path="/" element={<Main />} />
<Route path="/market" element={<MarketPage />} />
<Route path="/login" element={<Login />} />
<Route path="/signup" element={<SignUp />} />
<Route path="/items" element={<Item />} />
<Route path="/registration" element={<RegistrationPage />} />
<Route path="/product/:id" element={<ProductDetailPage />} />
<Route path="/privacy" element={<Privacy />} />
<Route path="/faq" element={<Faq />} />
</Routes>
</BrowserRouter>
);
Expand Down
40 changes: 40 additions & 0 deletions src/api/itemApi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export async function getProducts(params = {}) {
const query = new URLSearchParams(params).toString();

try {
const response = await fetch(
` https://panda-market-api.vercel.app/docs/products?${query}`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

민식님께서 만든 백엔드랑 연결하시려면 따로 이 주소를 수정해주시면 됩니다. 지금은 미완성이라 이렇게 두신 것 같네요

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

더불어 https://panda-market-api.vercel.app/ 이 주소 혹은 API를 쏘게 될 주소는 따로 분리가 가능합니다!
그래서 보통 실제 프로덕션 배포 환경과 개발서버 배포 환경 / 로컬 배포 환경 등 환경에 따라서 이 API 주소가 바뀔 수 있어서 해당 부분은 분리해서 한 곳에서 도메인을 관리해 사용하시는 것이 매우 유용합니다!

);
if (!response.ok) {
throw new Error(`HTTP error: ${response.status}`);
}
const body = await response.json();
return body;
} catch (error) {
console.error("Failed to fetch products:", error);
throw error;
}
}

export async function createProduct(productData) {
try {
const response = await fetch(
`https://panda-market-api.vercel.app/docs/products`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(productData),
}
);
if (!response.ok) {
throw new Error(`HTTP error: ${response.status}`);
}
const body = await response.json();
return body;
} catch (error) {
console.error("Failed to create product:", error);
throw error;
}
}
16 changes: 16 additions & 0 deletions src/assets/Matket/defaultImg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/icons/arrow_left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/icons/arrow_right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/icons/ic_arrow_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/icons/ic_heart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/icons/ic_search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/assets/images/icons/ic_sort_mobile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/assets/images/logo/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ const USER_DATA = [
{ email: "[email protected]", password: "codeit505!" },
{ email: "[email protected]", password: "codeit606!" },
];

export default USER_DATA;
25 changes: 0 additions & 25 deletions src/components/Errormodals.js

This file was deleted.

Loading