| @@ -28,8 +28,9 @@ | ||
| 28 | 28 | /** |
| 29 | 29 | * Returns the Alert component's JSX markup. |
| 30 | 30 | * |
| 31 | 31 | * @param {Object} props Component props. |
| 32 | + * @param {Object} props.icon Icon of the alert. Defaults to the TablePress icon. | |
| 32 | 33 | * @param {string} props.title Title of the alert. No header will be shown if this is not set. |
| 33 | 34 | * @param {string} props.text Text of the alert. |
| 34 | 35 | * @param {Function} props.onConfirm Callback to confirm the alert. |
| 35 | 36 | * @param {Object} props.modalProps Additional props for the Modal. |
| @@ -34,9 +35,9 @@ | ||
| 34 | 35 | * @param {Function} props.onConfirm Callback to confirm the alert. |
| 35 | 36 | * @param {Object} props.modalProps Additional props for the Modal. |
| 36 | 37 | * @return {Object} Alert component. |
| 37 | 38 | */ |
| 38 | -const Alert = ( { title, text, onConfirm, modalProps } ) => { | |
| 39 | +const Alert = ( { icon = TablePressIcon, title, text, onConfirm, modalProps } ) => { | |
| 39 | 40 | const confirmButtonRef = useRef(); |
| 40 | 41 | |
| 41 | 42 | const handleEnter = useCallback( |
| 42 | 43 | ( event ) => { |
| @@ -52,9 +53,9 @@ | ||
| 52 | 53 | ); |
| 53 | 54 | |
| 54 | 55 | return ( |
| 55 | 56 | <Modal |
| 56 | - icon={ <Icon icon={ TablePressIcon } size="36" style={ { display: 'flex', marginRight: '1rem' } } /> } | |
| 57 | + icon={ <Icon icon={ icon } size={ TablePressIcon === icon ? '36' : '24' } style={ { display: 'flex', marginRight: '1rem' } } /> } | |
| 57 | 58 | title={ title } |
| 58 | 59 | __experimentalHideHeader={ undefined === title } |
| 59 | 60 | isDismissible={ false } |
| 60 | 61 | shouldCloseOnEsc={ false } |