Notices.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div class="notices is-top">
  3. <b-notification
  4. v-for="notice in notices"
  5. v-show="notice.isShowed"
  6. :key="notice.id"
  7. class="is-top-right"
  8. has-icon
  9. :icon="notice.type"
  10. :aria-close-label="$t('closeNotification')"
  11. role="alert"
  12. @close="close(notice.id)"
  13. >
  14. <span v-if="notice.untranslatedTitle">{{ notice.untranslatedTitle }}</span>
  15. <i18n v-else :path="notice.title.path || notice.title" tag="span">
  16. <template v-slot:value>
  17. <b><number-format :value="notice.title.amount" /> {{ getSymbol(notice.title.currency) }}</b>
  18. </template>
  19. <template v-slot:description>{{ notice.description }}</template>
  20. </i18n>
  21. <a
  22. v-if="notice.nova"
  23. href="https://nova.tornadocash.eth.link"
  24. target="_blank"
  25. rel="noopener noreferrer"
  26. >
  27. Tornado Cash Nova
  28. </a>
  29. <a
  30. v-if="notice.txHash"
  31. :href="txExplorerUrl(notice.txHash)"
  32. target="_blank"
  33. data-test="popup_message"
  34. rel="noopener noreferrer"
  35. >
  36. {{ $t('viewOnEtherscan') }}
  37. </a>
  38. <n-link v-else-if="notice.routerLink" v-bind="notice.routerLink.params" @onClick="$forceUpdate()">
  39. {{ $t(notice.routerLink.title) }}
  40. </n-link>
  41. </b-notification>
  42. </div>
  43. </template>
  44. <script>
  45. import { mapState, mapGetters, mapActions } from 'vuex'
  46. import NumberFormat from '@/components/NumberFormat'
  47. export default {
  48. components: {
  49. NumberFormat
  50. },
  51. computed: {
  52. ...mapState('notice', ['notices']),
  53. ...mapGetters('txHashKeeper', ['txExplorerUrl']),
  54. ...mapGetters('token', ['getSymbol'])
  55. },
  56. methods: {
  57. ...mapActions('notice', ['showNotice']),
  58. close(id) {
  59. this.showNotice({ id, isShowed: false })
  60. }
  61. }
  62. }
  63. </script>