UX update for buttons for plugin tab

pull/1/head
Rob Stupay 7 years ago committed by yann300
parent 8bfd802f08
commit 9b539e9951
  1. 41
      src/app/tabs/settings-tab.js
  2. 5
      src/app/ui/styles-guide/style-guide.js
  3. 12
      src/app/ui/styles-guide/styleGuideDark.js

@ -7,7 +7,6 @@ var globalRegistry = require('../../global/registry')
var tooltip = require('../ui/tooltip') var tooltip = require('../ui/tooltip')
var copyToClipboard = require('../ui/copy-to-clipboard') var copyToClipboard = require('../ui/copy-to-clipboard')
var styleGuide = require('../ui/styles-guide/theme-chooser') var styleGuide = require('../ui/styles-guide/theme-chooser')
var styles = styleGuide.chooser() var styles = styleGuide.chooser()
var Storage = remixLib.Storage var Storage = remixLib.Storage
var EventManager = remixLib.EventManager var EventManager = remixLib.EventManager
@ -117,12 +116,12 @@ module.exports = class SettingsTab {
<div class="${css.crowNoFlex}"> <div class="${css.crowNoFlex}">
<div>Load plugin from JSON description: </div> <div>Load plugin from JSON description: </div>
${self._view.pluginInput} ${self._view.pluginInput}
<input onclick=${onloadPluginJson} type="button" value="Load" class="${css.pluginLoad}"> <input onclick=${onloadPluginJson} type="button" value="Load" class="${css.initPlugin}">
${self._view.config.plugins} ${self._view.config.plugins}
</div> </div>
</div>` </div>`
self._view.el = yo` self._view.el = yo`
<div class="${css.settingsTabView} "id="settingsView"> <div class="${css.settingsTabView}" id="settingsView">
${self._view.config.general} ${self._view.config.general}
${self._view.config.plugin} ${self._view.config.plugin}
${self._view.gistToken} ${self._view.gistToken}
@ -135,8 +134,8 @@ module.exports = class SettingsTab {
if (!self._view.plugins[plugin.title]) self._view.plugins[plugin.title] = {} if (!self._view.plugins[plugin.title]) self._view.plugins[plugin.title] = {}
self._view.plugins[plugin.title].json = plugin self._view.plugins[plugin.title].json = plugin
self._view.plugins[plugin.title].el = yo`<div class="${css.pluginLoad}"> self._view.plugins[plugin.title].el = yo`<div class="${css.pluginLoad}">
<div style="display: inline-block" onclick=${() => { onLoadPlugin(plugin.title) }}>${plugin.title}</div> <div class="${css.aPlugin}" onclick=${() => { onLoadPlugin(plugin.title) }}>${plugin.title}</div>
${opt.removable ? yo`<span class="removePlugin" onclick=${() => { onRemovePlugin(plugin.title) }}><i class="fa fa-close"></i></span>` : yo`<span></span>`} ${opt.removable ? yo`<span class="${css.removePlugin}" onclick=${() => { onRemovePlugin(plugin.title) }}><i class="fa fa-close"></i></span>` : yo`<span></span>`}
</div>` </div>`
self._view.config.plugins.appendChild(self._view.plugins[plugin.title].el) self._view.config.plugins.appendChild(self._view.plugins[plugin.title].el)
} }
@ -255,6 +254,15 @@ const css = csjs`
width: inherit; width: inherit;
display: inline-block; display: inline-block;
} }
.initPlugin {
vertical-align: top;
${styles.rightPanel.settingsTab.button_initPlugin};
width: inherit;
display: block;
max-height: inherit;
padding:7px;
}
.removePlugin { .removePlugin {
cursor: pointer; cursor: pointer;
} }
@ -267,4 +275,27 @@ const css = csjs`
.savegisttoken { .savegisttoken {
margin-left: 5px; margin-left: 5px;
} }
.aPlugin {
display: inline-block;
padding-left: 10px;
padding-top: 4px;
padding-bottom: 6px;
max-width: 100px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
vertical-align: middle;
}
.pluginLoad {
vertical-align: top;
max-height: inherit;
margin: 2px;
}
.removePlugin{
padding-left: 7px;
padding-right: 7px;
border-left: 2px solid ${styles.appProperties.primary_BackgroundColor};
margin-left: 10px;
}
` `

@ -701,6 +701,11 @@ function styleGuide () {
BackgroundColor: appProperties.secondaryButton_BackgroundColor, BackgroundColor: appProperties.secondaryButton_BackgroundColor,
BorderColor: appProperties.secondaryButton_BorderColor, BorderColor: appProperties.secondaryButton_BorderColor,
Color: appProperties.secondaryButton_TextColor Color: appProperties.secondaryButton_TextColor
}),
button_initPlugin: appProperties.uiElements.button({
BackgroundColor: appProperties.transactButton_BackgroundColor,
BorderColor: appProperties.transactButton_BorderColor,
Color: appProperties.secondaryButton_TextColor
}) })
}, },

@ -684,6 +684,18 @@ function styleGuideDark () {
BackgroundColor: appProperties.dropdown_BackgroundColor, BackgroundColor: appProperties.dropdown_BackgroundColor,
BorderColor: appProperties.dropdown_BorderColor, BorderColor: appProperties.dropdown_BorderColor,
Color: appProperties.dropdown_TextColor Color: appProperties.dropdown_TextColor
}),
button_LoadPlugin: appProperties.uiElements.button({
BackgroundColor: appProperties.secondaryButton_BackgroundColor,
BorderColor: appProperties.secondaryButton_BorderColor,
Color: appProperties.secondaryButton_TextColor
}),
button_initPlugin: appProperties.uiElements.button({
BackgroundColor: appProperties.transactButton_BackgroundColor,
BorderColor: appProperties.transactButton_BorderColor,
Color: appProperties.secondaryButton_TextColor
}) })
}, },

Loading…
Cancel
Save