aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/button/button.component.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-06-02 07:03:56 +0800
committerGitHub <noreply@github.com>2018-06-02 07:03:56 +0800
commit4be8e780cd64014d07c036c29faa77f947437c4a (patch)
tree37c76b1bbad225adc70f45a8fd17e8718e2b6453 /ui/app/components/button/button.component.js
parentdc5477be3cc62dff912a9447c702edab66200f02 (diff)
parentb1b90a6bb979cbda8b865e680dba621201d9f801 (diff)
downloadtangerine-wallet-browser-4be8e780cd64014d07c036c29faa77f947437c4a.tar.gz
tangerine-wallet-browser-4be8e780cd64014d07c036c29faa77f947437c4a.tar.zst
tangerine-wallet-browser-4be8e780cd64014d07c036c29faa77f947437c4a.zip
Merge pull request #4449 from MetaMask/Version-4.7.1
Version 4.7.1
Diffstat (limited to 'ui/app/components/button/button.component.js')
-rw-r--r--ui/app/components/button/button.component.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/ui/app/components/button/button.component.js b/ui/app/components/button/button.component.js
index fe3bf363c..e8e798445 100644
--- a/ui/app/components/button/button.component.js
+++ b/ui/app/components/button/button.component.js
@@ -2,20 +2,15 @@ import React, { Component } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
-const SECONDARY = 'secondary'
+const CLASSNAME_DEFAULT = 'btn-default'
const CLASSNAME_PRIMARY = 'btn-primary'
-const CLASSNAME_PRIMARY_LARGE = 'btn-primary--lg'
const CLASSNAME_SECONDARY = 'btn-secondary'
-const CLASSNAME_SECONDARY_LARGE = 'btn-secondary--lg'
+const CLASSNAME_LARGE = 'btn--large'
-const getClassName = (type, large = false) => {
- let output = type === SECONDARY ? CLASSNAME_SECONDARY : CLASSNAME_PRIMARY
-
- if (large) {
- output += ` ${type === SECONDARY ? CLASSNAME_SECONDARY_LARGE : CLASSNAME_PRIMARY_LARGE}`
- }
-
- return output
+const typeHash = {
+ default: CLASSNAME_DEFAULT,
+ primary: CLASSNAME_PRIMARY,
+ secondary: CLASSNAME_SECONDARY,
}
class Button extends Component {
@@ -24,7 +19,11 @@ class Button extends Component {
return (
<button
- className={classnames(getClassName(type, large), className)}
+ className={classnames(
+ typeHash[type],
+ large && CLASSNAME_LARGE,
+ className
+ )}
{ ...buttonProps }
>
{ this.props.children }