diff --git a/client/assets/styles/styles.mobile.less b/client/assets/styles/styles.mobile.less index d15b1668..27c8fa8a 100644 --- a/client/assets/styles/styles.mobile.less +++ b/client/assets/styles/styles.mobile.less @@ -259,15 +259,15 @@ padding: 0.25em; } - .info { - display: none; - } - .combos { display: none; } .info-combiner { + .info { + display: none; + } + .combiner { margin: 0; width: 100%; diff --git a/client/assets/styles/vbox.less b/client/assets/styles/vbox.less index 304b288a..ae5a462f 100644 --- a/client/assets/styles/vbox.less +++ b/client/assets/styles/vbox.less @@ -71,7 +71,7 @@ button { line-height: 1.6; letter-spacing: 0.15em; - border-width: 1px; + border-width: 0.1em; } } @@ -108,7 +108,7 @@ &[disabled] { background: black; - border-width: 1px; + border-width: 0.1em; }; } @@ -145,8 +145,6 @@ &.highlight { color: black; background: @silver; - // border: 1px solid @white; (this bangs around the vbox) - // overwrite the classes on white svg elements svg { stroke-width: 0.75em; diff --git a/client/src/components/vbox.combos.jsx b/client/src/components/vbox.combos.jsx index 5973f221..f3831a57 100644 --- a/client/src/components/vbox.combos.jsx +++ b/client/src/components/vbox.combos.jsx @@ -6,51 +6,61 @@ const { convertItem } = require('../utils'); const addState = connect(({ info, itemInfo, instance, tutorial, vboxInfo }) => ({ info, itemInfo, instance, tutorial, vboxInfo })); -function Combos(args) { - const { - // Variables that will change - info, - tutorial, - vboxInfo, - // Static - itemInfo, - instance, // Only used for tutorial check - } = args; - if (tutorial && instance.time_control === 'Practice' && instance.rounds.length === 1) return false; +class Combos extends preact.Component { + shouldComponentUpdate(newProps) { + if (newProps.info !== this.props.info) return true; + if (newProps.tutorial !== this.props.tutorial) return true; + if (newProps.vboxInfo !== this.props.vboxInfo) return true; + return false; + } - const vboxCombos = itemInfo.combos.filter(c => c.components.includes(vboxInfo || info)); - if (vboxCombos.length > 6 || vboxCombos.length === 0) return
; + render(props) { + const { + // Variables that will change + info, + tutorial, + vboxInfo, + // Static + itemInfo, + instance, // Only used for tutorial check + } = props; - const comboTable = vboxCombos.map((c, i) => { - const mouseOver = e => { - e.stopPropagation(); - this.setState({ comboItem: c.item }); - }; - const componentTable = (c.components.some(ci => ['Red', 'Blue', 'Green'].includes(ci))) - ? [