Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class GameListItem extends BaseComponent {
- constructor(props, context) {
- super(props, context);
- this.state = {
- name: props.name,
- owner: props.owner,
- uid: props.uid,
- status: props.status
- };
- this.handleClick = this.handleClick.bind(this);
- }
- handleClick() {
- let inst = this;
- (
- async function() {
- let res = await inst.engine.async_action({'action': 'join_game', 'data': {'game_uid': inst.state.uid}});
- console.log('res: ', res);
- }()
- );
- }
- render() {
- return (
- <li className="list-group-item" >
- <ProtectedLink text={this.state.name} classes="game_link" onClick={this.handleClick}/>
- </li>
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement