PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
← All changes | admin/js/common/alert.jsx +3 -2 3.3.2 → 3.4 View file →
@@ -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 }