mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 17:48:10 -03:30
add AlertModal component and update styling of delete confirmations
This commit is contained in:
28
src/components/AlertModal.jsx
Normal file
28
src/components/AlertModal.jsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
Modal
|
||||
} from '@patternfly/react-core';
|
||||
|
||||
import { ExclamationTriangleIcon, ExclamationCircleIcon, InfoCircleIcon, CheckCircleIcon } from '@patternfly/react-icons';
|
||||
|
||||
const getIcon = (variant) => {
|
||||
let icon;
|
||||
if (variant === 'warning') {
|
||||
icon = (<ExclamationTriangleIcon className="at-c-alertModal__icon" />);
|
||||
} else if (variant === 'danger') {
|
||||
icon = (<ExclamationCircleIcon className="at-c-alertModal__icon" />);
|
||||
} if (variant === 'info') {
|
||||
icon = (<InfoCircleIcon className="at-c-alertModal__icon" />);
|
||||
} if (variant === 'success') {
|
||||
icon = (<CheckCircleIcon className="at-c-alertModal__icon" />);
|
||||
}
|
||||
return icon;
|
||||
};
|
||||
|
||||
export default ({ variant, children, ...props }) => (
|
||||
<Modal className={`awx-c-modal${variant && ` at-c-alertModal at-c-alertModal--${variant}`}`} {...props}>
|
||||
{children}
|
||||
{getIcon(variant)}
|
||||
</Modal>
|
||||
);
|
||||
Reference in New Issue
Block a user