Skip to content
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

[김진희] sprint 9 #280

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 41 additions & 0 deletions components/BestBoard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import Image from 'next/image';
import medal from '@/public/ic_medal.svg';
import heart from '@/public/ic_heart.svg';
import styles from '@/styles/BestBoard.module.css';

export default function BestBoard({ data = {} }) {
const { title, image, updatedAt, likeCount, writer } = data;
lemon1335 marked this conversation as resolved.
Show resolved Hide resolved

const date = new Date(updatedAt);

const formattedDate = date.toLocaleDateString({
year: 'numeric',
month: 'long',
day: 'numeric',
});

return (
<div className={styles.cardContent}>
<div className={styles.cardHead}>
lemon1335 marked this conversation as resolved.
Show resolved Hide resolved
<Image width={'12'} height={'14'} src={medal} alt="메달" />
<div className={styles.cardHeadTitle}>Best</div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

하나의 섹션이므로 h시리즈가 어떨까 싶습니다 !

Suggested change
<div className={styles.cardHeadTitle}>Best</div>
<h2 className={styles.cardHeadTitle}>Best</h2>

</div>
<div className={styles.cardBody}>
<div className={styles.cardBodyContent}>{title}</div>
<div className={styles.cardBodyContentImage}>
<Image width={'48'} height={'44'} src={image} alt="게시글 사진" />
</div>
</div>
<div className={styles.cardBottom}>
<div className={styles.cardBottomAhead}>
<div className={styles.boardUserId}>{writer.nickname}</div>
<div className={styles.likeIt}>
<Image width={'14'} height={'12'} src={heart} alt="좋아요" />
<div className={styles.likeCount}>{likeCount}</div>
</div>
</div>
<div className={styles.bestUploadDate}>{formattedDate}</div>
</div>
</div>
);
}
43 changes: 43 additions & 0 deletions components/EntireBoard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import Image from 'next/image';
import heart from '@/public/ic_heart.svg';
import profile from '@/public/ic_profile.svg';
import styles from '@/styles/EntireBoard.module.css';

export default function EntireBoard({ data }) {
const { title, image, updatedAt, likeCount, writer } = data;
const imageUrl = image || '/default-image.jpg';

const date = new Date(updatedAt);

const formattedDate = date.toLocaleDateString({
year: 'numeric',
month: 'long',
day: 'numeric',
});

return (
<div className={styles.boardListContent}>
<div className={styles.listMainContent}>
<div className={styles.listMainTitle}>{title}</div>
<div className={styles.listMainContentImage}>
<Image width={'48'} height={'44'} src={imageUrl} alt="리스트 사진" />
</div>
</div>
<div className={styles.listInfo}>
<div className={styles.listInfoAhead}>
<div className={styles.listUserInfo}>
<Image width={'24'} height={'24'} src={profile} alt="프로필" />
<div className={styles.listContentInfo}>
<div className={styles.listUserId}>{writer.nickname}</div>
<div className={styles.listUploadate}>{formattedDate}</div>
</div>
</div>
<div className={styles.listLikeIt}>
<Image width={'14'} height={'12'} src={heart} alt="좋아요" />
<div className={styles.listLikeCount}>{likeCount}</div>
</div>
</div>
</div>
</div>
);
}
36 changes: 36 additions & 0 deletions components/Header.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Header.jsx
import Image from 'next/image';
import Link from 'next/link';
import logo from '@/public/ic_logo.svg';
import login from '@/public/ic_login.svg';
import styles from '@/styles/Header.module.css'

function Header() {
return (
<header className={styles.navBar}>
<nav className={styles.navContent}>
<div className={styles.logo}>
<Image src={logo} alt="로고" />
<Link href="/" className={styles.title}>
판다마켓
</Link>
</div>
<ul className={styles.tab}>
<li className={styles.tabList}>
<Link id={styles.boards} href="/boards">
자유게시판
</Link>
</li>
<li className={styles.tabList}>
<Link id={styles.fleaMarket} href="/items">
중고마켓
</Link>
</li>
</ul>
Comment on lines +18 to +29
Copy link
Collaborator

Choose a reason for hiding this comment

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

굳굳 ! 적절한 ulli네요.

의미론적으로 잘 작성하셨습니다 👍👍

</nav>
<Image src={login} alt="캐릭터" />
</header>
);
}

export default Header;
8 changes: 6 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}
images: {
unoptimized: true,
domains: ['sprint-fe-project.s3.ap-northeast-2.amazonaws.com'],
},
Comment on lines +4 to +7
Copy link
Collaborator

Choose a reason for hiding this comment

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

굳굳 화이트리스트도 잘 작성하셨군요 ! 👍

};

module.exports = nextConfig
module.exports = nextConfig;
100 changes: 100 additions & 0 deletions package-lock.json

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

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
"lint": "next lint"
},
"dependencies": {
"axios": "^1.7.7",
"next": "13.5.6",
"react": "^18",
"react-dom": "^18",
"next": "13.5.6"
"react-dom": "^18"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "13.5.6"
"eslint-config-next": "13.5.6",
"typescript": "^5"
}
}
16 changes: 16 additions & 0 deletions pages/_app.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// import type { AppProps } from 'next/app'
import Header from '../components/Header';
import '@/styles/globals.css';
import '@/styles/Header.module.css';
import '@/styles/Boards.module.css';
import '@/styles/BestBoard.module.css';
import '@/styles/EntireBoard.module.css';

export default function App({ Component, pageProps }) {
return (
<>
<Header />
<Component {...pageProps} />
</>
);
}
6 changes: 0 additions & 6 deletions pages/_app.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Html, Head, Main, NextScript } from 'next/document'

export default function Document() {
return (
<Html lang="en">
<Html lang="ko">
<Head />
<body>
<Main />
Expand Down
4 changes: 4 additions & 0 deletions pages/api/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import axios from 'axios';
const instance = axios.create({ baseURL: `https://panda-market-api.vercel.app` });
lemon1335 marked this conversation as resolved.
Show resolved Hide resolved

export default instance;
Comment on lines +1 to +4
Copy link
Collaborator

Choose a reason for hiding this comment

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

axios 인스턴스도 작성하셨군요 ! 훌륭합니다.

13 changes: 0 additions & 13 deletions pages/api/hello.ts

This file was deleted.

Loading
Loading