@@ -9,12 +9,14 @@ import SVGSectionIcon from './images/settings-icon-section.svg'
99/**
1010 * WordPress dependencies
1111 */
12- import { __ } from '@wordpress/i18n'
12+ import { __ , sprintf } from '@wordpress/i18n'
1313import {
1414 useEffect , useState , useCallback , useMemo , lazy , Suspense ,
1515} from '@wordpress/element'
1616import domReady from '@wordpress/dom-ready'
17- import { Spinner , CheckboxControl } from '@wordpress/components'
17+ import {
18+ Button , Flex , FlexItem , Spinner , CheckboxControl , Modal ,
19+ } from '@wordpress/components'
1820import { loadPromise , models } from '@wordpress/api'
1921import { applyFilters } from '@wordpress/hooks'
2022
@@ -393,37 +395,48 @@ const ToggleBlockDialog = ( {
393395 const blockTitle = getBlockTitle ( blockName )
394396
395397 return (
396- < div className = "s-toggle-block-dialog" >
397- < div className = "s-toggle-block-dialog-content" >
398- { isDisabled
399- ? < p > { __ ( 'Disabling ' + blockTitle + ' will also disable the blocks that require it:' , i18n ) } </ p > // eslint-disable-line @wordpress/i18n-no-variables
400- : < p > { __ ( 'Enabling ' + blockTitle + ' will also enable its required innerblocks:' , i18n ) } </ p > // eslint-disable-line @wordpress/i18n-no-variables
401- }
402- < ul >
403- { blockList . map ( ( block , i ) => (
404- < li key = { i } > { getBlockTitle ( block ) } </ li >
405- ) ) }
406- </ ul >
407- { isDisabled
408- ? < p > { __ ( 'Are you sure you want to disable this block?' , i18n ) } </ p >
409- : < p > { __ ( 'Are you sure you want to enable this block?' , i18n ) } </ p >
410- }
411- < div >
412- < button
413- className = "s-dialog-button s-dialog-button-confirm"
414- onClick = { onConfirm }
415- >
416- { __ ( 'Yes' , i18n ) }
417- </ button >
418- < button
419- className = "s-dialog-button s-dialog-button-cancel "
398+ < Modal
399+ className = "s-confirm-modal"
400+ size = "medium"
401+ title = { isDisabled
402+ ? sprintf ( __ ( 'Disable %s block?' , i18n ) , blockTitle )
403+ : sprintf ( __ ( 'Enable %s block?' , i18n ) , blockTitle ) }
404+ onRequestClose = { onCancel }
405+ >
406+ { isDisabled
407+ ? < p > { __ ( 'Disabling this block will also disable these blocks that require this block to function:' , i18n ) } </ p > // eslint-disable-line @wordpress/i18n-no-variables
408+ : < p > { __ ( 'Enabling this block will also enable these blocks that are needed for this block to function:' , i18n ) } </ p > // eslint-disable-line @wordpress/i18n-no-variables
409+ }
410+ < ul >
411+ { blockList . map ( ( block , i ) => (
412+ < li key = { i } > { getBlockTitle ( block ) } </ li >
413+ ) ) }
414+ </ ul >
415+ < Flex
416+ justify = "flex-end"
417+ expanded = { false }
418+ >
419+ < FlexItem >
420+ < Button
421+ variant = "secondary "
420422 onClick = { onCancel }
421423 >
422- { __ ( 'No' , i18n ) }
423- </ button >
424- </ div >
425- </ div >
426- </ div >
424+ { __ ( 'Cancel' , i18n ) }
425+ </ Button >
426+ </ FlexItem >
427+ < FlexItem >
428+ < Button
429+ variant = "primary"
430+ onClick = { onConfirm }
431+ >
432+ { isDisabled
433+ ? __ ( 'Disable' , i18n )
434+ : __ ( 'Enable' , i18n )
435+ }
436+ </ Button >
437+ </ FlexItem >
438+ </ Flex >
439+ </ Modal >
427440 )
428441}
429442
0 commit comments