// eslint-disable-next-line const preact = require('preact'); const { connect } = require('preact-redux'); const actions = require('../actions'); const ItemListContainer = require('./item.list.container'); const CrypSpawnContainer = require('./cryp.spawn.container'); const GameJoinButton = require('./game.join.button'); const CrypListContainer = require('./cryp.list.container'); const GameContainer = require('./game.container'); const Passives = require('./passive.container'); const addState = connect( (state) => { const { game, ws, account } = state; if (!game) { ws.clearGameStateInterval(); } return state; }, (dispatch) => { function setGame(game) { dispatch(actions.setGame(game)); } return { setGame }; } ); function renderBody(props) { const { game, setGame, account } = props; console.log('grep'); if (game) { return (
); } if (account) { return (
); } return
not ready
; } module.exports = addState(renderBody);