Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a49b610
chore: install react router
play-ancora-gyungmin Sep 22, 2025
069f29a
style: separate item page main container to component
play-ancora-gyungmin Sep 22, 2025
e2eb238
style: change code style
play-ancora-gyungmin Sep 22, 2025
a8cea54
feat: migration landing page
play-ancora-gyungmin Sep 22, 2025
d62684c
feat: route links
play-ancora-gyungmin Sep 22, 2025
e2f9abc
feat: set Link from landing page to items
play-ancora-gyungmin Sep 22, 2025
cdb9d25
style: separate stylesheet from style.css to Header, Footer, Items
play-ancora-gyungmin Sep 22, 2025
10a539f
rename: item to items
play-ancora-gyungmin Sep 22, 2025
4ab1d58
chore: temporarily suspending functionality based on requirements
play-ancora-gyungmin Sep 22, 2025
a1d797a
feat: create registration page
play-ancora-gyungmin Sep 22, 2025
893a12a
feat: route registration page
play-ancora-gyungmin Sep 22, 2025
2e250af
feat: set default img for item card
play-ancora-gyungmin Sep 22, 2025
e54683d
feat: nav button change by url
play-ancora-gyungmin Sep 22, 2025
06c8c65
feat: nav menu color change by path
play-ancora-gyungmin Sep 23, 2025
f24fa6d
rename: RegistItemPage.css to RegistItemPage.module.css
play-ancora-gyungmin Sep 23, 2025
d88c183
style: move input style code to style.css
play-ancora-gyungmin Sep 23, 2025
fc67932
refactor: minimize code repetition in SalesItemSection
play-ancora-gyungmin Sep 23, 2025
4f8cbde
fix: media quary for input-wrap is not working
play-ancora-gyungmin Sep 23, 2025
e7e2c4e
design: fix width and hight for input-wrap
play-ancora-gyungmin Sep 23, 2025
acf9a49
feat: add form for regist item page
play-ancora-gyungmin Sep 23, 2025
06d9c33
feat: make textarea font set initial
play-ancora-gyungmin Sep 24, 2025
74f5604
feat: create input validation hook
play-ancora-gyungmin Sep 24, 2025
6a13cc3
feat: create vaildation function
play-ancora-gyungmin Sep 24, 2025
2070bfa
feat: import form vaildation code in item regist page
play-ancora-gyungmin Sep 24, 2025
70cf624
feat: create tag capsule componant
play-ancora-gyungmin Sep 24, 2025
b6a07dd
fix: err message came out before touched
play-ancora-gyungmin Sep 24, 2025
cb5cea5
design: set design for TagCapsule
play-ancora-gyungmin Sep 24, 2025
410f749
design: change tag capsule arrangement
play-ancora-gyungmin Sep 24, 2025
18fafbb
feat: add tag capsule mounting
play-ancora-gyungmin Sep 24, 2025
a888a61
feat: add code for tag capsule in and out
play-ancora-gyungmin Sep 24, 2025
c7841d5
chore: add env code for api uri
play-ancora-gyungmin Sep 27, 2025
e5bbbbc
feat: add create product api
play-ancora-gyungmin Sep 27, 2025
92ac3c5
fix: change item img validation
play-ancora-gyungmin Sep 27, 2025
e858644
feat: add create and post new porduct code
play-ancora-gyungmin Sep 27, 2025
bbdd563
chore: update README.md
play-ancora-gyungmin Sep 27, 2025
ae52e4e
design: set media quary for regist item page
play-ancora-gyungmin Sep 27, 2025
d45f549
feat: set debounce for item searching
play-ancora-gyungmin Sep 29, 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
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_URL=https://api.example.com
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ dist
dist-ssr
*.local

# env
.env
!.env.example

# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@

10. React 기반 중고 마켓 페이지 구현

### 09.28

11. 제품 등록 페이지 구현
12. express, mongo 기반 백엔드와 연결 구현

## 기술 스택

### 지금까지 사용 된 스택
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"dependencies": {
"clsx": "^2.1.1",
"react": "^19.1.1",
"react-dom": "^19.1.1"
"react-dom": "^19.1.1",
"react-router": "^7.9.1"
},
"devDependencies": {
"@eslint/js": "^9.33.0",
Expand Down
32 changes: 32 additions & 0 deletions pnpm-lock.yaml

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

20 changes: 11 additions & 9 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { BestItemsSection } from './pages/ItemPage/BestItemsSection';
import { SalesItemsSection } from './pages/ItemPage/SalesItemsSection';
import { ItemProvider } from './providers/ItemProvider';
import { Routes, Route } from 'react-router';
import { Header } from '@/components/Header';
import { Footer } from '@/components/Footer';
import { LandingPage } from './pages/LandingPage';
import { ItemsPage } from './pages/ItemsPage';
import { RegistItemPage } from './pages/RegistItemPage';

function App() {
return (
<ItemProvider>
<>
<Header />
<main className="main item-main">
<BestItemsSection />
<SalesItemsSection />
</main>
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/items" element={<ItemsPage />} />
<Route path="/registration" element={<RegistItemPage />} />
</Routes>
<Footer />
</ItemProvider>
</>
);
}

Expand Down
34 changes: 30 additions & 4 deletions src/api/ProductService.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
const API_URL = "https://panda-market-api.vercel.app/products";
const API_URL = import.meta.env.VITE_API_URL + '/products';

const DEFULT_PAGE = 1;
const DEFULT_PAGE_SIZE = 1;
const DEFULR_ORDERBY = 'recent';

export const getProductList = async function({page = DEFULT_PAGE, pageSize = DEFULT_PAGE_SIZE, orderBy = DEFULR_ORDERBY, keyword = ""}) {
export const getProductList = async function ({
page = DEFULT_PAGE,
pageSize = DEFULT_PAGE_SIZE,
orderBy = DEFULR_ORDERBY,
keyword = '',
}) {
console.log(API_URL);
const url = `${API_URL}?page=${page}&pageSize=${pageSize}&orderBy=${orderBy}&keyword=${keyword}`;
const response = await fetch(url);
if (!response.ok) {
throw new Error(`리퀘스트 에러: ${response.status}, 에러 메시지: ${response.statusText}`);
throw new Error(
`리퀘스트 에러: ${response.status}, 에러 메시지: ${response.statusText}`,
);
}
const data = await response.json();
return data;
}
};

export const createProduct = async function (contents) {
const url = `${API_URL}`;
const response = await fetch(url, {
method: 'POST',
body: JSON.stringify(contents),
headers: {
'Content-Type': 'application/json',
},
});
if (!response.ok) {
throw new Error(
`리퀘스트 에러: ${response.status}, 에러 메시지: ${response.statusText}`,
);
}
const data = await response.json();
return data;
};
5 changes: 5 additions & 0 deletions src/assets/img/ic_close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/assets/img/img_default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions src/components/Footer/Footer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#footer {
justify-content: center;
align-items: flex-start;
background: var(--secondary-900);
text-align: center;
}

#footer-box {
display: flex;
width: 120rem;
height: 10rem;
padding: 2rem 12.5rem;
justify-content: space-between;
align-items: flex-start;
text-align: center;
}

#footer-box > ul {
display: flex;
align-items: flex-start;
}

#footer-box > ul > li {
display: inline-block;
}

#copyright {
color: var(--secondary-400);
font-size: 1rem;
font-weight: 400;
}

#cs-list {
gap: 1.875rem;
}

#cs-list a {
color: var(--secondary-200);
font-size: 1rem;
font-weight: 400;
}

#sns-list {
gap: 0.75rem;
}

#sns-list img {
width: 1.25rem;
}

@media screen and (max-width: 120rem) {
#footer-box {
width: 100%;
}
}

@media screen and (max-width: 74.9rem) {
#footer-box {
padding: 2rem 1.5rem;
}
}

@media screen and (max-width: 46.4rem) {
#footer-box {
padding: 2rem 1rem;
flex-wrap: wrap-reverse;
}

#copyright {
width: 100%;
margin: 1.5rem 0 2rem;
text-align: start;
}
}
1 change: 1 addition & 0 deletions src/components/Footer/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import facebookIcon from '@/assets/img/ic_facebook.png';
import twitterIcon from '@/assets/img/ic_twitter.png';
import youtubeIcon from '@/assets/img/ic_youtube.png';
import instagramIcon from '@/assets/img/ic_instagram.png';
import './Footer.css';

export function Footer() {
return (
Expand Down
83 changes: 83 additions & 0 deletions src/components/Header/Header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#header {
position: fixed;
height: 4.4rem;
justify-content: center;
align-items: center;
background-color: white;
border-bottom: 1px solid #dfdfdf;
}

#title {
width: 9.6rem;
height: 3.2rem;
}

.logo {
width: 100%;
height: 100%;
}

#nav {
display: flex;
width: 120rem;
height: 4.4rem;
padding: 0px 25rem;
justify-content: space-between;
align-items: center;
}

#nav-left {
display: flex;
align-items: center;
gap: 1.5rem;
}

.nav-menu {
padding: 0 0.94rem;
color: var(--secondary-600);
text-align: center;
font-size: 1.125rem;
font-weight: 700;
line-height: 1.625rem;
}

.intro-nav-btn {
width: 8rem;
}

.nav-menu-active {
color: var(--primary-100);
}

@media screen and (max-width: 120rem) {
#nav {
width: 100%;
padding: 0 12.5rem;
}
}

@media screen and (max-width: 74.9rem) {
#nav {
padding: 0 1.5rem;
}
}

@media screen and (max-width: 46.4rem) {
#nav {
padding: 0 1rem;
}

#title {
width: 5rem;
height: auto;
}

#nav-left {
gap: 0.5rem;
}

.nav-menu {
padding: 0 0.5rem 0 0;
font-size: 1rem;
}
}
Loading