import React, { PropTypes } from 'react'; import InlineSVG from 'react-inlinesvg'; import classNames from 'classnames'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import * as PreferencesActions from '../actions/preferences'; const exitUrl = require('../../../images/exit.svg'); const plusUrl = require('../../../images/plus.svg'); const minusUrl = require('../../../images/minus.svg'); function Preferences(props) { const preferencesContainerClass = classNames({ preferences: true, 'preferences--selected': props.isVisible }); let preferencesTabOptionClass = classNames({ preference__option: true, 'preference__option--selected': props.isTabIndent }); let preferencesSpaceOptionClass = classNames({ preference__option: true, 'preference__option--selected': !props.isTabIndent }); return (

Preferences

Text Size

Indentation Amount

); } function mapStateToProps(state) { return { ...state.preferences }; } function mapDispatchToProps(dispatch) { return bindActionCreators(PreferencesActions, dispatch); } Preferences.propTypes = { isVisible: PropTypes.bool.isRequired, closePreferences: PropTypes.func.isRequired, decreaseFont: PropTypes.func.isRequired, updateFont: PropTypes.func.isRequired, fontSize: PropTypes.number.isRequired, increaseFont: PropTypes.func.isRequired, indentationAmount: PropTypes.number.isRequired, decreaseIndentation: PropTypes.func.isRequired, increaseIndentation: PropTypes.func.isRequired, updateIndentation: PropTypes.func.isRequired, indentWithSpace: PropTypes.func.isRequired, indentWithTab: PropTypes.func.isRequired, isTabIndent: PropTypes.bool.isRequired }; export default connect(mapStateToProps, mapDispatchToProps)(Preferences);