Sha256: de5daeb3d35071b7b482c845d942e52719a04644e3f319fee546bc084c3a88e8
Contents?: true
Size: 1.59 KB
Versions: 40
Compression:
Stored size: 1.59 KB
Contents
import React from 'react' import classnames from 'classnames' import { buildCss, buildDataProps } from '../utilities/props' import { deprecatedProps, globalProps } from '../utilities/globalProps' import DateTime from '../pb_kit/dateTime'; import Body from '../pb_body/_body' import Caption from '../pb_caption/_caption' type TimeStackedProps = { align?: 'left' | 'center' | 'right', className?: string | string[], dark?: boolean, data?: { [key: string]: string }, date?: Date, id?: string, time?: number | Date, timeZone?: string, } const TimeStackedDefault = (props: TimeStackedProps): React.ReactElement => { if (props.date) deprecatedProps('Time Stacked', ['date']) //date prop is deprecated, use time instead const { align = 'left', className, dark, data = {}, date, time, timeZone, } = props const classes = classnames( buildCss('pb_time_stacked_kit', align), globalProps(props), className ) const dataProps = buildDataProps(data) return ( <div className={classes} {...dataProps} > <Body className={classnames('pb_time_stacked', 'time-spacing')} color="light" dark={dark} > <time> {DateTime.toTimeWithMeridiem(date ? date : new Date(time), timeZone)} <Caption className="pb_time_stacked" color="light" dark={dark} tag="span" text={DateTime.toTimeZone(date ? date : new Date(time), timeZone)} /> </time> </Body> </div> ) } export default TimeStackedDefault
Version data entries
40 entries across 40 versions & 1 rubygems