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() {
let preferencesContainerClass = classNames({
"preferences": true,
"preferences--selected": this.props.isPreferencesShowing
"preferences--selected": this.props.isVisible
});
return (
<div className={preferencesContainerClass} tabindex="0">

View file

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

View file

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

View file

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