This commit is contained in:
ntr
2019-05-18 20:22:34 +10:00
parent 27253aeba1
commit fd7e634d72
10 changed files with 54 additions and 55 deletions
+10 -3
View File
@@ -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 />
);
+10 -4
View File
@@ -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>