Skip to content

Commit

Permalink
leave button
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud.gregoire committed Oct 28, 2021
1 parent 5e7d5fa commit eea581a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions app/public/src/pages/component/gam-leave.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React, { Component } from 'react';

class GameLeave extends Component{

render(){
return <button type="button" className="nes-btn is-error" onClick={this.props.click}>X</button>;
}
}

export default GameLeave;
4 changes: 2 additions & 2 deletions app/public/src/pages/component/game-informations.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';

import GameLeave from './gam-leave';
class GameInformations extends Component{

render(){
Expand All @@ -16,7 +16,7 @@ class GameInformations extends Component{
}

return <div style={style} className='nes-container'>
<img src='/assets/ui/clock.png'/>
<GameLeave click={this.props.click}/>
<h5>T{this.props.turn}</h5>
<h2>{this.props.time}s</h2>
</div>;
Expand Down
2 changes: 1 addition & 1 deletion app/public/src/pages/game.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { WORDS} from '../../../models/enum';
import GamePlayerInformations from './component/game-player-informations';
import GameDpsMeter from './component/game-dps-meter';
import GameSynergies from './component/game-synergies';

class Game extends Component {

constructor(props){
Expand Down Expand Up @@ -368,6 +367,7 @@ class Game extends Component {
<GameInformations
time={this.state.gameState.roundTime}
turn={this.state.gameState.stageLevel}
click={this.leaveGame.bind(this)}
/>
<GamePlayers
players={this.state.gameState.players}
Expand Down

0 comments on commit eea581a

Please sign in to comment.