Skip to content

Commit

Permalink
Merge pull request #99 from yousuk88/react-정유석-sprint6
Browse files Browse the repository at this point in the history
  • Loading branch information
coldplay126 authored Nov 11, 2024
2 parents efe6ca1 + 65555b0 commit 8f797da
Show file tree
Hide file tree
Showing 74 changed files with 1,578 additions and 246 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# reference files
src/pages/MeetingRoomFive.js
src/pages/Registration(TaejinLiveShare).js
src/pages/ApiComparisonTest.js
131 changes: 131 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"react-dom": "^18.3.1",
"react-router-dom": "^6.27.0",
"react-scripts": "5.0.1",
"styled-components": "^6.1.13",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added public/static/images/Img_home_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/images/Img_home_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/images/Img_home_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/images/Img_home_bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/images/Img_home_top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added public/static/images/google.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/images/hide-pw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added public/static/images/ic_sort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added public/static/images/ic_x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added public/static/images/kakao.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added public/static/images/login-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added public/static/images/og-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added public/static/images/show-pw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/images/user_profile.png
20 changes: 15 additions & 5 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@font-face {
font-family: 'Pretendard-Regular';
src: url('./assets/font/Pretendard-Regular.woff') format('woff');
font-family: "Pretendard-Regular";
src: url("/public/static/font/Pretendard-Regular.woff") format("woff");
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: 'rokaf';
src: url('./assets/font/ROKAF_Sans_Medium.ttf') format('truetype');
font-family: "rokaf";
src: url("/public/static/font/ROKAF_Sans_Medium.ttf") format("truetype");
}

* {
Expand All @@ -24,4 +24,14 @@ html {
a {
text-decoration: none;
color: inherit;
}
}

.coming_soon {
height: calc(100vh - 230px);
display: flex;
justify-content: center;
align-items: center;
font-size: 5rem;
font-weight: 700;
color: #3692ff;
}
50 changes: 41 additions & 9 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,47 @@
import Nav from './components/Nav/Nav'
import Main from './components/Main/Main'
import Footer from './components/Footer/Footer'
import './App.css'
import { BrowserRouter as Router, Route, Routes, useLocation } from 'react-router-dom';
import Nav from './components/Nav/Nav';
import Footer from './components/Footer/Footer';
import Main from './pages/Main';
import Login from './pages/Login';
import Signup from './pages/Signup';
import Items from './pages/Items';
import Community from './pages/Community';
import Faq from './pages/Faq';
import Privacy from './pages/Privacy';
import Registration from './pages/Registration';
// import ApiComparisonTest from './pages/ApiComparisonTest';
import './App.css';

function AppContent() {
const location = useLocation();

// Nav와 Footer를 제외할 경로 목록
const hideHeaderFooterPaths = ['/login', '/signup'];

return (
<>
{!hideHeaderFooterPaths.includes(location.pathname) && <Nav />}
<Routes>
<Route path="/" element={<Main />} />
<Route path="/login" element={<Login />} />
<Route path="/signup" element={<Signup />} />
<Route path="/items" element={<Items />} />
<Route path="/community" element={<Community />} />
<Route path="/faq" element={<Faq />} />
<Route path="/privacy" element={<Privacy />} />
<Route path="/registration" element={<Registration />} />
{/* <Route path="/test" element={<ApiComparisonTest />} /> */}
</Routes>
{!hideHeaderFooterPaths.includes(location.pathname) && <Footer />}
</>
);
}

function App() {
return (
<div>
<Nav />
<Main />
<Footer />
</div>
<Router>
<AppContent />
</Router>
);
}

Expand Down
42 changes: 42 additions & 0 deletions src/apis/ProductService(MongoDB).js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const BASE_URL = 'http://localhost:8000/api/products';

export async function getProductList(offset, limit, orderBy, keyword) {
const params = new URLSearchParams({
offset,
limit,
orderBy,
keyword,
});

const url = `${BASE_URL}?${params}`;

try {
const response = await fetch(url);

if (!response.ok) {
throw new Error(`지정 에러: ${response.status} - ${response.statusText}`); // 내가 지정한 오류 핸들링
}

const data = await response.json();
return data;

} catch (error) {
console.error("기타 에러:", error); // 서버 등 예측하지 못한 에러 위해
}
}

export async function registerProduct(productData) {
try {
const response = await fetch(BASE_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(productData),
});
if (!response.ok) {
throw new Error(`등록 실패: ${response.status}`);
}
return await response.json();
} catch (error) {
console.error("상품 등록 중 오류:", error);
}
}
2 changes: 1 addition & 1 deletion src/apis/ProductService.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function getProductList(page, pageSize, orderBy, keyword) {
}

const data = await response.json();
console.log(data);
// console.log(data);
return data;

} catch (error) {
Expand Down
Binary file modified src/assets/images/placeholder.png
Loading

0 comments on commit 8f797da

Please sign in to comment.