-
Notifications
You must be signed in to change notification settings - Fork 20
[노현지] Sprint6 #66
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-\uB178\uD604\uC9C0-sprint6"
[노현지] Sprint6 #66
Changes from all commits
569319a
db027f6
96b781d
18404d3
e4a2cf3
676229a
7d0be40
21c6178
ebb53c1
47b96d1
ae72a9e
3b5e8e4
7d5f577
6e5472d
3c5d102
d16ff0a
f9b3b58
bb1801b
d40c15c
3b49aa6
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.
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,26 @@ | ||
| import { Outlet, useLocation } from "react-router-dom"; | ||
| import Header from "./components/Layout/Header"; | ||
| import Footer from "./components/Layout/Footer"; | ||
| import styles from "./styles/App.module.css"; | ||
| import "./styles/App.font.css"; | ||
| import "./styles/App.color.css"; | ||
|
|
||
| function App() { | ||
| const location = useLocation(); | ||
|
|
||
| return ( | ||
| <> | ||
| {!["/signin", "/signup"].includes(location.pathname) && ( | ||
| <Header className={styles.nav} /> | ||
| )} | ||
| <div className={styles.body}> | ||
| <Outlet /> | ||
| </div> | ||
| {["/"].includes(location.pathname) && ( | ||
| <Footer className={styles.footer} /> | ||
| )} | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| export default App; | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import axios from "axios"; | ||
|
|
||
| const instance = axios.create({ | ||
| baseURL: "https://panda-market-api.vercel.app", | ||
| }); | ||
|
|
||
| export async function getItems({ page = "", pageSize = "", order = "" }) { | ||
| const query = `page=${page}&pageSize=${pageSize}&orderBy=${order}`; | ||
| try { | ||
| const res = await instance.get(`/products?${query}`); | ||
| return res.data; | ||
| } catch (error) { | ||
| console.error(error); | ||
| throw error; | ||
| } | ||
| } |
This file was deleted.
This file was deleted.
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.
(제안/선택) 별칭을 사용하면 가독성을 향상시킬 수 있습니다 😊😊
인라인 조건문을 변수로 추출하면 코드의 의도가 명확해지고 유지보수가 쉬워집니다! 이렇게 하면 가독성이 좋아지고, 새로운 경로가 추가될 때도 쉽게 관리할 수 있어요. 🚀