Sha256: 0d190a21be840e65eb5098e56537fe8dea8c8e1b0a88340934894060b277d8af
Contents?: true
Size: 1010 Bytes
Versions: 37
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
37 entries across 37 versions & 1 rubygems