Convert FiatValue component to JSX (#7515)

feature/default_network_editable
Whymarrh Whitby 5 years ago committed by GitHub
parent f5824ffad7
commit 9f7438e756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 38
      ui/app/components/ui/fiat-value.js

@ -1,5 +1,4 @@
const Component = require('react').Component import React, { Component } from 'react'
const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const formatBalance = require('../../helpers/utils/util').formatBalance const formatBalance = require('../../helpers/utils/util').formatBalance
@ -38,31 +37,38 @@ function fiatDisplay (fiatDisplayNumber, fiatSuffix, styleOveride = {}) {
const { fontSize, color, fontFamily, lineHeight } = styleOveride const { fontSize, color, fontFamily, lineHeight } = styleOveride
if (fiatDisplayNumber !== 'N/A') { if (fiatDisplayNumber !== 'N/A') {
return h('.flex-row', { return (
style: { <div
className="flex-row"
style={{
alignItems: 'flex-end', alignItems: 'flex-end',
lineHeight: lineHeight || '13px', lineHeight: lineHeight || '13px',
fontFamily: fontFamily || 'Montserrat Light', fontFamily: fontFamily || 'Montserrat Light',
textRendering: 'geometricPrecision', textRendering: 'geometricPrecision',
}, }}
}, [ >
h('div', { <div
style: { style={{
width: '100%', width: '100%',
textAlign: 'right', textAlign: 'right',
fontSize: fontSize || '12px', fontSize: fontSize || '12px',
color: color || '#333333', color: color || '#333333',
}, }}
}, fiatDisplayNumber), >
h('div', { {fiatDisplayNumber}
style: { </div>
<div
style={{
color: color || '#AEAEAE', color: color || '#AEAEAE',
marginLeft: '5px', marginLeft: '5px',
fontSize: fontSize || '12px', fontSize: fontSize || '12px',
}, }}
}, fiatSuffix), >
]) {fiatSuffix}
</div>
</div>
)
} else { } else {
return h('div') return <div />
} }
} }

Loading…
Cancel
Save