mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add raised type buttons to Button component. Refactor all buttons within app to Button components
This commit is contained in:
parent
930dac110a
commit
31089778ba
@ -6,6 +6,7 @@ const CLASSNAME_DEFAULT = 'btn-default'
|
|||||||
const CLASSNAME_PRIMARY = 'btn-primary'
|
const CLASSNAME_PRIMARY = 'btn-primary'
|
||||||
const CLASSNAME_SECONDARY = 'btn-secondary'
|
const CLASSNAME_SECONDARY = 'btn-secondary'
|
||||||
const CLASSNAME_CONFIRM = 'btn-confirm'
|
const CLASSNAME_CONFIRM = 'btn-confirm'
|
||||||
|
const CLASSNAME_RAISED = 'btn-raised'
|
||||||
const CLASSNAME_LARGE = 'btn--large'
|
const CLASSNAME_LARGE = 'btn--large'
|
||||||
|
|
||||||
const typeHash = {
|
const typeHash = {
|
||||||
@ -13,6 +14,7 @@ const typeHash = {
|
|||||||
primary: CLASSNAME_PRIMARY,
|
primary: CLASSNAME_PRIMARY,
|
||||||
secondary: CLASSNAME_SECONDARY,
|
secondary: CLASSNAME_SECONDARY,
|
||||||
confirm: CLASSNAME_CONFIRM,
|
confirm: CLASSNAME_CONFIRM,
|
||||||
|
raised: CLASSNAME_RAISED,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Button extends Component {
|
export default class Button extends Component {
|
||||||
@ -20,7 +22,7 @@ export default class Button extends Component {
|
|||||||
type: PropTypes.string,
|
type: PropTypes.string,
|
||||||
large: PropTypes.bool,
|
large: PropTypes.bool,
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
children: PropTypes.string,
|
children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
@ -29,6 +31,7 @@ export default class Button extends Component {
|
|||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
className={classnames(
|
className={classnames(
|
||||||
|
'button',
|
||||||
typeHash[type],
|
typeHash[type],
|
||||||
large && CLASSNAME_LARGE,
|
large && CLASSNAME_LARGE,
|
||||||
className
|
className
|
||||||
|
@ -5,6 +5,7 @@ const inherits = require('util').inherits
|
|||||||
const connect = require('react-redux').connect
|
const connect = require('react-redux').connect
|
||||||
const actions = require('../../actions')
|
const actions = require('../../actions')
|
||||||
const GasModalCard = require('./gas-modal-card')
|
const GasModalCard = require('./gas-modal-card')
|
||||||
|
import Button from '../button'
|
||||||
|
|
||||||
const ethUtil = require('ethereumjs-util')
|
const ethUtil = require('ethereumjs-util')
|
||||||
|
|
||||||
@ -353,16 +354,16 @@ CustomizeGasModal.prototype.render = function () {
|
|||||||
}, [this.context.t('revert')]),
|
}, [this.context.t('revert')]),
|
||||||
|
|
||||||
h('div.send-v2__customize-gas__buttons', [
|
h('div.send-v2__customize-gas__buttons', [
|
||||||
h('button.btn-default.send-v2__customize-gas__cancel', {
|
h(Button, {
|
||||||
|
type: 'default',
|
||||||
|
className: 'send-v2__customize-gas__cancel',
|
||||||
onClick: this.props.hideModal,
|
onClick: this.props.hideModal,
|
||||||
style: {
|
|
||||||
marginRight: '10px',
|
|
||||||
},
|
|
||||||
}, [this.context.t('cancel')]),
|
}, [this.context.t('cancel')]),
|
||||||
|
h(Button, {
|
||||||
h('button.btn-primary.send-v2__customize-gas__save', {
|
type: 'primary',
|
||||||
|
className: 'send-v2__customize-gas__save',
|
||||||
onClick: () => !error && this.save(newGasPrice, gasLimit, gasTotal),
|
onClick: () => !error && this.save(newGasPrice, gasLimit, gasTotal),
|
||||||
className: error && 'btn-primary--disabled',
|
disabled: error,
|
||||||
}, [this.context.t('save')]),
|
}, [this.context.t('save')]),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
@ -10,6 +10,8 @@ const genAccountLink = require('../../../lib/account-link.js')
|
|||||||
const QrView = require('../qr-code')
|
const QrView = require('../qr-code')
|
||||||
const EditableLabel = require('../editable-label')
|
const EditableLabel = require('../editable-label')
|
||||||
|
|
||||||
|
import Button from '../button'
|
||||||
|
|
||||||
function mapStateToProps (state) {
|
function mapStateToProps (state) {
|
||||||
return {
|
return {
|
||||||
network: state.metamask.network,
|
network: state.metamask.network,
|
||||||
@ -80,12 +82,17 @@ AccountDetailsModal.prototype.render = function () {
|
|||||||
|
|
||||||
h('div.account-modal-divider'),
|
h('div.account-modal-divider'),
|
||||||
|
|
||||||
h('button.btn-primary.account-modal__button', {
|
h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
className: 'account-modal__button',
|
||||||
onClick: () => global.platform.openWindow({ url: genAccountLink(address, network) }),
|
onClick: () => global.platform.openWindow({ url: genAccountLink(address, network) }),
|
||||||
}, this.context.t('etherscanView')),
|
}, this.context.t('etherscanView')),
|
||||||
|
|
||||||
// Holding on redesign for Export Private Key functionality
|
// Holding on redesign for Export Private Key functionality
|
||||||
exportPrivateKeyFeatureEnabled ? h('button.btn-primary.account-modal__button', {
|
|
||||||
|
exportPrivateKeyFeatureEnabled ? h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
className: 'account-modal__button',
|
||||||
onClick: () => showExportPrivateKeyModal(),
|
onClick: () => showExportPrivateKeyModal(),
|
||||||
}, this.context.t('exportPrivateKey')) : null,
|
}, this.context.t('exportPrivateKey')) : null,
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ import React, { Component } from 'react'
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import GasModalCard from '../../customize-gas-modal/gas-modal-card'
|
import GasModalCard from '../../customize-gas-modal/gas-modal-card'
|
||||||
import { MIN_GAS_PRICE_GWEI } from '../../send/send.constants'
|
import { MIN_GAS_PRICE_GWEI } from '../../send/send.constants'
|
||||||
|
import Button from '../../button'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getDecimalGasLimit,
|
getDecimalGasLimit,
|
||||||
@ -116,21 +117,23 @@ export default class CustomizeGas extends Component {
|
|||||||
{ t('revert') }
|
{ t('revert') }
|
||||||
</div>
|
</div>
|
||||||
<div className="customize-gas__buttons">
|
<div className="customize-gas__buttons">
|
||||||
<button
|
<Button
|
||||||
className="btn-default customize-gas__cancel"
|
type="default"
|
||||||
|
className="customize-gas__cancel"
|
||||||
onClick={() => hideModal()}
|
onClick={() => hideModal()}
|
||||||
style={{ marginRight: '10px' }}
|
style={{ marginRight: '10px' }}
|
||||||
>
|
>
|
||||||
{ t('cancel') }
|
{ t('cancel') }
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
className="btn-primary customize-gas__save"
|
type="primary"
|
||||||
|
className="customize-gas__save"
|
||||||
onClick={() => this.handleSave()}
|
onClick={() => this.handleSave()}
|
||||||
style={{ marginRight: '10px' }}
|
style={{ marginRight: '10px' }}
|
||||||
disabled={!valid}
|
disabled={!valid}
|
||||||
>
|
>
|
||||||
{ t('save') }
|
{ t('save') }
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,6 +7,8 @@ const actions = require('../../actions')
|
|||||||
const { getNetworkDisplayName } = require('../../../../app/scripts/controllers/network/util')
|
const { getNetworkDisplayName } = require('../../../../app/scripts/controllers/network/util')
|
||||||
const ShapeshiftForm = require('../shapeshift-form')
|
const ShapeshiftForm = require('../shapeshift-form')
|
||||||
|
|
||||||
|
import Button from '../button'
|
||||||
|
|
||||||
let DIRECT_DEPOSIT_ROW_TITLE
|
let DIRECT_DEPOSIT_ROW_TITLE
|
||||||
let DIRECT_DEPOSIT_ROW_TEXT
|
let DIRECT_DEPOSIT_ROW_TEXT
|
||||||
let COINBASE_ROW_TITLE
|
let COINBASE_ROW_TITLE
|
||||||
@ -109,7 +111,10 @@ DepositEtherModal.prototype.renderRow = function ({
|
|||||||
]),
|
]),
|
||||||
|
|
||||||
!hideButton && h('div.deposit-ether-modal__buy-row__button', [
|
!hideButton && h('div.deposit-ether-modal__buy-row__button', [
|
||||||
h('button.btn-primary.btn--large.deposit-ether-modal__deposit-button', {
|
h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
className: 'deposit-ether-modal__deposit-button',
|
||||||
|
large: true,
|
||||||
onClick: onButtonClick,
|
onClick: onButtonClick,
|
||||||
}, [buttonLabel]),
|
}, [buttonLabel]),
|
||||||
]),
|
]),
|
||||||
|
@ -11,6 +11,7 @@ const { getSelectedIdentity } = require('../../selectors')
|
|||||||
const ReadOnlyInput = require('../readonly-input')
|
const ReadOnlyInput = require('../readonly-input')
|
||||||
const copyToClipboard = require('copy-to-clipboard')
|
const copyToClipboard = require('copy-to-clipboard')
|
||||||
const { checksumAddress } = require('../../util')
|
const { checksumAddress } = require('../../util')
|
||||||
|
import Button from '../button'
|
||||||
|
|
||||||
function mapStateToPropsFactory () {
|
function mapStateToPropsFactory () {
|
||||||
let selectedIdentity = null
|
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) {
|
ExportPrivateKeyModal.prototype.renderButtons = function (privateKey, password, address, hideModal) {
|
||||||
return h('div.export-private-key-buttons', {}, [
|
return h('div.export-private-key-buttons', {}, [
|
||||||
!privateKey && this.renderButton(
|
!privateKey && h(Button, {
|
||||||
'btn-default btn--large export-private-key__button export-private-key__button--cancel',
|
type: 'default',
|
||||||
() => hideModal(),
|
large: true,
|
||||||
'Cancel'
|
className: 'export-private-key__button export-private-key__button--cancel',
|
||||||
),
|
onClick: () => hideModal(),
|
||||||
|
}, this.context.t('cancel')),
|
||||||
|
|
||||||
(privateKey
|
(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'))
|
||||||
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
])
|
])
|
||||||
|
@ -3,6 +3,7 @@ const PropTypes = require('prop-types')
|
|||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
const genAccountLink = require('../../../../../lib/account-link.js')
|
const genAccountLink = require('../../../../../lib/account-link.js')
|
||||||
const Select = require('react-select').default
|
const Select = require('react-select').default
|
||||||
|
import Button from '../../../button'
|
||||||
|
|
||||||
class AccountList extends Component {
|
class AccountList extends Component {
|
||||||
constructor (props, context) {
|
constructor (props, context) {
|
||||||
@ -143,22 +144,20 @@ class AccountList extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return h('div.new-account-connect-form__buttons', {}, [
|
return h('div.new-account-connect-form__buttons', {}, [
|
||||||
h(
|
h(Button, {
|
||||||
'button.btn-default.btn--large.new-account-connect-form__button',
|
type: 'default',
|
||||||
{
|
large: true,
|
||||||
onClick: this.props.onCancel.bind(this),
|
className: 'new-account-connect-form__button',
|
||||||
},
|
onClick: this.props.onCancel.bind(this),
|
||||||
[this.context.t('cancel')]
|
}, [this.context.t('cancel')]),
|
||||||
),
|
|
||||||
|
|
||||||
h(
|
h(Button, {
|
||||||
`button.btn-primary.btn--large.new-account-connect-form__button.unlock ${disabled ? '.btn-primary--disabled' : ''}`,
|
type: 'primary',
|
||||||
{
|
large: true,
|
||||||
onClick: this.props.onUnlockAccount.bind(this, this.props.device),
|
className: 'new-account-connect-form__button unlock',
|
||||||
...buttonProps,
|
disabled,
|
||||||
},
|
onClick: this.props.onUnlockAccount.bind(this, this.props.device),
|
||||||
[this.context.t('unlock')]
|
}, [this.context.t('unlock')]),
|
||||||
),
|
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const { Component } = require('react')
|
const { Component } = require('react')
|
||||||
const PropTypes = require('prop-types')
|
const PropTypes = require('prop-types')
|
||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
|
import Button from '../../../button'
|
||||||
|
|
||||||
class ConnectScreen extends Component {
|
class ConnectScreen extends Component {
|
||||||
constructor (props, context) {
|
constructor (props, context) {
|
||||||
@ -60,13 +61,13 @@ class ConnectScreen extends Component {
|
|||||||
h('h3.hw-connect__title', {}, this.context.t('browserNotSupported')),
|
h('h3.hw-connect__title', {}, this.context.t('browserNotSupported')),
|
||||||
h('p.hw-connect__msg', {}, this.context.t('chromeRequiredForHardwareWallets')),
|
h('p.hw-connect__msg', {}, this.context.t('chromeRequiredForHardwareWallets')),
|
||||||
]),
|
]),
|
||||||
h(
|
h(Button, {
|
||||||
'button.btn-primary.btn--large',
|
type: 'primary',
|
||||||
{
|
large: true,
|
||||||
onClick: () => global.platform.openWindow({
|
onClick: () => global.platform.openWindow({
|
||||||
url: 'https://google.com/chrome',
|
url: 'https://google.com/chrome',
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
this.context.t('downloadGoogleChrome')
|
this.context.t('downloadGoogleChrome')
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,7 @@ const actions = require('../../../../actions')
|
|||||||
const FileInput = require('react-simple-file-input').default
|
const FileInput = require('react-simple-file-input').default
|
||||||
const { DEFAULT_ROUTE } = require('../../../../routes')
|
const { DEFAULT_ROUTE } = require('../../../../routes')
|
||||||
const HELP_LINK = 'https://support.metamask.io/kb/article/7-importing-accounts'
|
const HELP_LINK = 'https://support.metamask.io/kb/article/7-importing-accounts'
|
||||||
|
import Button from '../../../button'
|
||||||
|
|
||||||
class JsonImportSubview extends Component {
|
class JsonImportSubview extends Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@ -51,17 +52,19 @@ class JsonImportSubview extends Component {
|
|||||||
|
|
||||||
h('div.new-account-create-form__buttons', {}, [
|
h('div.new-account-create-form__buttons', {}, [
|
||||||
|
|
||||||
h('button.btn-default.new-account-create-form__button', {
|
h(Button, {
|
||||||
|
type: 'default',
|
||||||
|
large: true,
|
||||||
|
className: 'new-account-create-form__button',
|
||||||
onClick: () => this.props.history.push(DEFAULT_ROUTE),
|
onClick: () => this.props.history.push(DEFAULT_ROUTE),
|
||||||
}, [
|
}, [this.context.t('cancel')]),
|
||||||
this.context.t('cancel'),
|
|
||||||
]),
|
|
||||||
|
|
||||||
h('button.btn-primary.new-account-create-form__button', {
|
h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
large: true,
|
||||||
|
className: 'new-account-create-form__button',
|
||||||
onClick: () => this.createNewKeychain(),
|
onClick: () => this.createNewKeychain(),
|
||||||
}, [
|
}, [this.context.t('import')]),
|
||||||
this.context.t('import'),
|
|
||||||
]),
|
|
||||||
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ const PropTypes = require('prop-types')
|
|||||||
const connect = require('react-redux').connect
|
const connect = require('react-redux').connect
|
||||||
const actions = require('../../../../actions')
|
const actions = require('../../../../actions')
|
||||||
const { DEFAULT_ROUTE } = require('../../../../routes')
|
const { DEFAULT_ROUTE } = require('../../../../routes')
|
||||||
|
import Button from '../../../button'
|
||||||
|
|
||||||
PrivateKeyImportView.contextTypes = {
|
PrivateKeyImportView.contextTypes = {
|
||||||
t: PropTypes.func,
|
t: PropTypes.func,
|
||||||
@ -61,20 +62,22 @@ PrivateKeyImportView.prototype.render = function () {
|
|||||||
|
|
||||||
h('div.new-account-import-form__buttons', {}, [
|
h('div.new-account-import-form__buttons', {}, [
|
||||||
|
|
||||||
h('button.btn-default.btn--large.new-account-create-form__button', {
|
h(Button, {
|
||||||
|
type: 'default',
|
||||||
|
large: true,
|
||||||
|
className: 'new-account-create-form__button',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
displayWarning(null)
|
displayWarning(null)
|
||||||
this.props.history.push(DEFAULT_ROUTE)
|
this.props.history.push(DEFAULT_ROUTE)
|
||||||
},
|
},
|
||||||
}, [
|
}, [this.context.t('cancel')]),
|
||||||
this.context.t('cancel'),
|
|
||||||
]),
|
|
||||||
|
|
||||||
h('button.btn-primary.btn--large.new-account-create-form__button', {
|
h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
large: true,
|
||||||
|
className: 'new-account-create-form__button',
|
||||||
onClick: () => this.createNewKeychain(),
|
onClick: () => this.createNewKeychain(),
|
||||||
}, [
|
}, [this.context.t('import')]),
|
||||||
this.context.t('import'),
|
|
||||||
]),
|
|
||||||
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ const h = require('react-hyperscript')
|
|||||||
const connect = require('react-redux').connect
|
const connect = require('react-redux').connect
|
||||||
const actions = require('../../../actions')
|
const actions = require('../../../actions')
|
||||||
const { DEFAULT_ROUTE } = require('../../../routes')
|
const { DEFAULT_ROUTE } = require('../../../routes')
|
||||||
|
import Button from '../../button'
|
||||||
|
|
||||||
class NewAccountCreateForm extends Component {
|
class NewAccountCreateForm extends Component {
|
||||||
constructor (props, context) {
|
constructor (props, context) {
|
||||||
@ -38,20 +39,22 @@ class NewAccountCreateForm extends Component {
|
|||||||
|
|
||||||
h('div.new-account-create-form__buttons', {}, [
|
h('div.new-account-create-form__buttons', {}, [
|
||||||
|
|
||||||
h('button.btn-default.btn--large.new-account-create-form__button', {
|
h(Button, {
|
||||||
|
type: 'default',
|
||||||
|
large: true,
|
||||||
|
className: 'new-account-create-form__button',
|
||||||
onClick: () => history.push(DEFAULT_ROUTE),
|
onClick: () => history.push(DEFAULT_ROUTE),
|
||||||
}, [
|
}, [this.context.t('cancel')]),
|
||||||
this.context.t('cancel'),
|
|
||||||
]),
|
|
||||||
|
|
||||||
h('button.btn-primary.btn--large.new-account-create-form__button', {
|
h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
large: true,
|
||||||
|
className:'new-account-create-form__button',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
createAccount(newAccountName || defaultAccountName)
|
createAccount(newAccountName || defaultAccountName)
|
||||||
.then(() => history.push(DEFAULT_ROUTE))
|
.then(() => history.push(DEFAULT_ROUTE))
|
||||||
},
|
},
|
||||||
}, [
|
}, [this.context.t('create')]),
|
||||||
this.context.t('create'),
|
|
||||||
]),
|
|
||||||
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ const { requestRevealSeedWords } = require('../../../actions')
|
|||||||
const { DEFAULT_ROUTE } = require('../../../routes')
|
const { DEFAULT_ROUTE } = require('../../../routes')
|
||||||
const ExportTextContainer = require('../../export-text-container')
|
const ExportTextContainer = require('../../export-text-container')
|
||||||
|
|
||||||
|
import Button from '../../button'
|
||||||
|
|
||||||
const PASSWORD_PROMPT_SCREEN = 'PASSWORD_PROMPT_SCREEN'
|
const PASSWORD_PROMPT_SCREEN = 'PASSWORD_PROMPT_SCREEN'
|
||||||
const REVEAL_SEED_SCREEN = 'REVEAL_SEED_SCREEN'
|
const REVEAL_SEED_SCREEN = 'REVEAL_SEED_SCREEN'
|
||||||
|
|
||||||
@ -106,10 +108,16 @@ class RevealSeedPage extends Component {
|
|||||||
renderPasswordPromptFooter () {
|
renderPasswordPromptFooter () {
|
||||||
return (
|
return (
|
||||||
h('.page-container__footer', [
|
h('.page-container__footer', [
|
||||||
h('button.btn-default.btn--large.page-container__footer-button', {
|
h(Button, {
|
||||||
|
type: 'default',
|
||||||
|
large: true,
|
||||||
|
className: 'page-container__footer-button',
|
||||||
onClick: () => this.props.history.push(DEFAULT_ROUTE),
|
onClick: () => this.props.history.push(DEFAULT_ROUTE),
|
||||||
}, this.context.t('cancel')),
|
}, this.context.t('cancel')),
|
||||||
h('button.btn-primary.btn--large.page-container__footer-button', {
|
h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
large: true,
|
||||||
|
className: 'page-container__footer-button',
|
||||||
onClick: event => this.handleSubmit(event),
|
onClick: event => this.handleSubmit(event),
|
||||||
disabled: this.state.password === '',
|
disabled: this.state.password === '',
|
||||||
}, this.context.t('next')),
|
}, this.context.t('next')),
|
||||||
@ -120,7 +128,10 @@ class RevealSeedPage extends Component {
|
|||||||
renderRevealSeedFooter () {
|
renderRevealSeedFooter () {
|
||||||
return (
|
return (
|
||||||
h('.page-container__footer', [
|
h('.page-container__footer', [
|
||||||
h('button.btn-default.btn--large.page-container__footer-button', {
|
h(Button, {
|
||||||
|
type: 'default',
|
||||||
|
large: true,
|
||||||
|
className: 'page-container__footer-button',
|
||||||
onClick: () => this.props.history.push(DEFAULT_ROUTE),
|
onClick: () => this.props.history.push(DEFAULT_ROUTE),
|
||||||
}, this.context.t('close')),
|
}, this.context.t('close')),
|
||||||
])
|
])
|
||||||
|
@ -13,6 +13,8 @@ const ToggleButton = require('react-toggle-button')
|
|||||||
const { REVEAL_SEED_ROUTE } = require('../../../routes')
|
const { REVEAL_SEED_ROUTE } = require('../../../routes')
|
||||||
const locales = require('../../../../../app/_locales/index.json')
|
const locales = require('../../../../../app/_locales/index.json')
|
||||||
|
|
||||||
|
import Button from '../../button'
|
||||||
|
|
||||||
const getInfuraCurrencyOptions = () => {
|
const getInfuraCurrencyOptions = () => {
|
||||||
const sortedCurrencies = infuraCurrencies.objects.sort((a, b) => {
|
const sortedCurrencies = infuraCurrencies.objects.sort((a, b) => {
|
||||||
return a.quote.name.toLocaleLowerCase().localeCompare(b.quote.name.toLocaleLowerCase())
|
return a.quote.name.toLocaleLowerCase().localeCompare(b.quote.name.toLocaleLowerCase())
|
||||||
@ -241,7 +243,10 @@ class Settings extends Component {
|
|||||||
]),
|
]),
|
||||||
h('div.settings__content-item', [
|
h('div.settings__content-item', [
|
||||||
h('div.settings__content-item-col', [
|
h('div.settings__content-item-col', [
|
||||||
h('button.btn-primary.btn--large.settings__button', {
|
h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
large: true,
|
||||||
|
className: 'settings__button',
|
||||||
onClick (event) {
|
onClick (event) {
|
||||||
window.logStateString((err, result) => {
|
window.logStateString((err, result) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -266,7 +271,10 @@ class Settings extends Component {
|
|||||||
h('div.settings__content-item', this.context.t('revealSeedWords')),
|
h('div.settings__content-item', this.context.t('revealSeedWords')),
|
||||||
h('div.settings__content-item', [
|
h('div.settings__content-item', [
|
||||||
h('div.settings__content-item-col', [
|
h('div.settings__content-item-col', [
|
||||||
h('button.btn-primary.btn--large.settings__button--red', {
|
h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
large: true,
|
||||||
|
className: 'settings__button--red',
|
||||||
onClick: event => {
|
onClick: event => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
history.push(REVEAL_SEED_ROUTE)
|
history.push(REVEAL_SEED_ROUTE)
|
||||||
@ -286,7 +294,10 @@ class Settings extends Component {
|
|||||||
h('div.settings__content-item', this.context.t('useOldUI')),
|
h('div.settings__content-item', this.context.t('useOldUI')),
|
||||||
h('div.settings__content-item', [
|
h('div.settings__content-item', [
|
||||||
h('div.settings__content-item-col', [
|
h('div.settings__content-item-col', [
|
||||||
h('button.btn-primary.btn--large.settings__button--orange', {
|
h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
large: true,
|
||||||
|
className: 'settings__button--orange',
|
||||||
onClick (event) {
|
onClick (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
setFeatureFlagToBeta()
|
setFeatureFlagToBeta()
|
||||||
@ -305,7 +316,10 @@ class Settings extends Component {
|
|||||||
h('div.settings__content-item', this.context.t('resetAccount')),
|
h('div.settings__content-item', this.context.t('resetAccount')),
|
||||||
h('div.settings__content-item', [
|
h('div.settings__content-item', [
|
||||||
h('div.settings__content-item-col', [
|
h('div.settings__content-item-col', [
|
||||||
h('button.btn-primary.btn--large.settings__button--orange', {
|
h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
large: true,
|
||||||
|
className: 'settings__button--orange',
|
||||||
onClick (event) {
|
onClick (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
showResetAccountConfirmationModal()
|
showResetAccountConfirmationModal()
|
||||||
|
@ -9,6 +9,8 @@ const { shapeShiftSubview, pairUpdate, buyWithShapeShift } = require('../actions
|
|||||||
const { isValidAddress } = require('../util')
|
const { isValidAddress } = require('../util')
|
||||||
const SimpleDropdown = require('./dropdowns/simple-dropdown')
|
const SimpleDropdown = require('./dropdowns/simple-dropdown')
|
||||||
|
|
||||||
|
import Button from './button'
|
||||||
|
|
||||||
function mapStateToProps (state) {
|
function mapStateToProps (state) {
|
||||||
const {
|
const {
|
||||||
coinOptions,
|
coinOptions,
|
||||||
@ -242,8 +244,10 @@ ShapeshiftForm.prototype.render = function () {
|
|||||||
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
!depositAddress && h('button.btn-primary.btn--large.shapeshift-form__shapeshift-buy-btn', {
|
!depositAddress && h(Button, {
|
||||||
className: btnClass,
|
type: 'primary',
|
||||||
|
large: true,
|
||||||
|
className: `${btnClass} shapeshift-form__shapeshift-buy-btn`,
|
||||||
disabled: !token,
|
disabled: !token,
|
||||||
onClick: () => this.onBuyWithShapeShift(),
|
onClick: () => this.onBuyWithShapeShift(),
|
||||||
}, [this.context.t('buy')]),
|
}, [this.context.t('buy')]),
|
||||||
|
@ -23,6 +23,7 @@ const {
|
|||||||
} = require('../selectors.js')
|
} = require('../selectors.js')
|
||||||
|
|
||||||
import { clearConfirmTransaction } from '../ducks/confirm-transaction.duck'
|
import { clearConfirmTransaction } from '../ducks/confirm-transaction.duck'
|
||||||
|
import Button from './button'
|
||||||
|
|
||||||
const { DEFAULT_ROUTE } = require('../routes')
|
const { DEFAULT_ROUTE } = require('../routes')
|
||||||
|
|
||||||
@ -248,7 +249,10 @@ SignatureRequest.prototype.renderFooter = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return h('div.request-signature__footer', [
|
return h('div.request-signature__footer', [
|
||||||
h('button.btn-default.btn--large.request-signature__footer__cancel-button', {
|
h(Button, {
|
||||||
|
type: 'default',
|
||||||
|
large: true,
|
||||||
|
className: 'request-signature__footer__cancel-button',
|
||||||
onClick: event => {
|
onClick: event => {
|
||||||
cancel(event).then(() => {
|
cancel(event).then(() => {
|
||||||
this.props.clearConfirmTransaction()
|
this.props.clearConfirmTransaction()
|
||||||
@ -256,7 +260,9 @@ SignatureRequest.prototype.renderFooter = function () {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
}, this.context.t('cancel')),
|
}, this.context.t('cancel')),
|
||||||
h('button.btn-primary.btn--large', {
|
h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
large: true,
|
||||||
onClick: event => {
|
onClick: event => {
|
||||||
sign(event).then(() => {
|
sign(event).then(() => {
|
||||||
this.props.clearConfirmTransaction()
|
this.props.clearConfirmTransaction()
|
||||||
|
@ -17,6 +17,8 @@ const TokenList = require('./token-list')
|
|||||||
const selectors = require('../selectors')
|
const selectors = require('../selectors')
|
||||||
const { ADD_TOKEN_ROUTE } = require('../routes')
|
const { ADD_TOKEN_ROUTE } = require('../routes')
|
||||||
|
|
||||||
|
import Button from './button'
|
||||||
|
|
||||||
module.exports = compose(
|
module.exports = compose(
|
||||||
withRouter,
|
withRouter,
|
||||||
connect(mapStateToProps, mapDispatchToProps)
|
connect(mapStateToProps, mapDispatchToProps)
|
||||||
@ -199,7 +201,9 @@ WalletView.prototype.render = function () {
|
|||||||
|
|
||||||
h(TokenList),
|
h(TokenList),
|
||||||
|
|
||||||
h('button.btn-primary.wallet-view__add-token-button', {
|
h(Button, {
|
||||||
|
type: 'primary',
|
||||||
|
className: 'wallet-view__add-token-button',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
history.push(ADD_TOKEN_ROUTE)
|
history.push(ADD_TOKEN_ROUTE)
|
||||||
sidebarOpen && hideSidebar()
|
sidebarOpen && hideSidebar()
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
Buttons
|
Buttons
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.btn-default,
|
.button {
|
||||||
.btn-primary,
|
|
||||||
.btn-secondary,
|
|
||||||
.btn-confirm {
|
|
||||||
height: 44px;
|
height: 44px;
|
||||||
background: $white;
|
background: $white;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -79,6 +76,16 @@
|
|||||||
background-color: $curious-blue;
|
background-color: $curious-blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-raised {
|
||||||
|
color: $curious-blue;
|
||||||
|
background-color: $white;
|
||||||
|
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.08);
|
||||||
|
padding: 6px;
|
||||||
|
height: initial;
|
||||||
|
width: initial;
|
||||||
|
min-width: initial;
|
||||||
|
}
|
||||||
|
|
||||||
.btn--large {
|
.btn--large {
|
||||||
height: 54px;
|
height: 54px;
|
||||||
}
|
}
|
||||||
|
@ -833,6 +833,10 @@
|
|||||||
line-height: 12px;
|
line-height: 12px;
|
||||||
color: $red;
|
color: $red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__cancel {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__gas-modal-card {
|
&__gas-modal-card {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user