@afzalimdad9/react-alert-template-basic
Version:
> Basic alert template for [@afzalimdad9/react-alert](https://github.com/afzalimdad9/react-alert)
37 lines • 1.37 kB
JavaScript
import React from 'react';
import InfoIcon from './icons/InfoIcon';
import SuccessIcon from './icons/SuccessIcon';
import ErrorIcon from './icons/ErrorIcon';
import CloseIcon from './icons/CloseIcon';
const alertStyle = {
backgroundColor: '#151515',
color: 'white',
padding: '10px',
textTransform: 'uppercase',
borderRadius: '3px',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
boxShadow: '0px 2px 2px 2px rgba(0, 0, 0, 0.03)',
fontFamily: 'Arial',
width: '300px',
boxSizing: 'border-box'
};
const buttonStyle = {
marginLeft: '20px',
border: 'none',
backgroundColor: 'transparent',
cursor: 'pointer',
color: '#FFFFFF'
};
const AlertTemplate = ({ message, options, style, close }) => {
return (React.createElement("div", { style: Object.assign(Object.assign({}, alertStyle), style) },
options.type === 'info' && React.createElement(InfoIcon, null),
options.type === 'success' && React.createElement(SuccessIcon, null),
options.type === 'error' && React.createElement(ErrorIcon, null),
React.createElement("span", { style: { flex: 2 } }, message),
React.createElement("button", { onClick: close, style: buttonStyle },
React.createElement(CloseIcon, null))));
};
export default AlertTemplate;
//# sourceMappingURL=index.js.map