mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 18:25:30 +00:00
36 lines
982 B
JavaScript
36 lines
982 B
JavaScript
import React from "react";
|
|
import { connect } from "react-redux";
|
|
import classnames from "classnames";
|
|
|
|
import { SET_FOCUS, UNSET_FOCUS } from "../../actionTypes";
|
|
import { toggleDoubleSizeMode } from "../../actionCreators";
|
|
|
|
const ClutterBar = props => (
|
|
<div id="clutter-bar">
|
|
<div id="button-o" />
|
|
<div id="button-a" />
|
|
<div id="button-i" />
|
|
<div
|
|
title={"Toggle Doublesize Mode"}
|
|
id="button-d"
|
|
className={classnames({ selected: props.doubled })}
|
|
onMouseUp={props.handleMouseUp}
|
|
onMouseDown={props.handleMouseDown}
|
|
/>
|
|
<div id="button-v" />
|
|
</div>
|
|
);
|
|
|
|
const mapStateToProps = state => ({
|
|
doubled: state.display.doubled
|
|
});
|
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
handleMouseDown: () => dispatch({ type: SET_FOCUS, input: "double" }),
|
|
handleMouseUp: () => {
|
|
dispatch(toggleDoubleSizeMode());
|
|
dispatch({ type: UNSET_FOCUS });
|
|
}
|
|
});
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ClutterBar);
|