UNPKG

@shakthillc/components

Version:

React generic components for shakthi products

66 lines (52 loc) 1.75 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _InlineAlertModule = require('./InlineAlert.module.css'); var _InlineAlertModule2 = _interopRequireDefault(_InlineAlertModule); var _propTypes = require('prop-types'); var _Icon = require('@material-ui/core/Icon'); var _Icon2 = _interopRequireDefault(_Icon); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var InlineAlert = function InlineAlert(_ref) { var w = _ref.width, h = _ref.height, icon = _ref.icon, color = _ref.color, text = _ref.text, display = _ref.display; if (!display) var dispProp = "none"; return _react2.default.createElement( 'div', { style: { width: w, height: h, backgroundColor: color, display: dispProp }, className: _InlineAlertModule2.default['Inline-container'] }, _react2.default.createElement( _Icon2.default, null, icon ), _react2.default.createElement( 'div', { className: _InlineAlertModule2.default['Inline-container--text'] }, text ) ); }; exports.default = InlineAlert; InlineAlert.defaultProps = { height: "32px", width: "432px", color: "#FFD4D1", display: true, icon: "report_problem", text: "This is a sample Inline alert" }; InlineAlert.propTypes = { icon: _propTypes.PropTypes.string, color: _propTypes.PropTypes.string, width: _propTypes.PropTypes.string, height: _propTypes.PropTypes.string, text: _propTypes.PropTypes.string, display: _propTypes.PropTypes.bool };