aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/custom-radio-list.js
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2017-04-19 00:21:24 +0800
committerfrankiebee <frankie.diamond@gmail.com>2017-04-19 05:22:17 +0800
commitce03b7db51570295c7868382cf997dbb1bc5725a (patch)
treeef0a79a8aff59253de4fa6f6406cf3695f38ca41 /ui/app/components/custom-radio-list.js
parent83811910c84342094be4ac94dca829e8f5ff630f (diff)
downloadtangerine-wallet-browser-ce03b7db51570295c7868382cf997dbb1bc5725a.tar.gz
tangerine-wallet-browser-ce03b7db51570295c7868382cf997dbb1bc5725a.tar.zst
tangerine-wallet-browser-ce03b7db51570295c7868382cf997dbb1bc5725a.zip
Initial redo attempt of the buy view to look like vladt's desighn
Diffstat (limited to 'ui/app/components/custom-radio-list.js')
-rw-r--r--ui/app/components/custom-radio-list.js49
1 files changed, 24 insertions, 25 deletions
diff --git a/ui/app/components/custom-radio-list.js b/ui/app/components/custom-radio-list.js
index 201ec11dc..a19287630 100644
--- a/ui/app/components/custom-radio-list.js
+++ b/ui/app/components/custom-radio-list.js
@@ -11,12 +11,11 @@ function RadioList () {
RadioList.prototype.render = function () {
const props = this.props
- let activeClass = '.custom-radio-selected'
- let inactiveClass = '.custom-radio-inactive'
- let {
+ const activeClass = '.custom-radio-selected'
+ const inactiveClass = '.custom-radio-inactive'
+ const {
lables,
defaultFocus,
- onClick,
} = props
@@ -24,37 +23,37 @@ RadioList.prototype.render = function () {
h('.flex-row', {
style: {
fontSize: '12px',
- }
+ },
}, [
- h('.flex-column.custom-radios', {
- style: {
- marginRight: '5px',
- }
+ h('.flex-column.custom-radios', {
+ style: {
+ marginRight: '5px',
},
- lables.map((lable, i) => {
- let isSelcted = (this.state !== null )
- isSelcted = isSelcted ? (this.state.selected === lable) : (this.props.defaultFocus === lable)
- return h(isSelcted ? activeClass : inactiveClass, {
- title: lable,
- onClick: (event) => {
- this.setState({selected: event.target.title})
- props.onClick(event)
- }
- })
- }),
- ),
- h('.text', {},
- lables.map((lable) => {
+ },
+ lables.map((lable, i) => {
+ let isSelcted = (this.state !== null)
+ isSelcted = isSelcted ? (this.state.selected === lable) : (defaultFocus === lable)
+ return h(isSelcted ? activeClass : inactiveClass, {
+ title: lable,
+ onClick: (event) => {
+ this.setState({selected: event.target.title})
+ props.onClick(event)
+ },
+ })
+ })
+ ),
+ h('.text', {},
+ lables.map((lable) => {
if (props.subtext) {
return h('.flex-row', {}, [
h('.radio-titles', lable),
- h('.radio-titles-subtext', `- ${props.subtext[lable]}`)
+ h('.radio-titles-subtext', `- ${props.subtext[lable]}`),
])
} else {
return h('.radio-titles', lable)
}
})
- )
+ ),
])
)
}