-
Notifications
You must be signed in to change notification settings - Fork 21
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
[김희진] sprint10 #125
Merged
GANGYIKIM
merged 11 commits into
codeit-bootcamp-frontend:Next-김희진
from
devmanta:Next-김희진-sprint10
Nov 5, 2024
The head ref may contain hidden characters: "Next-\uAE40\uD76C\uC9C4-sprint10"
Merged
[김희진] sprint10 #125
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3364d50
refactor: add import type
devmanta 657ccd6
refactor: code review
devmanta 31fc759
feat: add select box on board filter
devmanta 71f6017
feat: add board card css
devmanta 66547ee
feat: add infinite scroll
devmanta 3853aec
chore: add image domain
devmanta 8f51721
refactor: extract variable
devmanta 5b8bdb6
fix: remove useApi
devmanta 8a71559
refactor: extract useBorad hook
devmanta 9a4e586
refactor: rename file
devmanta 1108f31
chore: remove unused import
devmanta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { useRouter } from 'next/router'; | ||
import styles from './[id].module.css'; | ||
|
||
export default function BoardDetail() { | ||
const router = useRouter(); | ||
const { id } = router.query; | ||
|
||
return <div>{id}</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
.boardCard { | ||
background: #fcfcfc; | ||
padding: 20px; | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
} | ||
|
||
.boardCard::after { | ||
content: ''; | ||
position: absolute; | ||
left: 0; | ||
bottom: 0; | ||
width: 100%; | ||
height: 1px; | ||
background-color: var(--Secondary-200); | ||
} | ||
|
||
.contentContainer { | ||
display: flex; | ||
gap: 8px; | ||
min-height: 72px; | ||
} | ||
|
||
.title { | ||
color: var(--Secondary-800); | ||
font-size: 20px; | ||
font-weight: 600; | ||
|
||
flex: 1; | ||
} | ||
|
||
.imageWrapper { | ||
position: relative; | ||
width: 72px; | ||
height: 72px; | ||
|
||
border-radius: 6px; | ||
border: 1px solid var(--Secondary-200, #e5e7eb); | ||
background: #fff; | ||
} | ||
|
||
.additionalInfo { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.infoWrapper { | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
} | ||
|
||
.nickname { | ||
color: var(--Secondary-600, #4b5563); | ||
font-size: 14px; | ||
font-weight: 400; | ||
} | ||
|
||
.date { | ||
color: var(--Secondary-400, #9ca3af); | ||
font-size: 14px; | ||
font-weight: 400; | ||
} | ||
|
||
.likeCountWrapper { | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
color: var(--Secondary-500, #6b7280); | ||
font-size: 16px; | ||
font-weight: 400; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Image from 'next/image'; | ||
import styles from './BoardCard.module.css'; | ||
import type { Board } from '@/src/apis/boardTypes'; | ||
import heartSvg from '@/src/assets/ic_heart.svg'; | ||
import avatarSvg from '@/src/assets/avatar.svg'; | ||
|
||
export default function BoardCard({ | ||
title, | ||
image, | ||
writer, | ||
createdAt, | ||
likeCount, | ||
}: Board) { | ||
return ( | ||
<div className={styles.boardCard}> | ||
<div className={styles.contentContainer}> | ||
<p className={styles.title}>{title}</p> | ||
{image && ( | ||
<div className={styles.imageWrapper}> | ||
<Image | ||
src={image} | ||
alt="게시판 첨부이미지" | ||
fill | ||
style={{ objectFit: 'cover' }} | ||
/> | ||
</div> | ||
)} | ||
</div> | ||
<div className={styles.additionalInfo}> | ||
<div className={styles.infoWrapper}> | ||
<Image src={avatarSvg} alt="avatar" width={24} height={24} /> | ||
<span className={styles.nickname}>{writer.nickname}</span> | ||
<span className={styles.date}> | ||
{new Date(createdAt).toLocaleDateString()} | ||
</span> | ||
</div> | ||
<div className={styles.likeCountWrapper}> | ||
<Image src={heartSvg} alt="heardIcon" width={16} height={16} /> | ||
<span>{likeCount}</span> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3:
해당 태그가 보이면 데이터를 추가로 가지고 오게 되니 이러한 요소는 마지막 요소보다 마지막에서 조금 더 위의 요소,
예를 들면 10개의 아이템중 마지막이 아닌 7번째 요소에 이벤트를 걸어두는 것이 더 좋습니다.
그러면 유저의 스크롤이 다 되기전에 미리 데이터를 불러오게 되어 UX 측면에서 장점이 있습니다.