Sha256: a90f5b8e711d2021b977d346deb6dab79d9d944bdb3c236c3646f1f887bfacd2
Contents?: true
Size: 1010 Bytes
Versions: 7
Compression:
Stored size: 1010 Bytes
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import { Title } from '../' import { globalProps } from '../utilities/globalProps.js' type StatValueProps = { className?: String, id?: String, unit?: String, value: String | Number } const StatValue = (props: StatValueProps) => { const { className, id, unit, value = 0, } = props const displayValue = function(value) { if (value) { return ( <Title size={1} text={value} /> ) } } const displayUnit = function(unit) { if (unit) { return ( <Title size={3} text={unit} /> ) } } return ( <div className={classnames('pb_stat_value_kit', className, globalProps(props))} id={id} > <div className="pb_stat_value_wrapper"> {displayValue(value)} {displayUnit(unit)} </div> </div> ) } export default StatValue
Version data entries
7 entries across 7 versions & 1 rubygems