Sha256: 18206d5a1c90d652899a95b5dc40fcbe539c6216e399d79a29e7c1711936be89
Contents?: true
Size: 1.75 KB
Versions: 644
Compression:
Stored size: 1.75 KB
Contents
import React from 'react' import classnames from 'classnames' import { buildCss, buildDataProps, buildHtmlProps } 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, htmlOptions?: {[key: string]: string | number | boolean | (() => void)}, id?: string, time?: number | Date, timeZone?: string, } const TimeStackedDefault = (props: TimeStackedProps): React.ReactElement => { if (props.date) deprecatedProps() //date prop is deprecated, use time instead const { align = 'left', className, dark, data = {}, date, htmlOptions = {}, time, timeZone, } = props const classes = classnames( buildCss('pb_time_stacked_kit', align), globalProps(props), className ) const dataProps = buildDataProps(data) const htmlProps = buildHtmlProps(htmlOptions) return ( <div className={classes} {...dataProps} {...htmlProps} > <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
644 entries across 644 versions & 1 rubygems