Sha256: 5ce522108998cd945e18662ad1a6ed0206dc50b8b95064166254854a6e4887fc

Contents?: true

Size: 1.12 KB

Versions: 11

Compression:

Stored size: 1.12 KB

Contents

/* @flow */
/*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */

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

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

type FixedConfirmationToastProps = {
  className?: String,
  data?: String,
  id?: String,
  status?: 'success' | 'error' | 'neutral',
  text: String,
}

const FixedConfirmationToast = ({
  className,
  data,
  id,
  status='neutral',
  text
}: FixedConfirmationToastProps) => {
  const css = classnames([
    `pb_fixed_confirmation_toast_kit_${status}`,
    className,
  ])

const icon = (function(status) {
  switch(status) {
    case "success":
      return "check";
    case "error":
      return "exclamation-triangle";
    case "neutral":
      return "info-circle";
    default:
      return null;
  }
})(status)

const displayIcon = function(icon) {
  if (icon) {
    return (
      <Icon icon={icon} fixed_width={true} className="pb_icon"/>
    )
  }
}

return (
  <div className={css}>
    {displayIcon(icon)}
    <Title size={4} className="pb_fixed_confirmation_toast_text" text={text} />
    </div>
  )
}

export default FixedConfirmationToast

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
playbook_ui-3.1.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx
playbook_ui-3.0.1 app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx
playbook_ui-3.0.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx
playbook_ui-2.9.9 app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx
playbook_ui-2.9.8 app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx
playbook_ui-2.9.7 app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx
playbook_ui-2.9.6 app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx
playbook_ui-2.9.5 app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx
playbook_ui-2.9.4 app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx
playbook_ui-2.9.3 app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx
playbook_ui-2.9.2 app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx