const preact = require('preact');
const { connect } = require('preact-redux');

const Main = require('./main');
// const Nav = require('./nav');
const Controls = require('./controls');

const addState = connect(
    ({ game, instance }) => ({ game, instance })
);

function Mnml(args) {
    const {
        game,
        instance,
    } = args;

    const rotateClass = (game || instance) && window.innerWidth < window.innerHeight
        ? 'show'
        : '';

    return (
        <div id="mnml">
            <Main />
            <Controls />
            <div id="rotate" class={rotateClass} >
            </div>
        </div>
    );
}

module.exports = addState(Mnml);
