Sha256: dd2943494a983854388b6532ee77cc0c059b743e142f911a21491f1ca92bf931

Contents?: true

Size: 922 Bytes

Versions: 3

Compression:

Stored size: 922 Bytes

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'

import { buildCss } from '../utilities/props'
import DateTime from '../pb_kit/dateTime.js'

import {
  Body,
  Title,
} from '../'

type DateYearStackedProps = {
  align?: 'left' | 'center' | 'right',
  className?: String | Array<String>,
  dark?: Boolean,
  data?: String,
  date: String,
  id?: String,
}

const DateYearStacked = ({
  align = 'left',
  className,
  dark = false,
  date,
}: DateYearStackedProps) => {
  const dateTimestamp = new DateTime({ value: date })
  const css = classnames(className, buildCss('pb_date_year_stacked', align))

  return (
    <div className={css}>
      <Title
          dark={dark}
          size={4}
          text={`${dateTimestamp.toDay()} ${dateTimestamp.toMonth().toUpperCase()}`}
      />
      <Body color="light">{ dateTimestamp.toYear() }</Body>
    </div>
  )
}

export default DateYearStacked

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
playbook_ui-4.17.0.pre.alpha1 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx
playbook_ui-4.16.0 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx
playbook_ui-4.15.0 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx