Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dclarke-modus/16f852f797fee8ba644fe0faf173c13b to your computer and use it in GitHub Desktop.
Save dclarke-modus/16f852f797fee8ba644fe0faf173c13b to your computer and use it in GitHub Desktop.
import React from 'react';
import {createFragmentContainer, graphql} from 'react-relay';
import scopeAction from './actions/scopeModalAction';
class Scope extends React.Component {
constructor(props, context) {
super(props, context);
this.editScope = this.editScope.bind(this);
}
render () {
return (
<tr key={this.props.scope.id}>
<td>{this.props.scope.name}</td>
<td>{this.props.scope.description}</td>
<td></td>
<td></td>
<td>
<a className="btn" href="#" onClick={this.editScope}><i className="icon-edit"></i></a>
<a className="btn" href="#"><i className="icon-trash"></i></a>
</td>
</tr>
)
}
editScope () {
scopeAction.modal(this.props.scope, true);
}
}
module.exports = createFragmentContainer(Scope, graphql `
fragment Scope_scope on Scope {
id
name
description
}
`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment