mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 17:38:00 +08:00
23 lines
522 B
JavaScript
23 lines
522 B
JavaScript
import React from 'react';
|
|
import {SnackBar} from 'coral-ui';
|
|
|
|
const Notification = (props) => {
|
|
if (props.notification.text) {
|
|
setTimeout(() => {
|
|
props.clearNotification();
|
|
}, props.notifLength);
|
|
}
|
|
return (
|
|
<div>
|
|
{
|
|
props.notification.text &&
|
|
<SnackBar id='coral-notif' className={`coral-notif-${props.notification.type}`} position={props.notification.position}>
|
|
{props.notification.text}
|
|
</SnackBar>
|
|
}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Notification;
|