From cb180acf0071a60d4ddbce2f41a47de48dfd8556 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 14 Aug 2020 18:27:51 +0100 Subject: [PATCH] Settings tab checkbox and github token ui changes --- .../src/app/components/side-panel.js | 1 + apps/remix-ide/src/app/tabs/settings-tab.js | 57 ++++++++----------- .../app/tabs/styles/settings-tab-styles.js | 6 ++ 3 files changed, 31 insertions(+), 33 deletions(-) diff --git a/apps/remix-ide/src/app/components/side-panel.js b/apps/remix-ide/src/app/components/side-panel.js index 411b40f416..b68f7430ad 100644 --- a/apps/remix-ide/src/app/components/side-panel.js +++ b/apps/remix-ide/src/app/components/side-panel.js @@ -26,6 +26,7 @@ const css = csjs` display: flex; align-items: center; padding: 16px 24px 15px; + justify-content: space-between; } .icons i { height: 80%; diff --git a/apps/remix-ide/src/app/tabs/settings-tab.js b/apps/remix-ide/src/app/tabs/settings-tab.js index 8b5ddf7863..dd3af33346 100644 --- a/apps/remix-ide/src/app/tabs/settings-tab.js +++ b/apps/remix-ide/src/app/tabs/settings-tab.js @@ -69,19 +69,19 @@ module.exports = class SettingsTab extends ViewPlugin { // Gist settings const token = this.config.get('settings/gist-access-token') - const gistAccessToken = yo`` + const gistAccessToken = yo`` if (token) gistAccessToken.value = token const removeToken = () => { self.config.set('settings/gist-access-token', ''); gistAccessToken.value = ''; tooltip('Access token removed') } const saveToken = () => { this.config.set('settings/gist-access-token', gistAccessToken.value); tooltip('Access token saved') } const gistAddToken = yo` saveToken()} value="Save" type="button">` - const gistRemoveToken = yo` removeToken()}" type="button">` - this._view.gistToken = yo`
${gistAccessToken}${gistAddToken}${copyToClipboard(() => gistAccessToken.value)}${gistRemoveToken}
` - this._view.optionVM = yo`` + const gistRemoveToken = yo`` + this._view.gistToken = yo`
${gistAccessToken}
${copyToClipboard(() => gistAccessToken.value)}${gistAddToken}${gistRemoveToken}
` + this._view.optionVM = yo`` if (this.config.get('settings/always-use-vm') === undefined) this.config.set('settings/always-use-vm', true) if (this.config.get('settings/always-use-vm')) this._view.optionVM.setAttribute('checked', '') - this._view.personal = yo`` + this._view.personal = yo`` if (this.config.get('settings/personal-mode')) this._view.personal.setAttribute('checked', '') - this._view.generateContractMetadata = yo`` + this._view.generateContractMetadata = yo`` if (this.config.get('settings/generate-contract-metadata')) this._view.generateContractMetadata.setAttribute('checked', '') @@ -89,14 +89,6 @@ module.exports = class SettingsTab extends ViewPlugin { this._view.themes = this._deps.themeModule.getThemes() this._view.themesCheckBoxes = this.createThemeCheckies() - this._view.config.homePage = yo` - -
-
-
Have a question?
- -
-
` const warnText = `Transaction sent over Web3 will use the web3.personal API - be sure the endpoint is opened before enabling it. This mode allows to provide the passphrase in the Remix interface without having to unlock the account. @@ -105,48 +97,47 @@ module.exports = class SettingsTab extends ViewPlugin { this._view.warnPersonalMode = yo`` this._view.config.general = yo` -
+
General settings
-
-
${this._view.generateContractMetadata}
- +
+ ${this._view.generateContractMetadata} +
-
-
${this._view.optionVM}
- +
+ ${this._view.optionVM} +
-
-
- +
+ +
-
-
${this._view.personal}>
- +
+ ${this._view.personal}> +
` this._view.gistToken = yo` -
+
Github Access Token

Manage the access token used to publish to Gist and retrieve Github contents.

Go to github token page (link below) to create a new token and save it in Remix. Make sure this token has only 'create gist' permission.

-

https://github.com/settings/tokens

-
${this._view.gistToken}
+

https://github.com/settings/tokens

+
${this._view.gistToken}
` this._view.config.themes = yo` -
+
Themes
${this._view.themesCheckBoxes}
` this._view.el = yo` -
- ${this._view.config.homePage} +
${this._view.config.general} ${this._view.gistToken} ${this._view.config.themes} diff --git a/apps/remix-ide/src/app/tabs/styles/settings-tab-styles.js b/apps/remix-ide/src/app/tabs/styles/settings-tab-styles.js index 3d80a30682..2ba10f7a29 100644 --- a/apps/remix-ide/src/app/tabs/styles/settings-tab-styles.js +++ b/apps/remix-ide/src/app/tabs/styles/settings-tab-styles.js @@ -70,6 +70,12 @@ const css = csjs` display: inline; width: 32%; } + .customCheckBox::before, .customCheckBox::after { + top: .7em + } + .text { + text-decoration: none; + } ` module.exports = css