Skip to content

Commit e15e0ab

Browse files
committed
[#60] 로그 유무상태에 따른 comment 적는 부분 변경
1 parent 105e08f commit e15e0ab

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/component/Article/ArticleContainer.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
import React from 'react'
2+
import { useRecoilValue } from 'recoil'
3+
import { authState } from '../../atoms/auth'
24
import ArticleContents from './ArticleContents'
35
import ShowComment from './ShowComment'
46
import WriteCommet from './WriteCommet'
7+
import { Link } from 'react-router-dom'
58

69
const ArticleContainer = ({data}) => {
10+
11+
const auth = useRecoilValue(authState)
712
return (
813
<div className="container page">
914

1015
<ArticleContents data={data}/>
11-
<WriteCommet />
16+
{auth?<WriteCommet />:<div style={{textAlign:'center', margin:'10px'}}>
17+
<Link to="/login">sign in</Link> or <Link to="/register">sign up</Link>
18+
</div>}
1219
<ShowComment />
1320

1421
</div>

0 commit comments

Comments
 (0)