Sha256: 3f9a410ef4ae37579c12f12af009fbee5ca20897ed741ef790448fa594537aa6

Contents?: true

Size: 1.43 KB

Versions: 40

Compression:

Stored size: 1.43 KB

Contents

import React from 'react'

import { buildCss } from '../utilities/props'
import { deprecatedProps, globalProps } from '../utilities/globalProps'

import Flex from '../pb_flex/_flex'
import FlexItem from '../pb_flex/_flex_item'
import SectionSeparator from '../pb_section_separator/_section_separator'
import TimeStacked from '../pb_time_stacked/_time_stacked'
import DateStacked from '../pb_date_stacked/_date_stacked'

type DateTimeStackedProps = {
  id?: string,
  date: Date,
  datetime: Date,
  dark: boolean,
  timeZone?: string,
}

const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
  if (props.date) deprecatedProps('Date Time Stacked', ['date'])

  const {
    date,
    datetime,
    dark,
    timeZone = 'America/New_York',
  } = props

  const classes = buildCss('pb_date_time_stacked_kit', globalProps(props))

  return (
    <Flex
        inline={false}
        vertical="stretch"
        {...props}
    >
      <FlexItem>
        <DateStacked
            align="right"
            bold
            dark={dark}
            date={date || datetime}
        />
      </FlexItem>

      <SectionSeparator
          className="date-time-padding"
          orientation="vertical"
      />
      <FlexItem>
        <TimeStacked
            className={classes}
            dark={dark}
            date={date || datetime}
            timeZone={timeZone}
        />
      </FlexItem>
    </Flex>
  )
}

export default DateTimeStacked

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
playbook_ui-12.38.0.pre.alpha.PLAY966collapsiblenav41086 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.38.0.pre.alpha.audiencesalpha1083 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.38.0.pre.alpha.PLAY966collapsiblenav41082 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.38.0.pre.alpha.PLAYaddingdatapropselectkit1080 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.37.0.pre.alpha.PLAY951collapsiblenav31078 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.38.0.pre.alpha.playbook123801077 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.37.0.pre.alpha.PLAY951collapsiblenav31074 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.37.0.pre.alpha.PLAY951collapsiblenav31073 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.37.0.pre.alpha.PLAYaddingdatapropselectkit1071 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.38.0 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.36.0.pre.alpha.PLAY936momentjs1058 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.36.0.pre.alpha.PLAY936momentjs1050 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.36.0.pre.alpha.PLAY936momentjs1047 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.33.0.pre.alpha.PLAY905reactionbuttons982 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.33.0.pre.alpha.PLAY905reactionbuttons979 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.33.0.pre.alpha.revert2650closedialogonoutsideclick977 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.33.0 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.31.0.pre.alpha.PLAY814removemomentjs935 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.31.0.pre.alpha.PLAY814removemomentjs933 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx
playbook_ui-12.28.0.pre.alpha.PLAY814removemomentjs871 app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx