From 68fb7e68f24365f83e12d88ee31d378f717e878a Mon Sep 17 00:00:00 2001 From: David Lechner Date: Tue, 26 Jan 2021 14:29:15 -0600 Subject: [PATCH 01/16] format scss files --- .vscode/settings.json | 8 ++++---- src/components/app.scss | 2 +- src/components/editor.scss | 6 +++--- src/index.scss | 4 +++- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 62604942..38041163 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,4 @@ { - "[css]": { - "editor.suggest.insertMode": "replace", - "editor.formatOnSave": true - }, "[json]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" @@ -11,6 +7,10 @@ "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[scss]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, diff --git a/src/components/app.scss b/src/components/app.scss index ecc1a7d8..6a740de6 100644 --- a/src/components/app.scss +++ b/src/components/app.scss @@ -5,7 +5,7 @@ @import '../variables.scss'; -.#{$ns}-dark .splitter-layout > .layout-splitter { +.#{$ns}-dark .splitter-layout > .layout-splitter { // make layout splitter match app color scheme background-color: $pt-dark-app-background-color; } diff --git a/src/components/editor.scss b/src/components/editor.scss index 5cb49f28..b501d877 100644 --- a/src/components/editor.scss +++ b/src/components/editor.scss @@ -24,13 +24,13 @@ // add "BETA" watermark .pb-beta .ace_scroller::after { - content: ""; - background: url("./images/beta.svg"); + content: ''; + background: url('./images/beta.svg'); opacity: 1; top: 0; left: 0; bottom: 0; right: 0; position: absolute; - pointer-events: none + pointer-events: none; } diff --git a/src/index.scss b/src/index.scss index 310284fd..1292ab1c 100644 --- a/src/index.scss +++ b/src/index.scss @@ -19,7 +19,9 @@ body { .h-body { // height makes everything fit without scrolling - height: calc(100vh - #{$pt-navbar-height} - #{$pb-status-bar-height} - var(--mobile-pad)) !important; + height: calc( + 100vh - #{$pt-navbar-height} - #{$pb-status-bar-height} - var(--mobile-pad) + ) !important; } .h-100 { From c7803fed199a99292a21ab8b3d76a4d6d0ebf5ec Mon Sep 17 00:00:00 2001 From: David Lechner Date: Tue, 26 Jan 2021 15:37:58 -0600 Subject: [PATCH 02/16] fix wrong event type on switch Fixes: index.js:1 Warning: Failed prop type: You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`. --- src/components/SettingsDrawer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/SettingsDrawer.tsx b/src/components/SettingsDrawer.tsx index b24da192..52dbdde7 100644 --- a/src/components/SettingsDrawer.tsx +++ b/src/components/SettingsDrawer.tsx @@ -211,7 +211,9 @@ class SettingsDrawer extends React.PureComponent { pseudolocalize(!i18n.pseudolocalize)} + onChange={() => + pseudolocalize(!i18n.pseudolocalize) + } label="Pseudolocalize" /> From eebeec509cb6a857d6e833d8a4a3c5354b9b164f Mon Sep 17 00:00:00 2001 From: David Lechner Date: Tue, 26 Jan 2021 17:41:44 -0600 Subject: [PATCH 03/16] don't focus buttons on click This prevents the navbar buttons from gaining focus when clicked. This way it prevents losing focus from the editor or terminal. It also prevents the settings button from being highlighted after the settings menu is closed. --- src/components/ActionButton.tsx | 1 + src/components/OpenFileButton.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/ActionButton.tsx b/src/components/ActionButton.tsx index 7377dcb6..4b21ecde 100644 --- a/src/components/ActionButton.tsx +++ b/src/components/ActionButton.tsx @@ -51,6 +51,7 @@ class ActionButton extends React.Component {