Skip to content

Commit

Permalink
feat/ 로그인일때만 글쓰기 기능 구현 (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssuminii committed Sep 21, 2024
1 parent a4f1f52 commit 9db6282
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Banner from '@components/Banner'
import colors from '@/constants/color'
import { fontSize, fontWeight } from '@/constants/font'
import { useNavigate } from 'react-router-dom'
import { useAuthStore } from '@/stores/authStore'

const postData = [
{
Expand Down Expand Up @@ -66,6 +67,7 @@ const postData = [
]

const Home: React.FC = () => {
const { isLogin } = useAuthStore()
const navigate = useNavigate()
return (
<Container>
Expand All @@ -77,14 +79,16 @@ const Home: React.FC = () => {
<div>코딩테스트</div>
<div>스터디</div>
</div>
<button
className="write-btn"
onClick={() => {
navigate('/write')
}}
>
+ 글쓰기
</button>
{isLogin && (
<button
className="write-btn"
onClick={() => {
navigate('/write')
}}
>
+ 글쓰기
</button>
)}
</div>
<div className="category">
<div>Lv.0</div>
Expand Down

0 comments on commit 9db6282

Please sign in to comment.