2020-11-03 08:35:46 +01:00
|
|
|
<template>
|
|
|
|
<div class="notices is-top">
|
|
|
|
<b-notification
|
|
|
|
v-for="notice in notices"
|
|
|
|
:key="notice.id"
|
|
|
|
class="is-top-right"
|
|
|
|
has-icon
|
|
|
|
:icon="notice.type"
|
|
|
|
:aria-close-label="$t('closeNotification')"
|
|
|
|
role="alert"
|
|
|
|
@close="close(notice.id)"
|
|
|
|
>
|
|
|
|
<i18n :path="notice.title.path || notice.title" tag="span">
|
|
|
|
<template v-slot:value>
|
|
|
|
<b>{{ notice.title.value }}</b>
|
|
|
|
</template>
|
|
|
|
</i18n>
|
2020-11-21 11:46:25 +01:00
|
|
|
<a
|
|
|
|
v-if="typeof notice.callback === 'function'"
|
|
|
|
@click="callbackWithClose(notice.id, notice.callback)"
|
|
|
|
>
|
|
|
|
Scroll to voucher
|
|
|
|
</a>
|
2020-11-03 08:35:46 +01:00
|
|
|
<a
|
|
|
|
v-if="notice.txHash"
|
|
|
|
:href="txExplorerUrl(notice.txHash)"
|
|
|
|
target="_blank"
|
|
|
|
>
|
|
|
|
{{ $t('viewOnEtherscan') }}
|
|
|
|
</a>
|
|
|
|
</b-notification>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-11-03 12:48:03 +01:00
|
|
|
import { mapState, mapActions, mapGetters } from 'vuex'
|
2020-11-03 08:35:46 +01:00
|
|
|
export default {
|
|
|
|
computed: {
|
|
|
|
...mapState('notice', ['notices']),
|
2020-11-03 12:48:03 +01:00
|
|
|
...mapGetters('txStorage', ['txExplorerUrl']),
|
2020-11-03 08:35:46 +01:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions('notice', ['deleteNotice']),
|
2020-11-21 11:46:25 +01:00
|
|
|
callbackWithClose(id, callback) {
|
|
|
|
callback()
|
|
|
|
this.deleteNotice({ id })
|
|
|
|
},
|
2020-11-03 08:35:46 +01:00
|
|
|
close(id) {
|
|
|
|
this.deleteNotice({ id })
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|