Last active
April 17, 2016 18:51
-
-
Save bs1180/bd68b017fcba2163b0c5ef2f23381c9a to your computer and use it in GitHub Desktop.
List Component
This file contains hidden or 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
import React, { Component, PropTypes } from 'react' | |
import {dataConnect} from 'relate-js'; | |
import { Link } from 'react-router' | |
const data = ( | |
null, | |
null, | |
(props) => ({ | |
fragments: { | |
viewer: { | |
claims: { | |
_id: true, | |
name: true, | |
status: true, | |
created_at: true | |
} | |
} | |
} | |
}) | |
) | |
class ListClaims extends Component { | |
render () { | |
const { claims } = this.props.viewer | |
return (<div> | |
<table className="table"> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Status</th> | |
<th>Date</th> | |
</tr> | |
</thead> | |
<tbody> | |
{ claims.map((c, i) => { | |
<tr> | |
<td>{ c.name }</td> | |
<td><span className="tag">{ c.status }</span></td> | |
<td>{ c.created_at }</td> | |
</tr>} | |
} | |
</tbody> | |
</table> | |
</div>) | |
} | |
} | |
ListClaims.defaultProps = { | |
viewer: { | |
claims: [] | |
} | |
} | |
export default dataConnect(data)(ListClaims) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment