pagraphcontrol/components/top-left-on-screen-button-group/index.js
2018-11-23 02:45:12 +03:00

30 lines
559 B
JavaScript

const r = require('r-dom');
const { connect } = require('react-redux');
const Button = require('../button');
const TopLeftOnScreenButtonGroup = props => r.div({
classSet: {
panel: true,
'top-left-on-screen-button-group': true,
},
}, props.preferences.hideOnScreenButtons ? [] : [
r(Button, {
autoFocus: true,
onClick: props.focusCards,
}, 'Cards'),
r(Button, {
autoFocus: true,
onClick: props.focusNetwork,
}, 'Network'),
]);
module.exports = connect(
state => ({
preferences: state.preferences,
}),
)(TopLeftOnScreenButtonGroup);