-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from go-cham/Hyeonmin
Fixed: 내 게시글, 참여 게시글 없을 시 페이지 수정
- Loading branch information
Showing
5 changed files
with
44 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { useNavigate } from 'react-router-dom'; | ||
import { POST_TYPE } from '@/common/constants/post-type'; | ||
import { ReactComponent as NoPostIcon } from './no-post-icon.svg'; | ||
|
||
interface NoPostText { | ||
type: POST_TYPE; | ||
} | ||
|
||
export function NoPost({ type }: NoPostText) { | ||
const navigate = useNavigate(); | ||
|
||
const text = | ||
type === POST_TYPE.MY | ||
? '아직 작성한 게시물이 없어요.' | ||
: '투표하거나 댓글 남긴 게시글이 없어요.'; | ||
|
||
return ( | ||
<div | ||
className={ | ||
'absolute left-1/2 top-[45%] flex -translate-x-1/2 flex-col items-center' | ||
} | ||
> | ||
<NoPostIcon className={'h-[7.512rem] w-[7.496rem]'} /> | ||
<span className="mt-[1.688rem] font-system-body3">{text}</span> | ||
{type === POST_TYPE.MY && ( | ||
<span | ||
className="cursor-pointer text-mainSub-main-500 underline font-system-body4" | ||
onClick={() => navigate('/write')} | ||
> | ||
글 작성 시작 | ||
</span> | ||
)} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { NoPost } from './NoPost'; |
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