logo

pleroma-fe

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

retweet_button.vue (2960B)


  1. <template>
  2. <div class="RetweetButton">
  3. <button
  4. v-if="visibility !== 'private' && visibility !== 'direct' && loggedIn"
  5. class="button-unstyled interactive"
  6. :class="status.repeated && '-repeated'"
  7. :title="$t('tool_tip.repeat')"
  8. @click.prevent="retweet()"
  9. >
  10. <FALayers class="fa-old-padding-layer">
  11. <FAIcon
  12. class="fa-scale-110"
  13. icon="retweet"
  14. :spin="animated"
  15. />
  16. <FAIcon
  17. v-if="status.repeated"
  18. class="active-marker"
  19. transform="shrink-6 up-9 right-12"
  20. icon="check"
  21. />
  22. <FAIcon
  23. v-if="!status.repeated"
  24. class="focus-marker"
  25. transform="shrink-6 up-9 right-12"
  26. icon="plus"
  27. />
  28. <FAIcon
  29. v-else
  30. class="focus-marker"
  31. transform="shrink-6 up-9 right-12"
  32. icon="minus"
  33. />
  34. </FALayers>
  35. </button>
  36. <span v-else-if="loggedIn">
  37. <FAIcon
  38. class="fa-scale-110 fa-old-padding"
  39. icon="lock"
  40. :title="$t('timeline.no_retweet_hint')"
  41. />
  42. </span>
  43. <a
  44. v-else
  45. class="button-unstyled interactive"
  46. target="_blank"
  47. role="button"
  48. :title="$t('tool_tip.repeat')"
  49. :href="remoteInteractionLink"
  50. >
  51. <FALayers class="fa-old-padding-layer">
  52. <FAIcon
  53. class="fa-scale-110"
  54. icon="retweet"
  55. />
  56. <FAIcon
  57. class="focus-marker"
  58. transform="shrink-6 up-9 right-12"
  59. icon="plus"
  60. />
  61. </FALayers>
  62. </a>
  63. <span
  64. v-if="!mergedConfig.hidePostStats && status.repeat_num > 0"
  65. class="no-event"
  66. >
  67. {{ status.repeat_num }}
  68. </span>
  69. <teleport to="#modal">
  70. <confirm-modal
  71. v-if="showingConfirmDialog"
  72. :title="$t('status.repeat_confirm_title')"
  73. :confirm-text="$t('status.repeat_confirm_accept_button')"
  74. :cancel-text="$t('status.repeat_confirm_cancel_button')"
  75. @accepted="doRetweet"
  76. @cancelled="hideConfirmDialog"
  77. >
  78. {{ $t('status.repeat_confirm') }}
  79. </confirm-modal>
  80. </teleport>
  81. </div>
  82. </template>
  83. <script src="./retweet_button.js"></script>
  84. <style lang="scss">
  85. @import "../../mixins";
  86. .RetweetButton {
  87. display: flex;
  88. > :first-child {
  89. padding: 10px;
  90. margin: -10px -8px -10px -10px;
  91. }
  92. .action-counter {
  93. pointer-events: none;
  94. user-select: none;
  95. }
  96. .interactive {
  97. .svg-inline--fa {
  98. animation-duration: 0.6s;
  99. }
  100. &:hover .svg-inline--fa,
  101. &.-repeated .svg-inline--fa {
  102. color: var(--cGreen);
  103. }
  104. @include unfocused-style {
  105. .focus-marker {
  106. visibility: hidden;
  107. }
  108. .active-marker {
  109. visibility: visible;
  110. }
  111. }
  112. @include focused-style {
  113. .focus-marker {
  114. visibility: visible;
  115. }
  116. .active-marker {
  117. visibility: hidden;
  118. }
  119. }
  120. }
  121. }
  122. </style>