From 6b6ff7ca222c861551f4f38a4a2381a168e7681b Mon Sep 17 00:00:00 2001 From: saumya1906 Date: Wed, 9 Aug 2017 23:04:59 +0530 Subject: [PATCH] Issue 266: Tabs added --- client/modules/IDE/components/Preferences.jsx | 477 +++++++++--------- client/modules/IDE/pages/IDEView.jsx | 1 + client/styles/components/_preferences.scss | 2 +- 3 files changed, 245 insertions(+), 235 deletions(-) diff --git a/client/modules/IDE/components/Preferences.jsx b/client/modules/IDE/components/Preferences.jsx index 02e0e770..d2771b2b 100644 --- a/client/modules/IDE/components/Preferences.jsx +++ b/client/modules/IDE/components/Preferences.jsx @@ -1,6 +1,7 @@ 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'; @@ -71,240 +72,248 @@ class Preferences extends React.Component { -
-

General Settings

-

Sketch Settings

-

Accessibility

-
-
-

Theme

-
- this.props.setTheme('light')} - aria-label="light theme on" - name="light theme" - id="light-theme-on" - className="preference__radio-button" - value="light" - checked={this.props.theme === 'light'} - /> - - this.props.setTheme('dark')} - aria-label="dark theme on" - name="dark theme" - id="dark-theme-on" - className="preference__radio-button" - value="dark" - checked={this.props.theme === 'dark'} - /> - - this.props.setTheme('contrast')} - aria-label="contrast theme on" - name="contrast theme" - id="contrast-theme-on" - className="preference__radio-button" - value="contrast" - checked={this.props.theme === 'contrast'} - /> - -
-
-
-

Text size

- - { this.fontSizeInput = element; }} - onClick={() => { - this.fontSizeInput.select(); - }} - > - - -
-
-

Indentation amount

- - { this.indentationInput = element; }} - onClick={() => { - this.indentationInput.select(); - }} - > - - -
- - - - -
-
-
-

Autosave

-
- this.props.setAutosave(true)} - aria-label="autosave on" - name="autosave" - id="autosave-on" - className="preference__radio-button" - value="On" - checked={this.props.autosave} - /> - - this.props.setAutosave(false)} - aria-label="autosave off" - name="autosave" - id="autosave-off" - className="preference__radio-button" - value="Off" - checked={!this.props.autosave} - /> - -
-
-
-

Accessible text-based canvas

-
Used with screen reader
-
- { - this.props.setTextOutput(event.target.checked); - }} - aria-label="text output on" - name="text output" - id="text-output-on" - value="On" - checked={(this.props.textOutput)} - /> - - { - this.props.setGridOutput(event.target.checked); - }} - aria-label="table output on" - name="table output" - id="table-output-on" - value="On" - checked={(this.props.gridOutput)} - /> - - { - this.props.setSoundOutput(event.target.checked); - }} - aria-label="sound output on" - name="sound output" - id="sound-output-on" - value="On" - checked={(this.props.soundOutput)} - /> - -
-
-
-

Lint warning sound

-
- this.props.setLintWarning(true)} - aria-label="lint warning on" - name="lint warning" - id="lint-warning-on" - className="preference__radio-button" - value="On" - checked={this.props.lintWarning} - /> - - this.props.setLintWarning(false)} - aria-label="lint warning off" - name="lint warning" - id="lint-warning-off" - className="preference__radio-button" - value="Off" - checked={!this.props.lintWarning} - /> - - -
-
+ + +
+

General Settings

+

Sketch Settings

+

Accessibility

+
+
+ +
+

Theme

+
+ this.props.setTheme('light')} + aria-label="light theme on" + name="light theme" + id="light-theme-on" + className="preference__radio-button" + value="light" + checked={this.props.theme === 'light'} + /> + + this.props.setTheme('dark')} + aria-label="dark theme on" + name="dark theme" + id="dark-theme-on" + className="preference__radio-button" + value="dark" + checked={this.props.theme === 'dark'} + /> + + this.props.setTheme('contrast')} + aria-label="contrast theme on" + name="contrast theme" + id="contrast-theme-on" + className="preference__radio-button" + value="contrast" + checked={this.props.theme === 'contrast'} + /> + +
+
+
+

Text size

+ + { this.fontSizeInput = element; }} + onClick={() => { + this.fontSizeInput.select(); + }} + > + + +
+
+

Indentation amount

+ + { this.indentationInput = element; }} + onClick={() => { + this.indentationInput.select(); + }} + > + + +
+ + + + +
+
+
+

Autosave

+
+ this.props.setAutosave(true)} + aria-label="autosave on" + name="autosave" + id="autosave-on" + className="preference__radio-button" + value="On" + checked={this.props.autosave} + /> + + this.props.setAutosave(false)} + aria-label="autosave off" + name="autosave" + id="autosave-off" + className="preference__radio-button" + value="Off" + checked={!this.props.autosave} + /> + +
+
+
+ +
+

Accessible text-based canvas

+
Used with screen reader
+
+ { + this.props.setTextOutput(event.target.checked); + }} + aria-label="text output on" + name="text output" + id="text-output-on" + value="On" + checked={(this.props.textOutput)} + /> + + { + this.props.setGridOutput(event.target.checked); + }} + aria-label="table output on" + name="table output" + id="table-output-on" + value="On" + checked={(this.props.gridOutput)} + /> + + { + this.props.setSoundOutput(event.target.checked); + }} + aria-label="sound output on" + name="sound output" + id="sound-output-on" + value="On" + checked={(this.props.soundOutput)} + /> + +
+
+
+

Lint warning sound

+
+ this.props.setLintWarning(true)} + aria-label="lint warning on" + name="lint warning" + id="lint-warning-on" + className="preference__radio-button" + value="On" + checked={this.props.lintWarning} + /> + + this.props.setLintWarning(false)} + aria-label="lint warning off" + name="lint warning" + id="lint-warning-off" + className="preference__radio-button" + value="Off" + checked={!this.props.lintWarning} + /> + + +
+
+
+
); } diff --git a/client/modules/IDE/pages/IDEView.jsx b/client/modules/IDE/pages/IDEView.jsx index 3d5baa71..1f6cbc75 100644 --- a/client/modules/IDE/pages/IDEView.jsx +++ b/client/modules/IDE/pages/IDEView.jsx @@ -3,6 +3,7 @@ import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { withRouter } from 'react-router'; import { Helmet } from 'react-helmet'; +import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'; import SplitPane from 'react-split-pane'; import Editor from '../components/Editor'; import Sidebar from '../components/Sidebar'; diff --git a/client/styles/components/_preferences.scss b/client/styles/components/_preferences.scss index 3cd73225..b2571646 100644 --- a/client/styles/components/_preferences.scss +++ b/client/styles/components/_preferences.scss @@ -63,7 +63,7 @@ .preference__subheadings { display: flex; flex-wrap: wrap; - padding-bottom: #{7 / $base-font-size}rem; + padding-bottom: #{0.1 / $base-font-size}rem; @include themify() { border-bottom: 1px solid getThemifyVariable('button-border-color'); }