Skip to content

Commit

Permalink
Removed formulas mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartozzz committed Jul 8, 2017
1 parent 661979a commit 09d3c91
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 41 deletions.
26 changes: 1 addition & 25 deletions client/scripts/components/App.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,6 @@ export default class App extends Component {
} );
}

toggleModal = modal => {
switch ( modal ) {
case ModalConstants.MODAL_TEXT:
return this.setState( {
isModalFormulasOpen : false,
} );

case ModalConstants.MODAL_FORMULAS:
return this.setState( {
isModalFormulasOpen : ! this.state.isModalFormulasOpen,
} );
}
}

render() {
const theme = className( {
"./styles/themes/light/index.min.css" : this.state.isThemeToggled,
Expand All @@ -50,18 +36,8 @@ export default class App extends Component {
<link rel="stylesheet" href={theme} />

<AppHeader {...this.state} toggleTheme={this.toggleTheme} togglePreview={this.togglePreview} />
<AppContent {...this.state} toggleModal={this.toggleModal} />
<AppContent {...this.state} />
<AppFooter {...this.state} />

<Modal
isOpen={this.state.isModalFormulasOpen}

className="modal qilin-panel"
portalClassName="modal-portal"
overlayClassName="modal-overlay qilin-panel"
>
Formulas here
</Modal>
</div>
);
}
Expand Down
17 changes: 3 additions & 14 deletions client/scripts/components/AppContent.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import ModalConstants from "../constants/ModalConstants";

export default class AppContent extends Component {
static propTypes = {
toggleModal : PropTypes.func.isRequired,
isPreviewToggled : PropTypes.bool.isRequired,

isModalFormulasOpen : PropTypes.bool.isRequired
isPreviewToggled : PropTypes.bool.isRequired
}

render() {
Expand All @@ -20,11 +17,7 @@ export default class AppContent extends Component {
} );

const textButton = className( "app-content-icon qilin-panel", {
"is-active" : ! this.props.isModalFormulasOpen,
} );

const formulasButton = className( "app-content-icon qilin-panel", {
"is-active" : this.props.isModalFormulasOpen,
"is-active" : true
} );

return (
Expand All @@ -43,13 +36,9 @@ export default class AppContent extends Component {
</div>

<div className="app-content-left qilin-panel">
<div className={textButton} onClick={() => this.props.toggleModal( ModalConstants.MODAL_TEXT )}>
<div className={textButton}>
<ReactSVG className="qilin-icon" path="images/icons/menu/text.svg" />
</div>

<div className={formulasButton} onClick={() => this.props.toggleModal( ModalConstants.MODAL_FORMULAS )}>
<ReactSVG className="qilin-icon" path="images/icons/menu/functions.svg" />
</div>
</div>
</div>
);
Expand Down
3 changes: 1 addition & 2 deletions client/scripts/constants/ModalConstants.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import keyMirror from "keymirror";

export default keyMirror( {
MODAL_TEXT : null,
MODAL_FORMULAS : null
MODAL_TEXT : null
} );

0 comments on commit 09d3c91

Please sign in to comment.