From 9121359be6467689d7a46f6535ea58ef75c71637 Mon Sep 17 00:00:00 2001 From: Michael Fix Date: Fri, 25 Oct 2019 12:13:05 -0700 Subject: [PATCH] restructure settings menu into Window, Editor, & Misc (#898) --- components/MenuButton.js | 2 +- components/Settings.js | 75 +++++++++++++++++++++------------------- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/components/MenuButton.js b/components/MenuButton.js index 1449bcd..f0f8917 100644 --- a/components/MenuButton.js +++ b/components/MenuButton.js @@ -30,7 +30,7 @@ const MenuButton = React.memo(({ name, select, selected, noArrows }) => { } .menu-button:last-child { - ${selected === 'Window' ? '' : 'border-bottom: none;'}; + ${selected === 'Misc' ? 'border-bottom: none;' : ''}; } .arrow-icon { diff --git a/components/Settings.js b/components/Settings.js index 4bba1df..fff5d62 100644 --- a/components/Settings.js +++ b/components/Settings.js @@ -29,9 +29,6 @@ function WindowSettings({ dropShadowBlurRadius, dropShadowOffsetY, windowControls, - lineNumbers, - firstLineNumber, - hiddenCharacters, widthAdjustment, watermark, onWidthChanging, @@ -79,28 +76,6 @@ function WindowSettings({ enabled={windowControls} onChange={onChange.bind(null, 'windowControls')} /> - - {lineNumbers && ( -
- onChange('firstLineNumber', Number(e.target.value))} - width="50%" - /> -
- )} - ) } -function TypeSettings({ +function EditorSettings({ onChange, onUpload, font, size, lineHeight, + lineNumbers, + firstLineNumber, + hiddenCharacters, onWidthChanging, onWidthChanged }) { @@ -165,6 +139,35 @@ function TypeSettings({ unit="%" onChange={onChange.bind(null, 'lineHeight')} /> + + {lineNumbers && ( +
+ onChange('firstLineNumber', Number(e.target.value))} + width="50%" + /> +
+ )} + + ) } @@ -350,16 +353,13 @@ class Settings extends React.PureComponent { dropShadowBlurRadius={this.props.dropShadowBlurRadius} dropShadowOffsetY={this.props.dropShadowOffsetY} windowControls={this.props.windowControls} - lineNumbers={this.props.lineNumbers} - firstLineNumber={this.props.firstLineNumber} - hiddenCharacters={this.props.hiddenCharacters} widthAdjustment={this.props.widthAdjustment} watermark={this.props.watermark} /> ) - case 'Type': + case 'Editor': return ( - ) case 'Misc': { @@ -434,7 +437,7 @@ class Settings extends React.PureComponent {
- +
{this.renderContent()}