From 9587d019085ec6cfd2cfc8bd7b6b4161b397b752 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Mon, 13 Nov 2017 19:09:08 -0500 Subject: [PATCH] start to add preferences styling --- client/modules/IDE/components/Preferences.jsx | 22 +---- client/modules/IDE/pages/IDEView.jsx | 84 ++++++++++--------- client/styles/components/_preferences.scss | 21 ++--- 3 files changed, 50 insertions(+), 77 deletions(-) diff --git a/client/modules/IDE/components/Preferences.jsx b/client/modules/IDE/components/Preferences.jsx index be3a829c..a15a6832 100644 --- a/client/modules/IDE/components/Preferences.jsx +++ b/client/modules/IDE/components/Preferences.jsx @@ -1,16 +1,13 @@ import React, { PropTypes } from 'react'; import InlineSVG from 'react-inlinesvg'; -import classNames from 'classnames'; import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'; // 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'); const beepUrl = require('../../../sounds/audioAlert.mp3'); -// import { debounce } from 'lodash'; class Preferences extends React.Component { constructor(props) { @@ -54,24 +51,9 @@ class Preferences extends React.Component { render() { const beep = new Audio(beepUrl); - const preferencesContainerClass = classNames({ - 'preferences': true, - 'preferences--selected': this.props.isVisible - }); return ( -
-
-

Settings

- -
+
@@ -320,8 +302,6 @@ class Preferences extends React.Component { } Preferences.propTypes = { - isVisible: PropTypes.bool.isRequired, - closePreferences: PropTypes.func.isRequired, fontSize: PropTypes.number.isRequired, indentationAmount: PropTypes.number.isRequired, setIndentation: PropTypes.func.isRequired, diff --git a/client/modules/IDE/pages/IDEView.jsx b/client/modules/IDE/pages/IDEView.jsx index 4c03c581..0794765d 100644 --- a/client/modules/IDE/pages/IDEView.jsx +++ b/client/modules/IDE/pages/IDEView.jsx @@ -246,29 +246,35 @@ class IDEView extends React.Component { currentUser={this.props.user.username} showHelpModal={this.props.showHelpModal} /> - + {this.props.ide.preferencesIsVisible && + + + + }
{ this.overlay = element; }}>
- {(() => { - if ( + {( ( (this.props.preferences.textOutput || - this.props.preferences.gridOutput || - this.props.preferences.soundOutput - ) && this.props.ide.isPlaying - ) || this.props.ide.isAccessibleOutputPlaying) { - return ( - - ); - } - return ''; - })()} + this.props.preferences.gridOutput || + this.props.preferences.soundOutput + ) && + this.props.ide.isPlaying + ) || + this.props.ide.isAccessibleOutputPlaying + ) && + + }