2019-08-31 20:51:14 -07:00
|
|
|
{{! alias the active notification on the service --}}
|
2020-08-26 15:44:50 -07:00
|
|
|
{{#let this.service.activeNotification as |notification|}}
|
2019-08-31 20:51:14 -07:00
|
|
|
{{! Dialog Modals }}
|
2020-08-26 15:44:50 -07:00
|
|
|
{{#if (and this.service.isShowingNotification (eq notification.type this.notificationType.Modal))}}
|
2019-08-31 20:51:14 -07:00
|
|
|
<NotificationsConfirmDialog
|
|
|
|
@dismissButtonText={{notification.props.dismissButtonText}}
|
|
|
|
@confirmButtonText={{notification.props.confirmButtonText}}
|
|
|
|
@toggleText={{notification.props.toggleText}}
|
2020-08-26 15:44:50 -07:00
|
|
|
@onDialogToggle={{action notification.props.onDialogToggle target=this.service}}
|
|
|
|
@didConfirm={{action "confirmModal" target=this.service}}
|
|
|
|
@didClose={{action "dismissModal" target=this.service}} as |Dialog|
|
2019-08-31 20:51:14 -07:00
|
|
|
>
|
|
|
|
<Dialog.header @header={{notification.props.header}} />
|
|
|
|
|
|
|
|
<Dialog.content @content={{notification.props.content}} />
|
|
|
|
|
|
|
|
<Dialog.footer />
|
|
|
|
</NotificationsConfirmDialog>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
|
|
|
|
<div class="notifications__toast-wrapper">
|
|
|
|
{{! Toasts are hidden or show based on the flag, allows for css animation between states}}
|
2020-08-26 15:44:50 -07:00
|
|
|
{{#let (if this.service.isShowingToast "--visible" "--hidden") as |classModifier|}}
|
2019-08-31 20:51:14 -07:00
|
|
|
<NotificationsToast
|
|
|
|
class={{concat "notifications__toast" classModifier}}
|
|
|
|
@toast={{notification}}
|
2020-08-26 15:44:50 -07:00
|
|
|
@onDismiss={{action this.service.dismissToast}}
|
|
|
|
@onShowDetail={{action this.service.showContentDetail}}
|
2019-08-31 20:51:14 -07:00
|
|
|
/>
|
|
|
|
{{/let}}
|
|
|
|
</div>
|
|
|
|
{{/let}}
|