summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/super_sidebar/components/super_sidebar.vue
blob: e2eac64f5adb04c18db79e8d6ad472286f24bc61 (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
<script>
import { GlCollapse } from '@gitlab/ui';
import { context } from '../mock_data';
import UserBar from './user_bar.vue';
import ContextSwitcherToggle from './context_switcher_toggle.vue';
import ContextSwitcher from './context_switcher.vue';
import BottomBar from './bottom_bar.vue';

export default {
  context,
  components: {
    GlCollapse,
    UserBar,
    ContextSwitcherToggle,
    ContextSwitcher,
    BottomBar,
  },
  props: {
    sidebarData: {
      type: Object,
      required: true,
    },
  },
  data() {
    return {
      contextSwitcherOpened: false,
    };
  },
};
</script>

<template>
  <aside
    class="super-sidebar gl-fixed gl-bottom-0 gl-left-0 gl-display-flex gl-flex-direction-column gl-bg-gray-10 gl-border-r gl-border-gray-a-08 gl-z-index-9999"
    data-testid="super-sidebar"
  >
    <user-bar :sidebar-data="sidebarData" />
    <div class="gl-display-flex gl-flex-direction-column gl-flex-grow-1 gl-overflow-hidden">
      <div class="gl-flex-grow-1 gl-overflow-auto">
        <context-switcher-toggle :context="$options.context" :expanded="contextSwitcherOpened" />
        <gl-collapse id="context-switcher" v-model="contextSwitcherOpened">
          <context-switcher />
        </gl-collapse>
      </div>
      <div class="gl-px-3">
        <bottom-bar />
      </div>
    </div>
  </aside>
</template>