Footer.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <footer class="footer">
  3. <div class="container">
  4. <div class="level">
  5. <div class="level-left">
  6. <div class="level-item is-column">
  7. <div class="level-subitem footer-address">
  8. <div class="footer-address__name">
  9. {{ $t('donationsAddress') }}
  10. </div>
  11. <a
  12. class="footer-address__value"
  13. target="_blank"
  14. :href="addressExplorerUrl(donationsAddress)"
  15. rel="noopener noreferrer"
  16. >{{ donationsAddress }}</a
  17. >
  18. </div>
  19. <div class="level-subitem">
  20. Tornado.cash version:
  21. <span class="footer-version__value">{{ commit }}</span>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="level-right">
  26. <div class="level-item is-column">
  27. <div class="level-subitem">
  28. <div class="buttons">
  29. <b-button
  30. tag="a"
  31. type="is-icon"
  32. :href="duneLink"
  33. target="_blank"
  34. rel="noopener noreferrer"
  35. icon-right="stats"
  36. ></b-button>
  37. <b-button
  38. tag="a"
  39. type="is-icon"
  40. href="https://torn.community"
  41. target="_blank"
  42. rel="noopener noreferrer"
  43. icon-right="discourse"
  44. ></b-button>
  45. <b-button
  46. tag="a"
  47. type="is-icon"
  48. href="https://discord.com/invite/TFDrM8K42j"
  49. target="_blank"
  50. rel="noopener noreferrer"
  51. icon-right="discord"
  52. ></b-button>
  53. <b-button
  54. tag="a"
  55. type="is-icon"
  56. href="https://tornado-cash.medium.com"
  57. target="_blank"
  58. rel="noopener noreferrer"
  59. icon-right="medium"
  60. ></b-button>
  61. <b-button
  62. tag="a"
  63. type="is-icon"
  64. href="https://twitter.com/TornadoCash"
  65. target="_blank"
  66. rel="noopener noreferrer"
  67. icon-right="twitter"
  68. ></b-button>
  69. <b-button
  70. tag="a"
  71. type="is-icon"
  72. href="https://t.me/TornadoCashOfficial"
  73. target="_blank"
  74. rel="noopener noreferrer"
  75. icon-right="telegram"
  76. ></b-button>
  77. <b-button
  78. tag="a"
  79. type="is-icon"
  80. href="https://github.com/tornadocash"
  81. target="_blank"
  82. rel="noopener noreferrer"
  83. icon-right="github"
  84. ></b-button>
  85. <div class="break"></div>
  86. <b-dropdown
  87. v-model="$i18n.locale"
  88. class="dropdown-langs"
  89. position="is-top-left"
  90. aria-role="list"
  91. @change="langChange"
  92. >
  93. <b-button slot="trigger" type="is-icon">
  94. <FlagIcon :code="$i18n.locale" :class="'is-active-locale-' + $i18n.locale" />
  95. </b-button>
  96. <b-dropdown-item
  97. v-for="locale in locales"
  98. :key="locale"
  99. :value="locale"
  100. aria-role="listitem"
  101. >
  102. <FlagIcon :code="locale" />
  103. {{ printLang(locale) }}
  104. </b-dropdown-item>
  105. </b-dropdown>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </footer>
  113. </template>
  114. <script>
  115. import { mapGetters } from 'vuex'
  116. import { FlagIcon } from '@/components/icons'
  117. import { LOCALES_NAMES, DONATIONS_ADDRESS } from '@/constants'
  118. export default {
  119. components: {
  120. FlagIcon
  121. },
  122. data() {
  123. return {
  124. commit: process.env.commit,
  125. donationsAddress: DONATIONS_ADDRESS
  126. }
  127. },
  128. computed: {
  129. ...mapGetters('metamask', ['networkConfig', 'netId']),
  130. ...mapGetters('txHashKeeper', ['addressExplorerUrl']),
  131. duneLink() {
  132. const mainnetNetworks = [1, 5]
  133. if (mainnetNetworks.includes(Number(this.netId))) {
  134. return 'https://dune.xyz/poma/tornado-cash_1'
  135. }
  136. return 'https://dune.xyz/fennec/Tornado-Cash-Cross-chain-Dashboard'
  137. },
  138. locales() {
  139. return this.$i18n.availableLocales
  140. }
  141. },
  142. methods: {
  143. langChange(lang) {
  144. localStorage.setItem('lang', lang)
  145. if (lang === 'zh') {
  146. lang += '-cn'
  147. }
  148. this.$moment.locale(lang)
  149. this.$numbro.setLanguage(LOCALES_NAMES[lang])
  150. },
  151. printLang(lang) {
  152. let code = lang
  153. switch (code) {
  154. case 'zh':
  155. code = 'cn'
  156. break
  157. }
  158. return code.toUpperCase()
  159. }
  160. }
  161. }
  162. </script>