Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
569319a
refactor: restructure project folders & migrate to CSS Modules
hyeonjiroh Feb 17, 2025
db027f6
style: organize import order consistently
hyeonjiroh Feb 17, 2025
96b781d
refactor: restructure project folders
hyeonjiroh Feb 17, 2025
18404d3
feat: make item images responsive instead of fixed size
hyeonjiroh Feb 17, 2025
e4a2cf3
refactor: remove ItemList component
hyeonjiroh Feb 17, 2025
676229a
refactor: remove Container component
hyeonjiroh Feb 17, 2025
7d0be40
feat: add seartch input type
hyeonjiroh Feb 17, 2025
21c6178
feat: add pagination bar functionality
hyeonjiroh Feb 18, 2025
ebb53c1
feat: create useWindowSize hook for browser size detection
hyeonjiroh Feb 18, 2025
47b96d1
feat: implement item sorting dropdown box
hyeonjiroh Feb 18, 2025
ae72a9e
feat: update header layout for landing page
hyeonjiroh Feb 18, 2025
3b5e8e4
feat: use axios for sending API requests
hyeonjiroh Feb 18, 2025
7d5f577
fix: improve error handling in API requests
hyeonjiroh Feb 18, 2025
6e5472d
feat: higlight 중고마켓 button in blue on /additem page
hyeonjiroh Feb 18, 2025
3c5d102
feat: implement tag addition functionality
hyeonjiroh Feb 18, 2025
d16ff0a
feat: implement tag deletion functionality
hyeonjiroh Feb 18, 2025
f9b3b58
feat: enable register button when all inputs are filled and at least …
hyeonjiroh Feb 18, 2025
bb1801b
feat: apply horizontal scroll to tag list
hyeonjiroh Feb 18, 2025
d40c15c
feat: allow only one image selection and display image preview
hyeonjiroh Feb 19, 2025
3b49aa6
feat: add image file deselection feature
hyeonjiroh Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions React/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions React/panda-market/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions React/panda-market/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
},
"devDependencies": {
"ajv": "^7.2.4",
"axios": "^1.7.9",
"classnames": "^2.5.1",
"lodash.debounce": "^4.0.8",
"react-router-dom": "^6.28.1"
}
}
26 changes: 26 additions & 0 deletions React/panda-market/src/App.jsx
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} />
)}
</>
);
}
Comment on lines +8 to +24
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(제안/선택) 별칭을 사용하면 가독성을 향상시킬 수 있습니다 😊😊

Suggested change
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} />
)}
</>
);
}
function App() {
const location = useLocation();
const isAuthPage = ["/signin", "/signup"].includes(location.pathname);
const isHomePage = location.pathname === "/";
return (
<>
{!isAuthPage && <Header className={styles.nav} />}
<div className={styles.body}>
<Outlet />
</div>
{isHomePage && <Footer className={styles.footer} />}
</>
);
}

인라인 조건문을 변수로 추출하면 코드의 의도가 명확해지고 유지보수가 쉬워집니다! 이렇게 하면 가독성이 좋아지고, 새로운 경로가 추가될 때도 쉽게 관리할 수 있어요. 🚀


export default App;
16 changes: 10 additions & 6 deletions React/panda-market/src/Main.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { BrowserRouter, Routes, Route } from "react-router-dom";
import App from "./components/App";
import HomePage from "./pages/HomePage";
import ItemPage from "./pages/ItemPage";
import ItemListPage from "./pages/ItemListPage";
import RegisterItemPage from "./pages/RegisterItemPage";
import App from "./App";
import HomePage from "./pages/HomePage/HomePage";
import LoginPage from "./pages/LoginPage/LoginPage";
import CommunityPage from "./pages/CommunityPage/CommunityPage";
import MarketPage from "./pages/MarketPage/MarketPage";
import ItemPage from "./pages/ItemPage/ItemPage";
import RegisterItemPage from "./pages/RegisterItemPage/RegisterItemPage";

function Main() {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<App />}>
<Route index element={<HomePage />} />
<Route path="signin" element={<LoginPage />} />
<Route path="community" element={<CommunityPage />} />
<Route path="items">
<Route index element={<ItemListPage />} />
<Route index element={<MarketPage />} />
<Route path=":productId" element={<ItemPage />} />
</Route>
<Route path="additem" element={<RegisterItemPage />} />
Expand Down
11 changes: 0 additions & 11 deletions React/panda-market/src/api.js

This file was deleted.

16 changes: 16 additions & 0 deletions React/panda-market/src/apis/itemApi.js
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;
}
}
3 changes: 3 additions & 0 deletions React/panda-market/src/assets/icon/ic_arrow_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions React/panda-market/src/assets/icon/ic_delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions React/panda-market/src/assets/icon/ic_plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions React/panda-market/src/assets/icon/ic_sort.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 0 additions & 90 deletions React/panda-market/src/components/AllItems.css

This file was deleted.

116 changes: 0 additions & 116 deletions React/panda-market/src/components/AllItems.js

This file was deleted.

Loading
Loading