aboutsummaryrefslogtreecommitdiff
path: root/src/components/navigation/navigation_pins.vue
blob: f421b2be27990d16334531ec3f53568835de202c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<template>
  <span class="NavigationPins">
    <router-link
      v-for="item in pinnedList" :key="item.name" class="pinned-item"
      :to="item.routeObject || { name: (currentUser || item.anon) ? item.route : item.anonRoute, params: { username: currentUser.screen_name } }"
      >
      <FAIcon
        v-if="item.icon"
        fixed-width
        :icon="item.icon"
            />
      <span
        v-if="item.iconLetter"
        class="iconLetter fa-scale-110 fa-old-padding"
        >{{ item.iconLetter }}</span>
      <div
        v-if="item.badgeGetter && getters[item.badgeGetter]"
        class="alert-dot"
        />
    </router-link>
  </span>
</template>

<script src="./navigation_pins.js"></script>

<style lang="scss">
@import '../../_variables.scss';
.NavigationPins {
  display: flex;
  overflow: hidden;

  .alert-dot {
    border-radius: 100%;
    height: 0.5em;
    width: 0.5em;
    position: absolute;
    right: calc(50% - 0.25em);
    top: calc(50% - 0.25em);
    margin-left: 6px;
    margin-top: -6px;
    background-color: $fallback--cRed;
    background-color: var(--badgeNotification, $fallback--cRed);
  }

  .pinned-item {
    position: relative;
    flex: 0 0 3em;
    min-width: 2em;
    text-align: center;

    & .svg-inline--fa,
    & .iconLetter {
      margin: 0;
    }

    &.router-link-active {
      & .svg-inline--fa,
      & .iconLetter {
        color: $fallback--text;
        color: var(--selectedMenuText, $fallback--text);
      }
    }
  }
}
</style>