Skip to content

Commit

Permalink
Convert FiatValue component to JSX
Browse files Browse the repository at this point in the history
  • Loading branch information
whymarrh committed Nov 23, 2019
1 parent c775a84 commit df8ca7a
Showing 1 changed file with 33 additions and 27 deletions.
60 changes: 33 additions & 27 deletions ui/app/components/ui/fiat-value.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const Component = require('react').Component
const h = require('react-hyperscript')
import React, { Component } from 'react'
const inherits = require('util').inherits
const formatBalance = require('../../helpers/utils/util').formatBalance

Expand Down Expand Up @@ -38,31 +37,38 @@ function fiatDisplay (fiatDisplayNumber, fiatSuffix, styleOveride = {}) {
const { fontSize, color, fontFamily, lineHeight } = styleOveride

if (fiatDisplayNumber !== 'N/A') {
return h('.flex-row', {
style: {
alignItems: 'flex-end',
lineHeight: lineHeight || '13px',
fontFamily: fontFamily || 'Montserrat Light',
textRendering: 'geometricPrecision',
},
}, [
h('div', {
style: {
width: '100%',
textAlign: 'right',
fontSize: fontSize || '12px',
color: color || '#333333',
},
}, fiatDisplayNumber),
h('div', {
style: {
color: color || '#AEAEAE',
marginLeft: '5px',
fontSize: fontSize || '12px',
},
}, fiatSuffix),
])
return (
<div
className="flex-row"
style={{
alignItems: 'flex-end',
lineHeight: lineHeight || '13px',
fontFamily: fontFamily || 'Montserrat Light',
textRendering: 'geometricPrecision',
}}
>
<div
style={{
width: '100%',
textAlign: 'right',
fontSize: fontSize || '12px',
color: color || '#333333',
}}
>
{fiatDisplayNumber}
</div>
<div
style={{
color: color || '#AEAEAE',
marginLeft: '5px',
fontSize: fontSize || '12px',
}}
>
{fiatSuffix}
</div>
</div>
)
} else {
return h('div')
return <div />
}
}

0 comments on commit df8ca7a

Please sign in to comment.