-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e543e7
commit 8154eef
Showing
12 changed files
with
322 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,27 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
node_modules | ||
*/node_modules | ||
.vscode | ||
yarn.lock | ||
|
||
/db | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React, { Component } from 'react'; | ||
import { Alert, Card } from 'antd'; | ||
|
||
import { get } from 'lodash'; | ||
|
||
class Blogpost extends Component { | ||
render() { | ||
const { | ||
title, | ||
content, | ||
error, | ||
loading | ||
} = this.props; | ||
|
||
const name = get(this.props, 'user.name'); | ||
|
||
if (error) { | ||
return <Alert message="Something happened" type="error" /> | ||
} | ||
|
||
return ( | ||
<div style={{ background: '#ECECEC', padding: '30px' }}> | ||
<Card loading={loading} title={title} bordered={false} style={{ width: '90vw', margin: '0 auto' }}> | ||
<p | ||
style={{ | ||
fontSize: 14, | ||
color: 'rgba(0, 0, 0, 0.85)', | ||
marginBottom: 16, | ||
fontWeight: 500, | ||
}} | ||
> | ||
Author: { name } | ||
</p> | ||
<p> | ||
{ | ||
content | ||
} | ||
</p> | ||
</Card> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default Blogpost; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React, { Component } from 'react'; | ||
import { graphql } from 'react-apollo'; | ||
import gql from 'graphql-tag'; | ||
import { Alert, Card } from 'antd'; | ||
|
||
import Blogpost from './Blogpost'; | ||
|
||
class BlogpostContainer extends Component { | ||
render() { | ||
return ( | ||
<Blogpost { ...this.props.data.getPost } error={this.props.data.error} loading={this.props.data.loading}/> | ||
) | ||
} | ||
} | ||
|
||
export default graphql(gql` | ||
query ($postid: Int){ | ||
getPost(postid: $postid) { | ||
title, | ||
user{ | ||
name | ||
} | ||
content | ||
comments{ | ||
commentid | ||
} | ||
} | ||
} | ||
`)(BlogpostContainer); |
Oops, something went wrong.