Skip to content
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

[이형준]sprint7 #209

Merged
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
13 changes: 7 additions & 6 deletions build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"files": {
"main.css": "/static/css/main.f0f3ce1f.css",
"main.js": "/static/js/main.7465973d.js",
"main.css": "/static/css/main.f3ee4894.css",
"main.js": "/static/js/main.f8b8e179.js",
"static/media/img_home_top.png": "/static/media/img_home_top.ebda87f1b39094af7a56.png",
"static/media/img_home_bottom.png": "/static/media/img_home_bottom.55f9b5712afe428c859e.png",
"static/media/img_home_search.png": "/static/media/img_home_search.5edb17ff2d752ee28431.png",
"static/media/img_home_items.png": "/static/media/img_home_items.7262bacba747d4f77351.png",
"static/media/img_home_register.png": "/static/media/img_home_register.ea82fb5e2972aae5bdf7.png",
"static/media/img_no_comments.png": "/static/media/img_no_comments.467270e26d3f117ad44a.png",
"static/media/logo_with_typo.png": "/static/media/logo_with_typo.3a8ee6e8a55ab6341a7b.png",
"index.html": "/index.html",
"main.f0f3ce1f.css.map": "/static/css/main.f0f3ce1f.css.map",
"main.7465973d.js.map": "/static/js/main.7465973d.js.map"
"main.f3ee4894.css.map": "/static/css/main.f3ee4894.css.map",
"main.f8b8e179.js.map": "/static/js/main.f8b8e179.js.map"
},
"entrypoints": [
"static/css/main.f0f3ce1f.css",
"static/js/main.7465973d.js"
"static/css/main.f3ee4894.css",
"static/js/main.f8b8e179.js"
]
}
2 changes: 1 addition & 1 deletion build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="ko"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico" type="image/x-icon"/><title>판다 마켓</title><meta property="og:title" content="판다마켓"/><meta property="og:type" content="website"/><meta property="og:url" content="https://leehj322-codeit.netlify.app/"/><meta property="og:discription" content="일상의 모든 물건을 거래해보세요"/><meta property="og:image" content="./preview_img.png"/><meta name="twitter:title" content="판다마켓"/><meta name="twitter:card" content="summary"/><meta name="twitter:url" content="https://leehj322-codeit.netlify.app/"/><meta name="twitter:description" content="일상의 모든 물건을 거래해보세요"/><meta name="twitter:image" content="./preview_img.png"/><script defer="defer" src="/static/js/main.7465973d.js"></script><link href="/static/css/main.f0f3ce1f.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
<!doctype html><html lang="ko"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico" type="image/x-icon"/><title>판다 마켓</title><meta property="og:title" content="판다마켓"/><meta property="og:type" content="website"/><meta property="og:url" content="https://leehj322-codeit.netlify.app/"/><meta property="og:discription" content="일상의 모든 물건을 거래해보세요"/><meta property="og:image" content="./preview_img.png"/><meta name="twitter:title" content="판다마켓"/><meta name="twitter:card" content="summary"/><meta name="twitter:url" content="https://leehj322-codeit.netlify.app/"/><meta name="twitter:description" content="일상의 모든 물건을 거래해보세요"/><meta name="twitter:image" content="./preview_img.png"/><script defer="defer" src="/static/js/main.f8b8e179.js"></script><link href="/static/css/main.f3ee4894.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
2 changes: 0 additions & 2 deletions build/static/css/main.f0f3ce1f.css

This file was deleted.

1 change: 0 additions & 1 deletion build/static/css/main.f0f3ce1f.css.map

This file was deleted.

2 changes: 2 additions & 0 deletions build/static/css/main.f3ee4894.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/static/css/main.f3ee4894.css.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions build/static/js/main.7465973d.js

This file was deleted.

1 change: 0 additions & 1 deletion build/static/js/main.7465973d.js.map

This file was deleted.

3 changes: 3 additions & 0 deletions build/static/js/main.f8b8e179.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/static/js/main.f8b8e179.js.map

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
115 changes: 101 additions & 14 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"react-responsive": "^10.0.0",
"react-router-dom": "^6.23.1",
"react-scripts": "5.0.1",
"styled-components": "^6.1.11",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
34 changes: 18 additions & 16 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
import "./styles/base/reset.css";
import "./styles/base/global.css";
import "./assets/styles/reset.css";
import "./assets/styles/global.css";

import { Routes, Route } from "react-router-dom";

import Home from "./pages/Home";
import Login from "./pages/Login";
import Signin from "./pages/Signin";
import Items from "./pages/Items";
import AddItem from "./pages/AddItem";
import Faq from "./pages/Faq";
import Privacy from "./pages/Privacy";
import HomePage from "./pages/Home/HomePage";
import LoginPage from "./pages/Auth/LoginPage";
import SigninPage from "./pages/Auth/SigninPage";
import UsedMarketPage from "./pages/Market/UsedMarketPage";
import ItemDetailPage from "./pages/Market/ItemDetailPage";
import AddItemPage from "./pages/Market/AddItemPage";
import FaqPage from "./pages/Faq/FaqPage";
import PrivacyPage from "./pages/Privacy/PrivacyPage";
import NotFoundPage from "./pages/NotFoundPage";

function App() {
return (
<Routes>
<Route exact path="/" element={<Home />} />
<Route exact path="/login" element={<Login />} />
<Route exact path="/signin" element={<Signin />} />
<Route exact path="/items" element={<Items />} />
<Route exact path="/additem" element={<AddItem />} />
<Route exact path="/privacy" element={<Privacy />} />
<Route exact path="/faq" element={<Faq />} />
<Route exact index element={<HomePage />} />
<Route exact path="/login" element={<LoginPage />} />
<Route exact path="/signin" element={<SigninPage />} />
<Route exact path="/items" element={<UsedMarketPage />} />
<Route path="/items/:itemId" element={<ItemDetailPage />} />
<Route exact path="/additem" element={<AddItemPage />} />
<Route exact path="/privacy" element={<PrivacyPage />} />
<Route exact path="/faq" element={<FaqPage />} />
<Route path="*" element={<NotFoundPage />} />
</Routes>
);
Expand Down
43 changes: 41 additions & 2 deletions src/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,51 @@ export async function getProducts({ orderBy, page, pageSize }) {
const response = await fetch(url);
if (!response.ok) {
throw new Error(
`상품정보를 불러오는데 실패했습니다. Status: ${response.status}`
`상품목록을 불러오는데 실패했습니다. Status: ${response.status}`
);
}
const body = await response.json();
return body;
} catch (error) {
throw new Error(`상품정보 요청에 실패했습니다. Error: ${error.message}`);
throw new Error(`상품목록 요청에 실패했습니다. Error: ${error.message}`);
}
}

export async function getProductDetail({ productId }) {
const url = `${BASE_URL}/products/${productId}`;

try {
const response = await fetch(url);
if (!response.ok) {
throw new Error(
`상품상세정보를 불러오는데 실패했습니다. Status: ${response.status}`
);
}
const body = await response.json();
return body;
} catch (error) {
throw new Error(
`상품상세정보 요청에 실패했습니다. Error: ${error.message}`
);
}
}

export async function getProductComments({ productId, limit }) {
const query = `limit=${limit}`;
const url = `${BASE_URL}/products/${productId}/comments?${query}`;

try {
const response = await fetch(url);
if (!response.ok) {
throw new Error(
`상품댓글정보를 불러오는데 실패했습니다. Status: ${response.status}`
);
}
const body = await response.json();
return body;
} catch (error) {
throw new Error(
`상품댓글정보 요청에 실패했습니다. Error: ${error.message}`
);
Comment on lines +40 to +56
Copy link
Collaborator

Choose a reason for hiding this comment

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

깔끔하게 잘하셨어요! 👍 파라미터도 지금처럼 객체로 받으면 getProductComments 함수를 사용할 때 가독성이 올라가고, 확장성에 더 좋아요.

}
}
File renamed without changes
File renamed without changes
Binary file added src/assets/images/ic_back.png
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
Binary file added src/assets/images/ic_kebab.png
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
Binary file added src/assets/images/img_no_comments.png
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 4 additions & 0 deletions src/styles/base/global.css → src/assets/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ html {
font-family: Pretendard, sans-serif;
}

* {
font-family: Pretendard, sans-serif;
}

button,
input {
border: none;
Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions src/components/@shared/BlueButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import styled from "styled-components";

const BlueButton = styled.button`
border: none;
background-color: var(--brand-blue);
color: var(--gray-00);
text-align: center;
font-weight: 600;

&:disabled {
background-color: var(--cool-gray-400);
}
`;

export default BlueButton;
Loading
Loading