Skip to content
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
54 changes: 54 additions & 0 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 @@ -8,6 +8,7 @@
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^7.6.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
Expand Down
Binary file removed public/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="ko">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
Expand All @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>판다마켓</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

35 changes: 17 additions & 18 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import logo from './logo.svg';
import './App.css';
import { BrowserRouter, Route, Routes } from "react-router-dom";
import Header from "./components/Header";
import HomePage from "./pages/Homepage/HomePage";
import CommunityPage from "./pages/CommunityPage/CommunityPage";
import ProductsPage from "./pages/ProductsPage/ProductsPage";
import LoginPage from "./pages/LoginPage/LoginPage";

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
<BrowserRouter>
<Header />
<div className="container">
<Routes>
<Route index element={<HomePage />} />
<Route path="community" element={<CommunityPage />} />
<Route path="items" element={<ProductsPage />} />
<Route path="login" element={<LoginPage />} />
</Routes>
</div>
</BrowserRouter>
);
}

Expand Down
8 changes: 0 additions & 8 deletions src/App.test.js

This file was deleted.

12 changes: 12 additions & 0 deletions src/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const BASE_URL = "https://panda-market-api.vercel.app";
Copy link
Collaborator

Choose a reason for hiding this comment

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

BASE_URL와 같이 민감한 정보의 경우 일반적으로 외부 공개를 막기위해 환경변수로 관리한답니다. React의 경우 환경변수 설정시 변수명에 REACT_APP_ 접두어가 꼭 필요하니, 아래 아티클 확인해주시고 환경변수 설정해보세요!

참고


export async function getProducts(params = {}) {
const query = new URLSearchParams(params).toString();

const response = await fetch(`${BASE_URL}/products?${query}`);
if (!response.ok) {
throw new Error("상품을 불러오는데 실패했습니다.");
}
const body = await response.json();
return body;
}
3 changes: 3 additions & 0 deletions src/assets/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/leftBtn.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/logo.png
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/rightBtn.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/searchicon.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/sorticon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/userMenu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions src/components/Header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
.header {
display: flex;
justify-content: space-between;
align-items: center;
}
.headerLeft {
display: flex;
align-items: center;
}

.logo {
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
}
.logo a {
color: var(--primary-color);
font-size: var(--text-xl);
font-weight: 700;
line-height: 100%;
cursor: pointer;
}

.headerNav {
display: flex;
list-style: none;
gap: 10px;
margin-left: 16px;
}

.headerNav a {
color: var(--gray);
font-size: var(--text-base);
line-height: 26px;
font-weight: 600;
}

.headerUser {
width: 40px;
height: 40px;
}

@media (min-width: 768px) {
.logo a {
font-size: 25.63px;
}
.headerNav a {
font-size: var(--text-lg);
}
}

@media (min-width: 1280px) {
}
35 changes: 35 additions & 0 deletions src/components/Header.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Link, NavLink } from "react-router-dom";
import "./Header.css";
import usermenu from "../assets/userMenu.png";
import logo from "../assets/logo.png";

function Header() {
return (
<header className="header">
<div className="headerLeft">
<Link to="/" className="logo">
<img src={logo} alt="판다마켓 로고" width="40px" />
<a href="/" aria-label="홈으로 이동">
판다마켓
</a>
</Link>
<nav>
<ul className="headerNav">
<li>
<NavLink to="/community">자유게시판</NavLink>
</li>
<li>
<NavLink to="/items">중고마켓</NavLink>
</li>
</ul>
</nav>
</div>

<Link className="headerUser" to="/login">
<img src={usermenu} alt="유저메뉴" />
</Link>
</header>
);
}

export default Header;
13 changes: 0 additions & 13 deletions src/index.css

This file was deleted.

16 changes: 5 additions & 11 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./styles/global.css";

const root = ReactDOM.createRoot(document.getElementById('root'));
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
1 change: 0 additions & 1 deletion src/logo.svg

This file was deleted.

5 changes: 5 additions & 0 deletions src/pages/CommunityPage/CommunityPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function CommunityPage() {
return <div>CommunityPage</div>;
}

export default CommunityPage;
5 changes: 5 additions & 0 deletions src/pages/Homepage/HomePage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function HomaPage() {
return <div>HomePage</div>;
}

export default HomaPage;
5 changes: 5 additions & 0 deletions src/pages/LoginPage/LoginPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function LoginPage() {
return <div>LoginPage</div>;
}

export default LoginPage;
Loading
Loading