Skip to content

Commit

Permalink
Do not use native OS button position for delete confirmation dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvisompura committed Jan 17, 2025
1 parent 307eba9 commit d79808e
Showing 1 changed file with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { localize } from '../../../../nls.js';
import { Button } from '../../../../base/browser/ui/positronComponents/button/button.js';
import { ContentArea } from './components/contentArea.js';
import { PositronModalDialog, PositronModalDialogProps } from './positronModalDialog.js';
import { PlatformNativeDialogActionBar } from './components/platformNativeDialogActionBar.js';

/**
* ConfirmDeleteModalDialogProps interface.
Expand All @@ -35,23 +34,6 @@ export interface ConfirmDeleteModalDialogProps extends PositronModalDialogProps
* @returns The rendered component.
*/
export const ConfirmDeleteModalDialog = (props: PropsWithChildren<ConfirmDeleteModalDialogProps>) => {
const cancelButton = (
<Button
className='action-bar-button default'
onPressed={async () => await props.onCancel()}
>
{props.cancelButtonTitle ?? localize('positron.cancel', "Cancel")}
</Button>
);
const deleteButton = (
<Button
className='action-bar-button destructive'
onPressed={async () => await props.onDeleteAction()}
>
{props.deleteActionTitle ?? localize('positron.delete', "Delete")}
</Button>
);

// Render.
return (
<PositronModalDialog {...props}>
Expand All @@ -62,7 +44,18 @@ export const ConfirmDeleteModalDialog = (props: PropsWithChildren<ConfirmDeleteM
<div className='left-actions'>
</div>
<div className='right-actions'>
<PlatformNativeDialogActionBar secondaryButton={deleteButton} primaryButton={cancelButton} />
<Button
className='action-bar-button destructive'
onPressed={async () => await props.onDeleteAction()}
>
{props.deleteActionTitle ?? localize('positron.delete', "Delete")}
</Button>
<Button
className='action-bar-button default'
onPressed={async () => await props.onCancel()}
>
{props.cancelButtonTitle ?? localize('positron.cancel', "Cancel")}
</Button>
</div>
</div>
</PositronModalDialog>
Expand Down

0 comments on commit d79808e

Please sign in to comment.