aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/modals/export-private-key-modal.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-08-28 11:58:40 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-09-13 10:48:51 +0800
commit31089778ba3c97443e25bd3a7a901f45757894d9 (patch)
tree4bb099da7f7cbfe65a49f3a61d3000668d077e61 /ui/app/components/modals/export-private-key-modal.js
parent930dac110aa9127380673e119b0eaab9d45b1198 (diff)
downloadtangerine-wallet-browser-31089778ba3c97443e25bd3a7a901f45757894d9.tar
tangerine-wallet-browser-31089778ba3c97443e25bd3a7a901f45757894d9.tar.gz
tangerine-wallet-browser-31089778ba3c97443e25bd3a7a901f45757894d9.tar.bz2
tangerine-wallet-browser-31089778ba3c97443e25bd3a7a901f45757894d9.tar.lz
tangerine-wallet-browser-31089778ba3c97443e25bd3a7a901f45757894d9.tar.xz
tangerine-wallet-browser-31089778ba3c97443e25bd3a7a901f45757894d9.tar.zst
tangerine-wallet-browser-31089778ba3c97443e25bd3a7a901f45757894d9.zip
Add raised type buttons to Button component. Refactor all buttons within app to Button components
Diffstat (limited to 'ui/app/components/modals/export-private-key-modal.js')
-rw-r--r--ui/app/components/modals/export-private-key-modal.js36
1 files changed, 22 insertions, 14 deletions
diff --git a/ui/app/components/modals/export-private-key-modal.js b/ui/app/components/modals/export-private-key-modal.js
index 60a416304..d3e3c9a56 100644
--- a/ui/app/components/modals/export-private-key-modal.js
+++ b/ui/app/components/modals/export-private-key-modal.js
@@ -11,6 +11,7 @@ const { getSelectedIdentity } = require('../../selectors')
const ReadOnlyInput = require('../readonly-input')
const copyToClipboard = require('copy-to-clipboard')
const { checksumAddress } = require('../../util')
+import Button from '../button'
function mapStateToPropsFactory () {
let selectedIdentity = null
@@ -97,24 +98,31 @@ ExportPrivateKeyModal.prototype.renderPasswordInput = function (privateKey) {
})
}
-ExportPrivateKeyModal.prototype.renderButton = function (className, onClick, label) {
- return h('button', {
- className,
- onClick,
- }, label)
-}
-
ExportPrivateKeyModal.prototype.renderButtons = function (privateKey, password, address, hideModal) {
return h('div.export-private-key-buttons', {}, [
- !privateKey && this.renderButton(
- 'btn-default btn--large export-private-key__button export-private-key__button--cancel',
- () => hideModal(),
- 'Cancel'
- ),
+ !privateKey && h(Button, {
+ type: 'default',
+ large: true,
+ className: 'export-private-key__button export-private-key__button--cancel',
+ onClick: () => hideModal(),
+ }, this.context.t('cancel')),
(privateKey
- ? this.renderButton('btn-primary btn--large export-private-key__button', () => hideModal(), this.context.t('done'))
- : this.renderButton('btn-primary btn--large export-private-key__button', () => this.exportAccountAndGetPrivateKey(this.state.password, address), this.context.t('confirm'))
+ ? (
+ h(Button, {
+ type: 'primary',
+ large: true,
+ className: 'export-private-key__button',
+ onClick: () => hideModal(),
+ }, this.context.t('done'))
+ ) : (
+ h(Button, {
+ type: 'primary',
+ large: true,
+ className: 'export-private-key__button',
+ onClick: () => this.exportAccountAndGetPrivateKey(this.state.password, address),
+ }, this.context.t('confirm'))
+ )
),
])