-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: add import type * refactor: code review * feat: add select box on board filter * feat: add board card css * feat: add infinite scroll * chore: add image domain * refactor: extract variable * fix: remove useApi * refactor: extract useBorad hook * refactor: rename file * chore: remove unused import
- Loading branch information
Showing
20 changed files
with
373 additions
and
39 deletions.
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.