logo

pleroma-fe

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

navigation_entry.vue (3242B)


  1. <template>
  2. <OptionalRouterLink
  3. v-slot="{ isActive, href, navigate } = {}"
  4. :to="routeTo"
  5. >
  6. <li
  7. class="NavigationEntry menu-item"
  8. :class="{ '-active': isActive }"
  9. v-bind="$attrs"
  10. >
  11. <component
  12. :is="routeTo ? 'a' : 'button'"
  13. class="main-link"
  14. :href="href"
  15. @click="navigate"
  16. >
  17. <span>
  18. <FAIcon
  19. v-if="item.icon"
  20. fixed-width
  21. class="fa-scale-110 menu-icon"
  22. :icon="item.icon"
  23. />
  24. </span>
  25. <img
  26. v-if="item.iconEmojiUrl"
  27. class="menu-icon iconEmoji iconEmoji-image"
  28. :src="item.iconEmojiUrl"
  29. :alt="item.iconEmoji"
  30. :title="item.iconEmoji"
  31. >
  32. <span
  33. v-else-if="item.iconEmoji"
  34. class="menu-icon iconEmoji"
  35. >
  36. <span>
  37. {{ item.iconEmoji }}
  38. </span>
  39. </span>
  40. <span
  41. v-else-if="item.iconLetter"
  42. class="icon iconLetter fa-scale-110 menu-icon"
  43. >{{ item.iconLetter }}</span>
  44. <span class="label">
  45. {{ item.labelRaw || $t(item.label) }}
  46. </span>
  47. </component>
  48. <slot />
  49. <div
  50. v-if="item.badgeGetter && getters[item.badgeGetter]"
  51. class="badge"
  52. :class="[`-${item.badgeStyle}`]"
  53. >
  54. {{ getters[item.badgeGetter] }}
  55. </div>
  56. <button
  57. v-if="showPin && currentUser"
  58. type="button"
  59. class="button-unstyled extra-button"
  60. :title="$t(isPinned ? 'general.unpin' : 'general.pin' )"
  61. :aria-pressed="!!isPinned"
  62. @click.stop.prevent="togglePin(item.name)"
  63. >
  64. <FAIcon
  65. v-if="showPin && currentUser"
  66. fixed-width
  67. class="fa-scale-110"
  68. :class="{ 'veryfaint': !isPinned(item.name) }"
  69. :transform="!isPinned(item.name) ? 'rotate-45' : ''"
  70. icon="thumbtack"
  71. />
  72. </button>
  73. </li>
  74. </OptionalRouterLink>
  75. </template>
  76. <script src="./navigation_entry.js"></script>
  77. <style lang="scss">
  78. .NavigationEntry.menu-item {
  79. --__line-height: 2.5em;
  80. --__horizontal-gap: 0.5em;
  81. --__vertical-gap: 0.4em;
  82. padding: var(--__vertical-gap) var(--__horizontal-gap);
  83. display: grid;
  84. grid-template-columns: 1fr;
  85. grid-auto-columns: var(--__line-height);
  86. grid-auto-flow: column;
  87. grid-gap: var(--__horizontal-gap);
  88. align-items: baseline;
  89. &[aria-expanded] {
  90. padding-right: var(--__horizontal-gap);
  91. }
  92. .main-link {
  93. line-height: var(--__line-height);
  94. box-sizing: border-box;
  95. }
  96. .menu-icon {
  97. line-height: var(--__line-height);
  98. padding: 0;
  99. width: var(--__line-height);
  100. margin-right: var(--__horizontal-gap);
  101. }
  102. .timelines-chevron,
  103. .extra-button {
  104. line-height: var(--__line-height);
  105. width: 100%;
  106. padding: 0;
  107. text-align: center;
  108. }
  109. .badge {
  110. justify-self: center;
  111. }
  112. .iconEmoji {
  113. display: inline-block;
  114. text-align: center;
  115. object-fit: contain;
  116. vertical-align: middle;
  117. height: var(--__line-height);
  118. width: var(--__line-height);
  119. > span {
  120. font-size: 1.5rem;
  121. }
  122. }
  123. img.iconEmoji {
  124. padding: 0.25rem;
  125. box-sizing: border-box;
  126. }
  127. }
  128. </style>