-
{infoText} {fullInfo.cost}b
+
{infoName} {fullInfo.cost}b
{header}
{itemSourceInfo}
{cooldown}
diff --git a/client/src/components/instance.component.jsx b/client/src/components/instance.component.jsx
index d4953550..b5e98674 100644
--- a/client/src/components/instance.component.jsx
+++ b/client/src/components/instance.component.jsx
@@ -13,11 +13,13 @@ const actions = require('../actions');
const addState = connect(
function receiveState(state) {
- const { instance,
+ const {
+ instance,
nav,
navInstance,
} = state;
- return { instance,
+ return {
+ instance,
nav,
navInstance,
};
@@ -52,7 +54,7 @@ const addState = connect(
);
class Instance extends Component {
- componentShouldUpdate(newProps) {
+ shouldComponentUpdate(newProps) {
if (newProps.instance !== this.props.instance) return true;
return false;
}
diff --git a/client/src/components/main.jsx b/client/src/components/main.jsx
index ab923182..b03e0069 100644
--- a/client/src/components/main.jsx
+++ b/client/src/components/main.jsx
@@ -16,35 +16,45 @@ const addState = connect(
}
);
-function Main(props) {
- const {
- game,
- instance,
- account,
- nav,
- } = props;
-
- if (!account) {
- return
;
+class Main extends preact.Component {
+ shouldComponentUpdate(newProps) {
+ if (newProps.game !== this.props.game) return true;
+ if (newProps.instance !== this.props.instance) return true;
+ if (newProps.account !== this.props.account) return true;
+ if (newProps.nav !== this.props.nav) return true;
+ return false;
}
- if (game) {
- return
;
+ render(props) {
+ const {
+ game,
+ instance,
+ account,
+ nav,
+ } = props;
+
+ if (!account) {
+ return
;
+ }
+
+ if (game) {
+ return
;
+ }
+
+ if (instance) {
+ return
;
+ }
+
+ if (nav === 'transition') return false;
+
+ return (
+
+ );
}
-
- if (instance) {
- return
;
- }
-
- if (nav === 'transition') return false;
-
- return (
-
- );
}
module.exports = addState(Main);
diff --git a/client/src/components/mnml.jsx b/client/src/components/mnml.jsx
index 5c4ae51b..60dad587 100644
--- a/client/src/components/mnml.jsx
+++ b/client/src/components/mnml.jsx
@@ -10,11 +10,21 @@ const addState = connect(
state => ({ showNav: state.showNav })
);
-const Mnml = ({ showNav }) =>
-
-
-
-
-
;
+class Mnml extends preact.Component {
+ shouldComponentUpdate(newProps) {
+ if (newProps.showNav !== this.props.showNav) return true;
+ return false;
+ }
+
+ render(args) {
+ return (
+
+
+
+
+
+ );
+ }
+}
module.exports = addState(Mnml);