-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathindex.jsx
40 lines (36 loc) · 1.08 KB
/
index.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import PropTypes from 'prop-types';
import {
Icon, Toast,
} from '@openedx/paragon';
import { Settings as IconSettings } from '@openedx/paragon/icons';
import { capitalize } from 'lodash';
import classNames from 'classnames';
const ProcessingNotification = ({
isShow, title, action, close,
}) => (
<Toast
className={classNames({ 'processing-notification-hide-close-button': !close })}
show={isShow}
aria-hidden={isShow}
action={action && { ...action }}
onClose={close || (() => {})}
>
<span className="d-flex align-items-center">
<Icon className="processing-notification-icon mb-0 mr-2" src={IconSettings} />
<span className="font-weight-bold h4 mb-0 text-white">{capitalize(title)}</span>
</span>
</Toast>
);
ProcessingNotification.defaultProps = {
close: null,
};
ProcessingNotification.propTypes = {
isShow: PropTypes.bool.isRequired,
title: PropTypes.string.isRequired,
action: PropTypes.shape({
label: PropTypes.string.isRequired,
onClick: PropTypes.func,
}),
close: PropTypes.func,
};
export default ProcessingNotification;