-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Revert "[최제원] Sprint4 (#155)" This reverts commit e46d37a. * react npm start 오류로 인한 npm install 및 react 개발환경 셋팅 * header 추가 및 GET 리퀘스트를 받아 itemList 정렬 * 클래스 이름 추가 및 CSS 추가 * 파일 구조 정리 및 상품 정렬 쿼리 생성 * 최신순, 인기순 드롭아웃 html 구현과 검색 input 기능 html 구현 * form 태그 내부에 있는 태그들의 css 추가 및 수정 * 스프린트 미션5 미완성으로 코드잇에서 제공한 스프린트 미션5 완성본을 표본으로 커밋 * addItemPage html과 css 추가 * 이미지 삭제 기능 추가
- Loading branch information
Showing
50 changed files
with
1,097 additions
and
523 deletions.
There are no files selected for viewing
This file contains 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,10 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html lang="ko"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<title>판다 마켓</title> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>판다마켓</title> | ||
|
||
<!-- | ||
Font preloading | ||
- 페이지가 처음 로딩될 때 텍스트가 순간적으로 깜빡이거나 바뀌는 듯한 현상을 보신 적이 있으신가요? (Flash of Unstyled Text, FOUT) | ||
브라우저가 지정된 폰트를 다운로드 받는 동안 임시로 대체 폰트("fallback font")를 사용하기 때문인데요, 폰트를 preload하면 텍스트 렌더링을 보다 매끄럽게 할 수 있습니다. | ||
- 브라우저는 rel="preload"로 지정된 리소스를 우선적으로 준비합니다. | ||
- 폰트, 페이지 상단의 이미지, 가장 먼저 실행되어야 하는 스크립트 등에 preload 속성을 사용하는 경우가 많아요. | ||
- href의 리소스 유형에 따라 <link>의 `as` 속성값을 정해야 해요. 일반적인 폰트 파일(예: .woff, .ttf 등)이라면 as="font"겠지만, 우리가 사용하는 웹폰트는 css 형식이기 때문에 as="style"을 사용합니다. | ||
--> | ||
<link | ||
rel="preload" | ||
href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard.min.css" | ||
as="style" | ||
onload="this.onload=null;this.rel='stylesheet'" | ||
/> | ||
<!-- 간혹 보안 등의 이슈로 자바스크립트를 지원하지 않는 브라우저 환경에서도 최소한의 스타일이 로딩될 수 있도록 합니다. --> | ||
<noscript | ||
><link | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard.min.css" | ||
/></noscript> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
|
This file was deleted.
Oops, something went wrong.
This file contains 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 @@ | ||
import { BrowserRouter, Route, Routes } from "react-router-dom"; | ||
import HomePage from "./pages/HomePage/HomePage"; | ||
import LoginPage from "./pages/LoginPage/LoginPage"; | ||
import MarketPage from "./pages/MarketPage/MarketPage"; | ||
import AddItemPage from "./pages/AddItemPage/AddItemPage"; | ||
import CommunityFeedPage from "./pages/CommunityFeedPage/CommunityFeedPage"; | ||
import Header from "./components/Layout/Header"; | ||
|
||
function App() { | ||
return ( | ||
<BrowserRouter> | ||
{/* Global Navigation Bar */} | ||
<Header /> | ||
|
||
<div className="withHeader"> | ||
<Routes> | ||
{/* React Router v6부터는 path="/" 대신 간단하게 `index`라고 표기하면 돼요 */} | ||
<Route index element={<HomePage />} /> | ||
<Route path="login" element={<LoginPage />} /> | ||
<Route path="items" element={<MarketPage />} /> | ||
<Route path="additem" element={<AddItemPage />} /> | ||
<Route path="community" element={<CommunityFeedPage />} /> | ||
</Routes> | ||
</div> | ||
</BrowserRouter> | ||
); | ||
} | ||
|
||
export default App; |
This file was deleted.
Oops, something went wrong.
This file contains 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,18 @@ | ||
export async function getProducts(params = {}) { | ||
// URLSearchParams을 이용하면 파라미터 값을 자동으로 쉽게 인코딩할 수 있어요. | ||
const query = new URLSearchParams(params).toString(); | ||
|
||
try { | ||
const response = await fetch( | ||
`https://panda-market-api.vercel.app/products?${query}` | ||
); | ||
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; | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,45 @@ | ||
.headerLeft { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.headerLogo { | ||
margin-right: 16px; | ||
} | ||
|
||
.globalHeader nav ul { | ||
display: flex; | ||
list-style: none; | ||
gap: 8px; | ||
font-weight: bold; | ||
font-size: 16px; | ||
color: #4b5563; | ||
} | ||
|
||
.globalHeader nav ul li a:hover { | ||
color: var(--blue); | ||
} | ||
|
||
.loginLink { | ||
font-size: 16px; | ||
font-weight: 600; | ||
border-radius: 8px; | ||
padding: 11.5px 23px; | ||
} | ||
|
||
@media (min-width: 768px) { | ||
.globalHeader nav ul { | ||
gap: 36px; | ||
font-size: 18px; | ||
} | ||
|
||
.headerLogo { | ||
margin-right: 35px; | ||
} | ||
} | ||
|
||
@media (min-width: 1280px) { | ||
.headerLogo { | ||
margin-right: 47px; | ||
} | ||
} |
This file contains 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,42 @@ | ||
import React from "react"; | ||
import Logo from "../../assets/images/logo/logo.svg"; | ||
import { Link, NavLink } from "react-router-dom"; | ||
import "./Header.css"; | ||
|
||
// react-router-dom의 NavLink를 이용하면 활성화된 네비게이션 항목을 하이라이트해줄 수 있어요! | ||
function getLinkStyle({ isActive }) { | ||
return { color: isActive ? "var(--blue)" : undefined }; | ||
} | ||
|
||
function Header() { | ||
return ( | ||
<header className="globalHeader"> | ||
<div className="headerLeft"> | ||
<Link to="/" className="headerLogo" aria-label="홈으로 이동"> | ||
<img src={Logo} alt="판다마켓 로고" width="153" /> | ||
</Link> | ||
|
||
<nav> | ||
<ul> | ||
<li> | ||
<NavLink to="/community" style={getLinkStyle}> | ||
자유게시판 | ||
</NavLink> | ||
</li> | ||
<li> | ||
<NavLink to="/items" style={getLinkStyle}> | ||
중고마켓 | ||
</NavLink> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> | ||
|
||
<Link to="/login" className="loginLink button"> | ||
로그인 | ||
</Link> | ||
</header> | ||
); | ||
} | ||
|
||
export default Header; |
Oops, something went wrong.