* feat(device): Add 'Save to keyboard' button Created a 'Progress Button' that have 2 state in progress or not. Able to set different text for different state: - baseText for normal state - progressText for in progress state close: #377 * fix 'Save to keyboard' button visibility in web version * remove success notification when save to keyboard success * feat(notifier): Turn off auto hide of the notifier * feat(device): Show saved state of 'Save to keyboard button' * style: Format import in app.component.ts * feat(device): Auto hide 'Save to Keyboard' button * fix(device): Fix saving animation * fix(device): Fix saving animation * fix(device): Fix tslint
20 lines
704 B
TypeScript
20 lines
704 B
TypeScript
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
import { Action } from '@ngrx/store';
|
|
|
|
import { ProgressButtonState, initProgressButtonState } from '../../store/reducers/progress-button-state';
|
|
|
|
@Component({
|
|
selector: 'progress-button',
|
|
templateUrl: './progress-button.component.html',
|
|
styleUrls: ['./progress-button.component.scss'],
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
})
|
|
export class ProgressButtonComponent {
|
|
@Input() state: ProgressButtonState = initProgressButtonState;
|
|
@Output() clicked: EventEmitter<Action> = new EventEmitter<Action>();
|
|
|
|
onClicked() {
|
|
this.clicked.emit(this.state.action);
|
|
}
|
|
}
|