Skip to content

Commit

Permalink
Refactor: Simplify restore setting button
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Oct 20, 2024
1 parent c42d42d commit 50b33ac
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/settings/global-settings/setting-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -758,22 +758,20 @@ export default function SettingModal( { options, isAdministrator, setIsSettingMo
focusOnMount="firstElement"
onClose={ () => setIsResetPopup( false ) }
>
<Spacer marginBottom={ 0 } padding={ 2 }>
<VStack spacing={ 4 }>
<Text as="p">{ __( 'Are you sure?', 'flexible-table-block' ) }</Text>
<HStack>
<Button isDestructive onClick={ handleResetOptions } size="compact">
{ __( 'Restore', 'flexible-table-block' ) }
</Button>
<Button
variant="secondary"
onClick={ () => setIsResetPopup( false ) }
size="compact"
>
{ __( 'Cancel', 'flexible-table-block' ) }
</Button>
</HStack>
</VStack>
<Spacer as={ VStack } marginBottom={ 0 } padding={ 2 } spacing={ 4 }>
<Text as="p">{ __( 'Are you sure?', 'flexible-table-block' ) }</Text>
<HStack>
<Button isDestructive onClick={ handleResetOptions } size="compact">
{ __( 'Restore', 'flexible-table-block' ) }
</Button>
<Button
variant="secondary"
onClick={ () => setIsResetPopup( false ) }
size="compact"
>
{ __( 'Cancel', 'flexible-table-block' ) }
</Button>
</HStack>
</Spacer>
</Popover>
) }
Expand Down

0 comments on commit 50b33ac

Please sign in to comment.