summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/color_select_dropdown/dropdown_value.vue
blob: 4cba66eefd22a0d12079f77c5d6655428e19ebd0 (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
<script>
import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { COLOR_WIDGET_COLOR } from './constants';
import ColorItem from './color_item.vue';

export default {
  i18n: {
    dropdownTitle: COLOR_WIDGET_COLOR,
  },
  directives: {
    GlTooltip: GlTooltipDirective,
  },
  components: {
    GlIcon,
    ColorItem,
  },
  props: {
    selectedColor: {
      type: Object,
      required: true,
    },
  },
};
</script>

<template>
  <div class="value js-value">
    <div
      v-gl-tooltip.left.viewport
      :title="$options.i18n.dropdownTitle"
      class="sidebar-collapsed-icon"
    >
      <gl-icon name="appearance" />
      <color-item
        :color="selectedColor.color"
        :title="selectedColor.title"
        class="gl-font-base gl-line-height-24"
      />
    </div>

    <color-item class="hide-collapsed" :color="selectedColor.color" :title="selectedColor.title" />
  </div>
</template>