compress
This commit is contained in:
@@ -9,13 +9,18 @@ const InstanceContainer = require('./instance.container');
|
||||
|
||||
const addState = connect(
|
||||
state => {
|
||||
const { game, instance, ws, account } = state;
|
||||
return { game, instance, account };
|
||||
const { game, instance, account, nav } = state;
|
||||
return { game, instance, account, nav };
|
||||
}
|
||||
);
|
||||
|
||||
function renderBody(props) {
|
||||
const { game, instance, account } = props;
|
||||
const {
|
||||
game,
|
||||
instance,
|
||||
account,
|
||||
nav,
|
||||
} = props;
|
||||
|
||||
if (!account) {
|
||||
return (
|
||||
@@ -37,6 +42,8 @@ function renderBody(props) {
|
||||
);
|
||||
}
|
||||
|
||||
// if (nav === 'list')
|
||||
|
||||
return (
|
||||
<MenuContainer />
|
||||
);
|
||||
|
||||
@@ -33,9 +33,14 @@ const addState = connect(
|
||||
return dispatch(actions.setInstance(testInstance(id)));
|
||||
}
|
||||
|
||||
function navTo(place) {
|
||||
return dispatch(actions.setNav(place));
|
||||
}
|
||||
|
||||
return {
|
||||
setTestGame,
|
||||
setTestInstance,
|
||||
navTo,
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -46,6 +51,7 @@ function Nav(args) {
|
||||
sendInstanceState,
|
||||
instances,
|
||||
|
||||
navTo,
|
||||
setTestGame,
|
||||
setTestInstance,
|
||||
} = args;
|
||||
@@ -57,11 +63,11 @@ function Nav(args) {
|
||||
return (
|
||||
<nav>
|
||||
<h2>Team</h2>
|
||||
<button>spawn</button>
|
||||
<button>select</button>
|
||||
<button onClick={() => navTo('team')}>spawn</button>
|
||||
<button onClick={() => navTo('team')}>select</button>
|
||||
<h2>Instances</h2>
|
||||
<button>list</button>
|
||||
<button>new</button>
|
||||
<button onClick={() => navTo('instances')}>list</button>
|
||||
<button onClick={() => navTo('instances')}>new</button>
|
||||
<hr />
|
||||
{joined}
|
||||
<h2>Hax</h2>
|
||||
|
||||
Reference in New Issue
Block a user