-
Notifications
You must be signed in to change notification settings - Fork 39
[박다인] sprint5 #172
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
The head ref may contain hidden characters: "React-\uBC15\uB2E4\uC778-sprint5"
[박다인] sprint5 #172
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.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| const BASE_URL = "https://panda-market-api.vercel.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; | ||
| } | ||
| 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) { | ||
| } |
| 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; |
This file was deleted.
| 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(); |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| function CommunityPage() { | ||
| return <div>CommunityPage</div>; | ||
| } | ||
|
|
||
| export default CommunityPage; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| function HomaPage() { | ||
| return <div>HomePage</div>; | ||
| } | ||
|
|
||
| export default HomaPage; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| function LoginPage() { | ||
| return <div>LoginPage</div>; | ||
| } | ||
|
|
||
| export default LoginPage; |
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.
BASE_URL와 같이 민감한 정보의 경우 일반적으로 외부 공개를 막기위해 환경변수로 관리한답니다. React의 경우 환경변수 설정시 변수명에 REACT_APP_ 접두어가 꼭 필요하니, 아래 아티클 확인해주시고 환경변수 설정해보세요!
참고