rename preferences state

This commit is contained in:
catarak 2016-06-22 17:49:29 -04:00
parent 81aabddeb1
commit a66ef24fb9
4 changed files with 9 additions and 10 deletions

View file

@ -10,7 +10,7 @@ class Preferences extends React.Component {
render() { render() {
let preferencesContainerClass = classNames({ let preferencesContainerClass = classNames({
"preferences": true, "preferences": true,
"preferences--selected": this.props.isPreferencesShowing "preferences--selected": this.props.isVisible
}); });
return ( return (
<div className={preferencesContainerClass} tabindex="0"> <div className={preferencesContainerClass} tabindex="0">

View file

@ -19,7 +19,7 @@ class Toolbar extends React.Component {
}); });
let preferencesButtonClass = classNames({ let preferencesButtonClass = classNames({
"toolbar__preferences-button": true, "toolbar__preferences-button": true,
"toolbar__preferences-button--selected": this.props.isPreferencesShowing "toolbar__preferences-button--selected": this.props.isPreferencesVisible
}); });
return ( return (

View file

@ -33,10 +33,9 @@ class IDEView extends React.Component {
projectName={this.props.project.name} projectName={this.props.project.name}
setProjectName={this.props.setProjectName} setProjectName={this.props.setProjectName}
openPreferences={this.props.openPreferences} openPreferences={this.props.openPreferences}
isPreferencesShowing = {this.props.preferences.isPreferencesShowing} isPreferencesVisible={this.props.preferences.isVisible}/>
/>
<Preferences <Preferences
isPreferencesShowing = {this.props.preferences.isPreferencesShowing} isVisible={this.props.preferences.isVisible}
closePreferences={this.props.closePreferences} closePreferences={this.props.closePreferences}
increaseFont={this.props.increaseFont} increaseFont={this.props.increaseFont}
decreaseFont={this.props.decreaseFont} decreaseFont={this.props.decreaseFont}

View file

@ -1,7 +1,7 @@
import * as ActionTypes from '../../../constants'; import * as ActionTypes from '../../../constants';
const initialState = { const initialState = {
isPreferencesShowing: false, isVisible: false,
fontSize: 18 fontSize: 18
} }
@ -9,22 +9,22 @@ const preferences = (state = initialState, action) => {
switch (action.type) { switch (action.type) {
case ActionTypes.OPEN_PREFERENCES: case ActionTypes.OPEN_PREFERENCES:
return { return {
isPreferencesShowing: true, isVisible: true,
fontSize: state.fontSize fontSize: state.fontSize
} }
case ActionTypes.CLOSE_PREFERENCES: case ActionTypes.CLOSE_PREFERENCES:
return { return {
isPreferencesShowing: false, isVisible: false,
fontSize: state.fontSize fontSize: state.fontSize
} }
case ActionTypes.INCREASE_FONTSIZE: case ActionTypes.INCREASE_FONTSIZE:
return { return {
isPreferencesShowing: state.isPreferencesShowing, isVisible: state.isVisible,
fontSize: state.fontSize+2 fontSize: state.fontSize+2
} }
case ActionTypes.DECREASE_FONTSIZE: case ActionTypes.DECREASE_FONTSIZE:
return { return {
isPreferencesShowing: state.isPreferencesShowing, isVisible: state.isVisible,
fontSize: state.fontSize-2 fontSize: state.fontSize-2
} }
default: default: