aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/button/button.component.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-01 01:58:03 +0800
committerDan <danjm.com@gmail.com>2018-06-01 01:58:03 +0800
commit5091b03e4b2499697cda376a44405139827068cd (patch)
treeda91af2a0ce21871c15611f768f09757ef2c8533 /ui/app/components/button/button.component.js
parent6d8344d0d0af3734255a0e9e79d857d84b5fe2aa (diff)
parentcc73d869fed79c63261821fb7ad8f1e5180ffca2 (diff)
downloadtangerine-wallet-browser-5091b03e4b2499697cda376a44405139827068cd.tar.gz
tangerine-wallet-browser-5091b03e4b2499697cda376a44405139827068cd.tar.zst
tangerine-wallet-browser-5091b03e4b2499697cda376a44405139827068cd.zip
Merge branch 'develop' into i3725-refactor-send-component-
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 }