logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

notification_filters.vue (4231B)


  1. <template>
  2. <Popover
  3. trigger="click"
  4. class="NotificationFilters"
  5. placement="bottom"
  6. :bound-to="{ x: 'container' }"
  7. >
  8. <template #content>
  9. <div class="dropdown-menu">
  10. <div class="menu-item dropdown-item -icon">
  11. <button
  12. class="main-button"
  13. @click="toggleNotificationFilter('likes')"
  14. >
  15. <span
  16. class="input menu-checkbox"
  17. :class="{ 'menu-checkbox-checked': filters.likes }"
  18. />{{ $t('settings.notification_visibility_likes') }}
  19. </button>
  20. </div>
  21. <div class="menu-item dropdown-item -icon">
  22. <button
  23. class="main-button"
  24. @click="toggleNotificationFilter('repeats')"
  25. >
  26. <span
  27. class="input menu-checkbox"
  28. :class="{ 'menu-checkbox-checked': filters.repeats }"
  29. />{{ $t('settings.notification_visibility_repeats') }}
  30. </button>
  31. </div>
  32. <div class="menu-item dropdown-item -icon">
  33. <button
  34. class="main-button"
  35. @click="toggleNotificationFilter('follows')"
  36. >
  37. <span
  38. class="input menu-checkbox"
  39. :class="{ 'menu-checkbox-checked': filters.follows }"
  40. />{{ $t('settings.notification_visibility_follows') }}
  41. </button>
  42. </div>
  43. <div class="menu-item dropdown-item -icon">
  44. <button
  45. class="main-button"
  46. @click="toggleNotificationFilter('mentions')"
  47. >
  48. <span
  49. class="input menu-checkbox"
  50. :class="{ 'menu-checkbox-checked': filters.mentions }"
  51. />{{ $t('settings.notification_visibility_mentions') }}
  52. </button>
  53. </div>
  54. <div class="menu-item dropdown-item -icon">
  55. <button
  56. class="main-button"
  57. @click="toggleNotificationFilter('statuses')"
  58. >
  59. <span
  60. class="input menu-checkbox"
  61. :class="{ 'menu-checkbox-checked': filters.statuses }"
  62. />{{ $t('settings.notification_visibility_statuses') }}
  63. </button>
  64. </div>
  65. <div class="menu-item dropdown-item -icon">
  66. <button
  67. class="main-button"
  68. @click="toggleNotificationFilter('emojiReactions')"
  69. >
  70. <span
  71. class="input menu-checkbox"
  72. :class="{ 'menu-checkbox-checked': filters.emojiReactions }"
  73. />{{ $t('settings.notification_visibility_emoji_reactions') }}
  74. </button>
  75. </div>
  76. <div class="menu-item dropdown-item -icon">
  77. <button
  78. class="main-button"
  79. @click="toggleNotificationFilter('moves')"
  80. >
  81. <span
  82. class="input menu-checkbox"
  83. :class="{ 'menu-checkbox-checked': filters.moves }"
  84. />{{ $t('settings.notification_visibility_moves') }}
  85. </button>
  86. </div>
  87. <div class="menu-item dropdown-item -icon">
  88. <button
  89. class="main-button"
  90. @click="toggleNotificationFilter('polls')"
  91. >
  92. <span
  93. class="input menu-checkbox"
  94. :class="{ 'menu-checkbox-checked': filters.polls }"
  95. />{{ $t('settings.notification_visibility_polls') }}
  96. </button>
  97. </div>
  98. </div>
  99. </template>
  100. <template #trigger>
  101. <button class="filter-trigger-button button-unstyled">
  102. <FAIcon icon="filter" />
  103. </button>
  104. </template>
  105. </Popover>
  106. </template>
  107. <script>
  108. import Popover from '../popover/popover.vue'
  109. import { library } from '@fortawesome/fontawesome-svg-core'
  110. import { faFilter } from '@fortawesome/free-solid-svg-icons'
  111. library.add(
  112. faFilter
  113. )
  114. export default {
  115. components: { Popover },
  116. computed: {
  117. filters () {
  118. return this.$store.getters.mergedConfig.notificationVisibility
  119. }
  120. },
  121. methods: {
  122. toggleNotificationFilter (type) {
  123. this.$store.dispatch('setOption', {
  124. name: 'notificationVisibility',
  125. value: {
  126. ...this.filters,
  127. [type]: !this.filters[type]
  128. }
  129. })
  130. }
  131. }
  132. }
  133. </script>