react-code-dataset / react-redux-realworld-example-app /src /components /Article /CommentContainer.js
Download react-redux-realworld-example-app/src/components/Article/CommentContainer.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-redux-realworld-example-app/src/components/Article/CommentContainer.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-redux-realworld-example-app/src/components/Article/CommentContainer.js
-
curl -L -o CommentContainer.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-redux-realworld-example-app/src/components/Article/CommentContainer.js
1.06 kB
| import CommentInput from './CommentInput'; | |
| import CommentList from './CommentList'; | |
| import { Link } from 'react-router-dom'; | |
| import React from 'react'; | |
| const CommentContainer = props => { | |
| if (props.currentUser) { | |
| return ( | |
| <div className="col-xs-12 col-md-8 offset-md-2"> | |
| <div> | |
| <list-errors errors={props.errors}></list-errors> | |
| <CommentInput slug={props.slug} currentUser={props.currentUser} /> | |
| </div> | |
| <CommentList | |
| comments={props.comments} | |
| slug={props.slug} | |
| currentUser={props.currentUser} /> | |
| </div> | |
| ); | |
| } else { | |
| return ( | |
| <div className="col-xs-12 col-md-8 offset-md-2"> | |
| <p> | |
| <Link to="/login">Sign in</Link> | |
| or | |
| <Link to="/register">sign up</Link> | |
| to add comments on this article. | |
| </p> | |
| <CommentList | |
| comments={props.comments} | |
| slug={props.slug} | |
| currentUser={props.currentUser} /> | |
| </div> | |
| ); | |
| } | |
| }; | |
| export default CommentContainer; | |