From 6f068b5503e8514dccfe98c2a6718cdc58cab2a7 Mon Sep 17 00:00:00 2001 From: saumya1906 Date: Wed, 9 Aug 2017 21:58:28 +0530 Subject: [PATCH] Issue 266 --- client/modules/IDE/components/Preferences.jsx | 160 +++++++++--------- client/styles/components/_preferences.scss | 85 +++++++++- 2 files changed, 165 insertions(+), 80 deletions(-) diff --git a/client/modules/IDE/components/Preferences.jsx b/client/modules/IDE/components/Preferences.jsx index 24203322..02e0e770 100644 --- a/client/modules/IDE/components/Preferences.jsx +++ b/client/modules/IDE/components/Preferences.jsx @@ -18,6 +18,7 @@ class Preferences extends React.Component { this.handleUpdateFont = this.handleUpdateFont.bind(this); this.handleUpdateIndentation = this.handleUpdateIndentation.bind(this); this.handleLintWarning = this.handleLintWarning.bind(this); +// this.handleTab = this.handleTab.bind(this); } handleUpdateFont(event) { @@ -46,6 +47,10 @@ class Preferences extends React.Component { this.props.setLintWarning(value); } + // handleTab(event, TabName) { + // this.props.openTab(event, TabName); + // } + render() { const beep = new Audio(beepUrl); const preferencesContainerClass = classNames({ @@ -56,7 +61,7 @@ class Preferences extends React.Component { return (
-

Preferences

+

Settings

- +
+

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

-

Indentation amount

-
-

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'} - /> - -
-
-
-

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} - /> - - -
-

Accessible text-based canvas

Used with screen reader
-
Sound
+
+

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} + /> + + +
+
); } @@ -323,6 +330,7 @@ Preferences.propTypes = { setSoundOutput: PropTypes.func.isRequired, lintWarning: PropTypes.bool.isRequired, setLintWarning: PropTypes.func.isRequired, +// openTab: PropTypes.func.isRequired, theme: PropTypes.string.isRequired, setTheme: PropTypes.func.isRequired }; diff --git a/client/styles/components/_preferences.scss b/client/styles/components/_preferences.scss index d45adebb..3cd73225 100644 --- a/client/styles/components/_preferences.scss +++ b/client/styles/components/_preferences.scss @@ -1,10 +1,15 @@ .preferences { @extend %modal; position: absolute; - top: #{51 / $base-font-size}rem; - right: #{29 / $base-font-size}rem; - width: #{288 / $base-font-size}rem; + top: #{113 / $base-font-size}rem; + right: #{192 / $base-font-size}rem; + width: #{640 / $base-font-size}rem; + height: #{540 / $base-font-size}rem; + bottom: #{371 / $base-font-size}rem; + margin-bottom: #{100 / $base-font-size}rem; + margin-right: #{100 / $base-font-size}rem; display: none; + z-index: 9999; padding: #{14 / $base-font-size}rem #{20 / $base-font-size}rem #{2 / $base-font-size}rem #{20 / $base-font-size}rem ; &--selected { display: flex; @@ -40,12 +45,31 @@ display: flex; flex-direction: row; justify-content: space-between; - margin-bottom: #{20 / $base-font-size}rem; + marhin-left: #{19 / $base-font-size}rem; @include themify() { color: getThemifyVariable('heading-text-color'); } } +.preferences__title{ + width: #{90 / $base-font-size}rem; + height: #{25 / $base-font-size}rem; + font-family: Montserrat; + font-size: #{21 / $base-font-size}rem; + font-weight: bold; + text-align: left; +} + +.preference__subheadings { + display: flex; + flex-wrap: wrap; + padding-bottom: #{7 / $base-font-size}rem; + @include themify() { + border-bottom: 1px solid getThemifyVariable('button-border-color'); + } +} + + .preference { display: flex; flex-wrap: wrap; @@ -105,6 +129,59 @@ width: #{44 / $base-font-size}rem; } +.preference__subheading1 { + @include themify() { + color: getThemifyVariable('inactive-text-color'); + &:hover { + color: getThemifyVariable('primary-text-color'); + border-bottom: #{4 / $base-font-size}rem solid getThemifyVariable('button-background-hover-color'); + } + } + font-size: #{12 / $base-font-size}rem; + height: #{25 / $base-font-size}rem; + text-align: left; + margin-top: #{30 / $base-font-size}rem; + margin-left: #{5 / $base-font-size}rem; + margin-bottom: #{0.1 / $base-font-size}rem; + font-family: Montserrat; + width: #{100 / $base-font-size}rem; +} + +.preference__subheading2 { + @include themify() { + color: getThemifyVariable('inactive-text-color'); + &:hover { + color: getThemifyVariable('primary-text-color'); + border-bottom: #{4 / $base-font-size}rem solid getThemifyVariable('button-background-hover-color'); + } + } + font-size: #{12 / $base-font-size}rem; + height: #{25 / $base-font-size}rem; + text-align: left; + margin-top: #{30 / $base-font-size}rem; + margin-left: #{46 / $base-font-size}rem; + margin-bottom: #{0.1 / $base-font-size}rem; + font-family: Montserrat; +} + +.preference__subheading3 { + @include themify() { + color: getThemifyVariable('inactive-text-color'); + &:hover { + color: getThemifyVariable('primary-text-color'); + border-bottom: #{4 / $base-font-size}rem solid getThemifyVariable('button-background-hover-color'); + } + } + font-size: #{12 / $base-font-size}rem; + height: #{25 / $base-font-size}rem; + text-align: left; + margin-top: #{30 / $base-font-size}rem; + margin-left: #{48 / $base-font-size}rem; + margin-bottom: #{0.1 / $base-font-size}rem; + width: #{78 / $base-font-size}rem; + font-family: Montserrat; +} + .preference__vertical-list { display: flex; flex-direction: column;