Skip to content

Commit

Permalink
Merge pull request #106 from Jin-coding-333/react-배진한-sprint6
Browse files Browse the repository at this point in the history
[배진한] Sprint6
  • Loading branch information
orlein authored Nov 9, 2024
2 parents 3433f59 + 4a21f72 commit 2d3a4d4
Show file tree
Hide file tree
Showing 77 changed files with 21,382 additions and 0 deletions.
428 changes: 428 additions & 0 deletions .gitignore

Large diffs are not rendered by default.

18,282 changes: 18,282 additions & 0 deletions sprint6/package-lock.json

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions sprint6/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "sprint5",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^1.7.7",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.27.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
15 changes: 15 additions & 0 deletions sprint6/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="ko">

<head>
<meta charset="utf-8" />
<link rel="icon" href="../src/img/icons/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>중고마켓</title>
</head>

<body>
<div id="root" class="dk"></div>
</body>

</html>
25 changes: 25 additions & 0 deletions sprint6/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
3 changes: 3 additions & 0 deletions sprint6/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
23 changes: 23 additions & 0 deletions sprint6/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import ItemsPage from './pages/ItemsPage/index.jsx';
import HomePage from './pages/HomePage/index.jsx';
import LoginPage from './pages/LoginPage/index.jsx';
import RegisterItemPage from './pages/RegisterItemPage/index.jsx';
import ItemDetailPage from './pages/ItemDetailPage/index.jsx';

function App() {
return (
<BrowserRouter >
<Routes>
<Route path='/' element={<HomePage />} />
<Route path='/items' element={<ItemsPage />} />
<Route path='/login' element={<LoginPage />} />
<Route path='/register' element={<RegisterItemPage />} />
<Route path='/itemDetail' element={<ItemDetailPage />} />
{/* <Route path='/community' element={<CommunityFeedPage />} /> */}
</Routes>
</BrowserRouter>
);
}

export default App;
3 changes: 3 additions & 0 deletions sprint6/src/api/endpoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const url = new URL('https://panda-market-api.vercel.app/products');
// export const url = new URL('http://localhost:8000/products');
export const postUrl = 'http://localhost:8000/products';
16 changes: 16 additions & 0 deletions sprint6/src/api/getProductsApi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { url } from './endpoint.js';

async function getProducts(params = "") {
const query = new URLSearchParams(params).toString();
// 파라미터를 자동으로 정리해서 인코딩

try {
const response = await fetch(`${url}?${query}`);
const data = await response.json();
return data
} catch (err) {
console.error('Fetch error:', err);
}
}

export default getProducts;
14 changes: 14 additions & 0 deletions sprint6/src/api/postProductApi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import axios from 'axios';
import { postUrl } from './endpoint.js';

const postProduct = async (surveyData) => {
if (typeof surveyData === 'object') {
const res = await axios.post(postUrl, surveyData);
return res.data;
} else {
console.error('Post error:');
return;
}
}

export default postProduct;
81 changes: 81 additions & 0 deletions sprint6/src/components/Footer/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
footer {
width: 100%;
height: 16rem;
background-color: #111827;
display: flex;
justify-content: center;
padding-top: 3.2rem;
}

#footerContent {
width: 152rem;
height: 2rem;
display: flex;
justify-content: space-between;
margin-left: 20rem;
margin-right: 20rem;
}

#copyright {
width: 12.2rem;
height: 1.9rem;
font-size: 1.6rem;
font-weight: 400;
line-height: 1.909rem;
display: flex;
text-align: center;
color: #9CA3AF;
}

#info {
width: 16.9rem;
height: 1.9rem;
gap: 3rem;
opacity: 0rem;
font-size: 1.6rem;
font-weight: 400;
line-height: 1.909rem;
text-align: center;
color: #E5E7EB;
display: flex;
justify-content: space-between;
}

#info a {
text-decoration: none;
color: #E5E7EB;
}

#socialIcons {
list-style: none;
padding-left: 0rem;
margin-left: 1.6rem;
display: flex;
justify-content: space-between;
}

#socialIcons img {
width: 2rem;
height: 2rem;
margin-right: 1.2rem;
filter: drop-shadow(0 0 0.75rem rgba(0, 0, 0, 15%));
}

@media (max-width: 474px) {

#copyright {
position: relative;
bottom: -40px;
}

#footerContent {
margin-left: 21px;
margin-right: 0rem;
}

#info {
width: 156.9px;
position: relative;
left: -127px;
}
}
29 changes: 29 additions & 0 deletions sprint6/src/components/Footer/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import faceBookImg from '../../img/social/ic_facebook.png';
import twitterImg from '../../img/social/ic_twitter.png';
import youtubeImg from '../../img/social/ic_youtube.png';
import instagramImg from '../../img/social/ic_instargram.png';
import './index.css';

function Footer() {
return (
<footer>
<div id="footerContent">
<div id="copyright">© Codeit 2024</div>

<div id="info">
<div><a href="/privacy">Privacy Policy</a></div>
<div id='faq'><a href="/faq">FAQ</a></div>
</div>

<div id="socialIcons">
<a href="https://www.facebook.com/?locale=ko_KR"><img src={faceBookImg} alt="Facebook" /></a>
<a href="https://x.com/?lang=ko"><img src={twitterImg} alt="Twitter" /></a>
<a href="https://www.youtube.com/"><img src={youtubeImg} alt="YouTube" /></a>
<a href="https://www.instagram.com/sem/campaign/emailsignup"><img src={instagramImg} alt="Instagram" /></a>
</div>
</div>
</footer>
)
}

export default Footer;
Loading

0 comments on commit 2d3a4d4

Please sign in to comment.