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