blob: f709976401ed84a25ce00832c66cdf0725b8f299 (
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
66
67
68
69
70
71
72
73
74
|
<template>
<div id="navbar">
<div id="repo-navbar" class="ms-4 ps-4">
<nav class="navbar navbar-expand navbar-dark">
<div class="container-fluid px-0">
<div class="collapse navbar-collapse">
<ul class="navbar-nav align-items-center flex-fill">
<li
v-for="(item, index) in nav_items" :key="index"
class="nav-item">
<router-link
class="nav-link fs-4" :class="{ active: activePage === item }"
:aria-current="(activePage === item) ? 'page' : ''" :to="'/' + repository + '/' + item">
{{ item }}
</router-link>
</li>
<li class="nav-item ms-auto me-4">
<RepositoryCloneDropdown :repository="repository" class="d-block" />
</li>
</ul>
</div>
</div>
</nav>
</div>
</div>
</template>
<script>
import RepositoryCloneDropdown from "@/components/RepositoryCloneDropdown";
export default {
name: "RepositoryNavbar",
props: {
repository: {
type: String,
required: true
},
activePage: {
type: String,
required: true
},
hasReadme: {
type: Boolean,
required: true
}
},
components: {
RepositoryCloneDropdown
},
data() {
return {
nav_items: [ "log", "refs", "tree" ]
};
},
watch: {
hasReadme() {
console.log("HEEEJ");
this.nav_items = [ "about" ].concat(this.nav_items);
}
}
};
</script>
<style lang="scss" scoped>
@use "../scss/colors";
@import "../scss/bootstrap";
@import "~bootstrap/scss/nav";
@import "~bootstrap/scss/navbar";
#navbar {
line-height: 0;
}
</style>
|