Sha256: 0b6ff49a3b3a054a10b6db5d2aac85eca11b162e0e1a1a72d139a642466677c0

Contents?: true

Size: 921 Bytes

Versions: 44

Compression:

Stored size: 921 Bytes

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'
import { globalProps } from '../utilities/globalProps.js'
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'

type ImageProps = {
  alt?: string,
  aria?: object,
  className?: string,
  data?: object,
  id?: string,
  url: string,
}

const Image = (props: ImageProps) => {
  const {
    alt = '',
    aria = {},
    className,
    data = {},
    id,
    url = '',
  } = props

  const ariaProps = buildAriaProps(aria)
  const classes = classnames(
    buildCss('pb_image lazyload blur_up'),
    globalProps(props),
    className
  )
  const dataProps = buildDataProps(data)

  return (
    <div>
      <img
          {...ariaProps}
          {...dataProps}
          alt={alt}
          className={classes}
          data-src={url}
          id={id}
          src={url}
      />
    </div>
  )
}

export default Image

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
playbook_ui-7.5.1 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.5.0 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.4.2 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.4.1 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.4.0.pre.alpha6 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.4.0.pre.alpha5 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.4.0 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.4.0.pre.test4 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.4.0.pre.test3 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.4.0.pre.test2 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.4.0.pre.alpha4 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.4.0.pre.alpha2 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.4.0.pre.alpha1 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.3.0.pre.alpha12 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.3.0 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.3.0.pre.alpha11 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.3.0.pre.alpha10 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.3.0.pre.alpha9 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.3.0.pre.alpha8 app/pb_kits/playbook/pb_image/_image.jsx
playbook_ui-7.3.0.pre.alpha7 app/pb_kits/playbook/pb_image/_image.jsx