-
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 #224
The head ref may contain hidden characters: "React-\uC870\uADDC\uC9C4-sprint7"
[조규진] Sprint7 #224
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* /index.html 200 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,20 +4,18 @@ | |
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta property="og:type" content="website" /> | ||
<meta property="og:url" content="https://codeit8-sprint-mission-jgj.netlify.app/" /> | ||
<meta property="og:url" content="https://jgj-sprint.netlify.app/" /> | ||
<meta property="og:title" content="판다마켓" /> | ||
<meta property="og:image" content="%PUBLIC_URL%/og-image.png" /> | ||
<meta property="og:image" content="https://jgj-sprint.netlify.app/og-image.png" /> | ||
<meta property="og:description" content="일상의 모든 물건을 거래해 보세요" /> | ||
<title>판다마켓</title> | ||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
<link rel="icon" href="favicon.ico" /> | ||
<link | ||
rel="stylesheet" | ||
as="style" | ||
crossorigin | ||
href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard.min.css" /> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
</body> | ||
<body id="root"></body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
main { | ||
margin-top: var(--header-height); | ||
margin: var(--header-height) 16px; | ||
} | ||
|
||
@media (min-width: 768px) { | ||
main { | ||
margin: var(--header-height) 24px; | ||
} | ||
} | ||
|
||
@media (min-width: 1280px) { | ||
main { | ||
max-width: 1200px; | ||
margin: var(--header-height) auto; | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Outlet } from 'react-router-dom'; | ||
import './App.css'; | ||
import Header from './Layout/Header.jsx'; | ||
|
||
function App() { | ||
return ( | ||
<> | ||
<Header /> | ||
|
||
<main> | ||
<Outlet /> | ||
</main> | ||
</> | ||
); | ||
} | ||
|
||
export default App; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import { Helmet } from 'react-helmet-async'; | ||
|
||
function HomePage() { | ||
return ( | ||
<> | ||
<Helmet> | ||
<title>판다마켓</title> | ||
</Helmet> | ||
<main> | ||
<section class='banner hero'> | ||
<div class='wrapper'> | ||
<h2> | ||
일상의 모든 물건을 | ||
<br /> | ||
거래해 보세요 | ||
</h2> | ||
<a href='items.html' class='button pill'> | ||
구경하러 가기 | ||
</a> | ||
</div> | ||
</section> | ||
|
||
<section class='wrapper features'> | ||
<div class='feature'> | ||
<img src='images/home/feature1_hot_item.png' alt='인기 상품' /> | ||
<div class='feature-content'> | ||
<h3>Hot Item</h3> | ||
<h2> | ||
인기 상품을 | ||
<br /> | ||
확인해 보세요 | ||
</h2> | ||
<p class='feature-description'> | ||
가장 HOT한 중고거래 물품을 | ||
<br /> | ||
판다마켓에서 확인해 보세요 | ||
</p> | ||
</div> | ||
</div> | ||
<div class='feature'> | ||
<img src='images/home/feature2_search.png' alt='검색 기능' /> | ||
<div class='feature-content'> | ||
<h3>Search</h3> | ||
<h2> | ||
구매를 원하는 | ||
<br /> | ||
상품을 검색하세요 | ||
</h2> | ||
<p class='feature-description'> | ||
구매하고 싶은 물품은 검색해서 | ||
<br /> | ||
쉽게 찾아보세요 | ||
</p> | ||
</div> | ||
</div> | ||
<div class='feature'> | ||
<img src='images/home/feature3_register.png' alt='판매 상품 등록' /> | ||
<div class='feature-content'> | ||
<h3>Register</h3> | ||
<h2> | ||
판매를 원하는 | ||
<br /> | ||
상품을 등록하세요 | ||
</h2> | ||
<p class='feature-description'> | ||
어떤 물건이든 판매하고 싶은 상품을 | ||
<br /> | ||
쉽게 등록하세요 | ||
</p> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<section class='banner bottom'> | ||
<div class='wrapper'> | ||
<h2> | ||
믿을 수 있는 | ||
<br /> | ||
판다마켓 중고거래 | ||
</h2> | ||
</div> | ||
</section> | ||
</main> | ||
|
||
<footer> | ||
<address>©codeit - 2024</address> | ||
<div class='footer-menu'> | ||
<a href='privacy.html'>Privacy Policy</a> | ||
<a href='faq.html'>FAQ</a> | ||
</div> | ||
<nav class='social-media'> | ||
<a href='https://www.facebook.com/' target='_blank' rel='noopener noreferrer'> | ||
<img src='images\social\ic_facebook.png' alt='페이스북' width='20px' /> | ||
</a> | ||
<a href='https://twitter.com/' target='_blank' rel='noopener noreferrer'> | ||
<img src='images\social\ic_twitter.png' alt='트위터' width='20px' /> | ||
</a> | ||
<a href='https://www.youtube.com/' target='_blank' rel='noopener noreferrer'> | ||
<img src='images\social\ic_youtube.png' alt='유튜브' width='20px' /> | ||
</a> | ||
<a href='https://www.instagram.com/' target='_blank' rel='noopener noreferrer'> | ||
<img src='images\social\ic_instagram.png' alt='인스타그램' width='20px' /> | ||
</a> | ||
</nav> | ||
</footer> | ||
</> | ||
); | ||
} | ||
|
||
export default HomePage; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
import { Link, NavLink, useLocation } from 'react-router-dom'; | ||
import './Header.css'; | ||
import logo from '../logo.svg'; | ||
|
||
function Header() { | ||
const location = useLocation(); | ||
const highlightCommunity = ({ isActive }) => (isActive ? { color: 'var(--blue)' } : {}); | ||
const highlightItems = ({ isActive }) => | ||
location.pathname === '/additem' || isActive ? { color: 'var(--blue)' } : {}; | ||
|
||
return ( | ||
<header className='globalHeader'> | ||
<div className='navLeft'> | ||
<a href='/' className='headerLogo' aria-label='홈으로 이동'> | ||
<img src={logo} alt='판다마켓 로고' /> | ||
</a> | ||
|
||
<nav> | ||
<ul> | ||
<li> | ||
<a href='/community'>자유게시판</a> | ||
</li> | ||
<li> | ||
<a href='/items'>중고마켓</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> | ||
|
||
<a href='login' className='login button'> | ||
<Link to='/' className='headerLogo' aria-label='홈으로 이동'> | ||
<img src={logo} alt='판다마켓 로고' /> | ||
</Link> | ||
<nav> | ||
<ul> | ||
<li> | ||
<NavLink to='/community' style={highlightCommunity}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
import {NavLink} from 'react-router-dom'
import styled from 'styled-components'
const StyledNavLink = styled(NavLink)`
color : ${({isActive,theme})=>isActive? theme.colors.blue : undefined}
` styled(NavLink) 이 부분에 인자로 스타일링 할 컴포넌트를 전달하는게 가능합니다 :-) |
||
자유게시판 | ||
</NavLink> | ||
</li> | ||
<li> | ||
<NavLink to='/items' style={highlightItems}> | ||
중고마켓 | ||
</NavLink> | ||
</li> | ||
</ul> | ||
</nav> | ||
<Link to='/login' className='login button'> | ||
로그인 | ||
</a> | ||
</Link> | ||
</header> | ||
); | ||
} | ||
|
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.
url만 다른 함수 2개가 같은 동작을 하고있어서, 공통 함수로 분리하면 반복 코드를 줄일 수 있을것같네요