-
Notifications
You must be signed in to change notification settings - Fork 35
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 #217
Merged
arthurkimdev
merged 24 commits into
codeit-bootcamp-frontend:React-이재완
from
jaewan0:React-이재완-sprint7
Jul 8, 2024
The head ref may contain hidden characters: "React-\uC774\uC7AC\uC644-sprint7"
Merged
[이재완] Sprint7 #217
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
764aedf
스프린트 미션 1
jaewan0 e2d7c64
Merge pull request #24 from jaewan0/Basic-이재완-sprint8
201steve 70a7194
Delete btn_image from images
jaewan0 07684b0
Rename file
jaewan0 5dcf5c9
Modify code
jaewan0 d8c4319
Add items, privacy, faq pages
jaewan0 9bcb9a0
Add login page
jaewan0 bee8a80
Add signup page
jaewan0 2ffb310
Add visibility button
jaewan0 ab92e9a
Fix Global Navigation Bar
jaewan0 f34de28
Merge pull request #50 from jaewan0/Basic-이재완-sprint2
201steve 13e7ba7
Merge pull request #1 from codeit-bootcamp-frontend/Basic-이재완
jaewan0 08d7dc0
Apply template code
jaewan0 34f0455
create(signin.js): 로그인 페이지 자바스크립트 파일 생성
jaewan0 4ba75e7
feat(signin): input 값 유효성 검사 기능 추가
jaewan0 bfdb95e
feat(signup): input 값 유효성 검사 기능 추가
jaewan0 95b5403
feat(signup): 충돌 해결을 위한 커밋
jaewan0 932046e
Merge branch 'Basic-이재완' of https://github.com/jaewan0/8-Sprint-Missi…
jaewan0 bf13403
Apply template code
jaewan0 730f9d3
feat(Item): 상품 상세 페이지 구현(구조분해 오류)
jaewan0 4c91566
fix(Item): 구조분해 오류 해결
jaewan0 74d2f89
Resolve merge conflinct
jaewan0 930c6e4
add: .gitignore file 추가
arthurkimdev a6c3550
Remove node_modules from git cache
arthurkimdev 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 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,26 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# .env | ||
.env |
Large diffs are not rendered by default.
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
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,8 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html lang="ko"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<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 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
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.
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 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,53 @@ | ||
import React from "react"; | ||
import Logo from "../../assets/images/logo/logo.svg"; | ||
import { Link, NavLink, useLocation } from "react-router-dom"; | ||
import "./Header.css"; | ||
|
||
// react-router-dom의 NavLink를 이용하면 활성화된 네비게이션 항목을 하이라이트해줄 수 있어요! | ||
function getLinkStyle({ isActive }) { | ||
return { color: isActive ? "var(--blue)" : undefined }; | ||
} | ||
|
||
function Header() { | ||
const location = useLocation(); // 현재 경로 정보 | ||
|
||
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> | ||
{/* React Router v6 이전 버전에서는 NavLink `isActive` prop으로 바로 스타일 정보를 넣어줄 수 있었지만, 최신 버전에서는 className 또는 style을 이용해야 해요 */} | ||
{/* /additem 페이지에서도 네이게이션의 '중고마켓' 링크 하이라이트 */} | ||
<NavLink | ||
to="/items" | ||
style={({ isActive }) => | ||
location.pathname === "/additem" || isActive | ||
? { color: "var(--blue)" } | ||
: {} | ||
} | ||
> | ||
중고마켓 | ||
</NavLink> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> | ||
|
||
<Link to="/login" className="loginLink button"> | ||
로그인 | ||
</Link> | ||
</header> | ||
); | ||
} | ||
|
||
export default Header; |
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,27 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import { ReactComponent as CloseIcon } from "../../assets/images/icons/ic_x.svg"; | ||
|
||
const Button = styled.button` | ||
background-color: ${({ theme }) => theme.colors.gray[0]}; | ||
width: 20px; | ||
height: 20px; | ||
border-radius: 50%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
&:hover { | ||
background-color: ${({ theme }) => theme.colors.blue[0]}; | ||
} | ||
`; | ||
|
||
function DeleteButton({ onClick, label }) { | ||
return ( | ||
<Button aria-label={`${label} 삭제`} onClick={onClick}> | ||
<CloseIcon /> | ||
</Button> | ||
); | ||
} | ||
|
||
export default DeleteButton; |
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,33 @@ | ||
.sortButtonWrapper { | ||
position: relative; | ||
} | ||
|
||
.sortDropdownTriggerButton { | ||
border: 1px solid #e5e7eb; | ||
border-radius: 12px; | ||
padding: 9px; | ||
margin-left: 8px; | ||
} | ||
|
||
.dropdownMenu { | ||
position: absolute; | ||
top: 110%; | ||
right: 0; | ||
background: #fff; | ||
border-radius: 8px; | ||
border: 1px solid #e5e7eb; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | ||
z-index: 99; | ||
} | ||
|
||
.dropdownItem { | ||
padding: 12px 44px; | ||
border-bottom: 1px solid #e5e7eb; | ||
font-size: 16px; | ||
color: #1f2937; | ||
cursor: pointer; | ||
} | ||
|
||
.dropdownItem:last-child { | ||
border-bottom: none; | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이게 API 요청이 여러개 될때
https://panda-market-api.vercel.app
값은 반복될 수 있어요.해당 파일 상위에
선언해서 공통 일괄 사용하는 방법이 좋겠습니다.