pagraphcontrol/components/top-left-on-screen-button-group/index.js
2018-11-22 01:58:42 +03:00

34 lines
596 B
JavaScript

const {
map,
} = require('ramda');
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);