We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 105e08f commit e15e0abCopy full SHA for e15e0ab
src/component/Article/ArticleContainer.jsx
@@ -1,14 +1,21 @@
1
import React from 'react'
2
+import { useRecoilValue } from 'recoil'
3
+import { authState } from '../../atoms/auth'
4
import ArticleContents from './ArticleContents'
5
import ShowComment from './ShowComment'
6
import WriteCommet from './WriteCommet'
7
+import { Link } from 'react-router-dom'
8
9
const ArticleContainer = ({data}) => {
10
+
11
+ const auth = useRecoilValue(authState)
12
return (
13
<div className="container page">
14
15
<ArticleContents data={data}/>
- <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>}
19
<ShowComment />
20
21
</div>
0 commit comments