(props)
| 20 | }; |
| 21 | |
| 22 | function Toast(props) { |
| 23 | const { |
| 24 | className, |
| 25 | cssModule, |
| 26 | tag: Tag = 'div', |
| 27 | isOpen = true, |
| 28 | children, |
| 29 | transition = { |
| 30 | ...Fade.defaultProps, |
| 31 | unmountOnExit: true, |
| 32 | }, |
| 33 | fade = true, |
| 34 | innerRef, |
| 35 | ...attributes |
| 36 | } = props; |
| 37 | |
| 38 | const classes = mapToCssModules(classNames(className, 'toast'), cssModule); |
| 39 | |
| 40 | const toastTransition = { |
| 41 | ...Fade.defaultProps, |
| 42 | ...transition, |
| 43 | baseClass: fade ? transition.baseClass : '', |
| 44 | timeout: fade ? transition.timeout : 0, |
| 45 | }; |
| 46 | |
| 47 | return ( |
| 48 | <Fade |
| 49 | {...attributes} |
| 50 | {...toastTransition} |
| 51 | tag={Tag} |
| 52 | className={classes} |
| 53 | in={isOpen} |
| 54 | role="alert" |
| 55 | innerRef={innerRef} |
| 56 | > |
| 57 | {children} |
| 58 | </Fade> |
| 59 | ); |
| 60 | } |
| 61 | |
| 62 | Toast.propTypes = propTypes; |
| 63 |
nothing calls this directly
no test coverage detected
searching dependent graphs…