Make the Save button show feedback on save.
This commit is contained in:
parent
f9e9f3aa5d
commit
4660c42868
|
@ -1,4 +1,4 @@
|
||||||
import {ConfirmButton} from '@holllo/gram';
|
import {ConfirmButton, FeedbackButton} from '@holllo/gram';
|
||||||
import {html} from 'htm/preact';
|
import {html} from 'htm/preact';
|
||||||
import {Component} from 'preact';
|
import {Component} from 'preact';
|
||||||
import browser from 'webextension-polyfill';
|
import browser from 'webextension-polyfill';
|
||||||
|
@ -99,7 +99,8 @@ export class PageMain extends Component<Props, State> {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
// Return false to make the FeedbackButton not show feedback.
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bangs = this.state.bangs;
|
const bangs = this.state.bangs;
|
||||||
|
@ -197,7 +198,13 @@ export class PageMain extends Component<Props, State> {
|
||||||
${editorInputs}
|
${editorInputs}
|
||||||
|
|
||||||
<div class="button-group">
|
<div class="button-group">
|
||||||
<button class="button" onClick=${this.saveBang}>Save</button>
|
<${FeedbackButton}
|
||||||
|
attributes=${{class: 'button'}}
|
||||||
|
click=${this.saveBang}
|
||||||
|
feedbackText="Saved"
|
||||||
|
text="Save"
|
||||||
|
timeout=${5 * 1000}
|
||||||
|
/>
|
||||||
<${ConfirmButton}
|
<${ConfirmButton}
|
||||||
class="button destructive"
|
class="button destructive"
|
||||||
click=${this.removeBang}
|
click=${this.removeBang}
|
||||||
|
|
Loading…
Reference in New Issue