File tree Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change
1
+ import React , { Component } from 'react' ;
2
+ import PropTypes from 'prop-types' ;
3
+ import { SubmitType } from '../../types' ;
4
+ import { Link } from 'react-router-dom' ;
5
+ import Moment from '../misc/moment' ;
6
+
7
+ class SubmitList extends Component {
8
+ static propTypes = {
9
+ submits : PropTypes . arrayOf ( SubmitType ) ,
10
+ }
11
+
12
+ render ( ) {
13
+ const { submits } = this . props ;
14
+
15
+ return (
16
+ < div >
17
+ { submits . map ( ( s ) => (
18
+ s && s . attributes &&
19
+ < div key = { s . id } >
20
+ < p > Submission for: < strong > { s . attributes . challenge . number } </ strong >
21
+ < Link to = { `/challenge/${ s . attributes . challenge . number } /${ s . attributes . challenge . title } ` } > { s . attributes . challenge . title } </ Link >
22
+ </ p >
23
+ < p > < strong > Description:</ strong > { s . attributes . description } </ p >
24
+ < p > Submitted: < Moment date = { s . attributes . createdAt } /> </ p >
25
+ < p >
26
+ < Link to = { `/submit/${ s . id } ` } className = "btn btn-primary" > View Details</ Link >
27
+ </ p >
28
+ </ div >
29
+ ) ) }
30
+ </ div >
31
+ ) ;
32
+ }
33
+ }
34
+
35
+ export default SubmitList ;
Original file line number Diff line number Diff line change @@ -26,14 +26,14 @@ class ChallengeContainer extends Component {
26
26
render ( ) {
27
27
const { challenge, submission, user } = this . props ;
28
28
return (
29
- < div >
29
+ < div style = { { margin : '30px auto' } } >
30
30
{ submission && challenge && < Helmet >
31
31
< title > { `codecorgi | submission for: ${ challenge . title } ` } </ title >
32
32
< meta property = "og:title" content = { `codecorgi | submission for: ${ challenge . title } ` } />
33
33
< meta property = "og:url" content = { `${ PROD_URL } /${ challenge . url } ` } />
34
34
< meta name = "twitter:title" content = { `codecorgi | submission for: ${ challenge . title } ` } />
35
35
</ Helmet > }
36
- { submission && challenge &&
36
+ { submission && challenge && user . _id &&
37
37
< SubmitDetails submission = { submission } challenge = { challenge } user = { user } />
38
38
}
39
39
</ div >
You can’t perform that action at this time.
0 commit comments