Make the Remove button require confirmation.

This commit is contained in:
Bauke 2022-03-16 22:07:37 +01:00
parent 66c3f7e444
commit 3082221c4d
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,4 @@
import {ConfirmButton} from '@holllo/gram';
import {html} from 'htm/preact';
import {Component} from 'preact';
import browser from 'webextension-polyfill';
@ -197,9 +198,14 @@ export class PageMain extends Component<Props, State> {
<div class="button-group">
<button class="button" onClick=${this.saveBang}>Save</button>
<button class="button destructive" onClick=${this.removeBang}>
Remove
</button>
<${ConfirmButton}
class="button destructive"
click=${this.removeBang}
confirmClass="confirm"
confirmText="Confirm Removal"
text="Remove ${this.state.editorBang.id}"
timeout=${5 * 1000}
/>
</div>
${validateError}
</div>