-
Notifications
You must be signed in to change notification settings - Fork 429
/
Copy pathcontainer.jsx
45 lines (38 loc) · 1.02 KB
/
container.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
41
42
43
44
45
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
// # Alert Container Component
import React from 'react';
import PropTypes from 'prop-types';
import classNames from '../../utilities/class-names';
import { ALERT_CONTAINER } from '../../utilities/constants';
const propTypes = {
/**
* CSS classes to be added to tag with `.slds-notify_alert`. Uses `classNames` [API](https://github.com/JedWatson/classnames).
*/
className: PropTypes.oneOfType([
PropTypes.array,
PropTypes.object,
PropTypes.string,
]),
/**
* Alert components
*/
children: PropTypes.node,
};
/**
* A fixed container for alert banners.
*/
class AlertContainer extends React.Component {
render() {
return (
<div
className={classNames('slds-notify-container', this.props.className)}
>
{this.props.children}
</div>
);
}
}
AlertContainer.displayName = ALERT_CONTAINER;
AlertContainer.propTypes = propTypes;
export default AlertContainer;