diff options
author | HampusM <hampus@hampusmat.com> | 2021-06-09 22:06:45 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-06-09 22:06:45 +0200 |
commit | 55ab996795efdb125437d5728b50d03ac5d2612d (patch) | |
tree | fe0de086fdf7062bed9251173add9609f631949a /packages/client/src/components | |
parent | de09be1b40a9338eb0e45bede01179a69f00269d (diff) |
Added an about page
Diffstat (limited to 'packages/client/src/components')
-rw-r--r-- | packages/client/src/components/RepositoryHeader.vue | 22 | ||||
-rw-r--r-- | packages/client/src/components/RepositoryNavbar.vue | 17 |
2 files changed, 21 insertions, 18 deletions
diff --git a/packages/client/src/components/RepositoryHeader.vue b/packages/client/src/components/RepositoryHeader.vue index 9f37df4..50a1db9 100644 --- a/packages/client/src/components/RepositoryHeader.vue +++ b/packages/client/src/components/RepositoryHeader.vue @@ -12,33 +12,21 @@ <script> import BaseBackButton from "@/components/BaseBackButton"; -import { ref } from "vue"; export default { name: "RepositoryHeader", props: { - repository: { + name: { + type: String, + required: true + }, + description: { type: String, required: true } }, components: { BaseBackButton - }, - setup(props) { - const name = ref(""); - const description = ref(""); - - const fetchProjects = async() => { - const repository_data = await (await fetch(`${window.location.protocol}//${window.location.host}/api/v1/repos/${props.repository}`)).json(); - name.value = repository_data.data.name; - description.value = repository_data.data.description; - }; - - return { name, description, fetchProjects }; - }, - created() { - this.fetchProjects(); } }; </script> diff --git a/packages/client/src/components/RepositoryNavbar.vue b/packages/client/src/components/RepositoryNavbar.vue index c69762f..f709976 100644 --- a/packages/client/src/components/RepositoryNavbar.vue +++ b/packages/client/src/components/RepositoryNavbar.vue @@ -6,7 +6,7 @@ <div class="collapse navbar-collapse"> <ul class="navbar-nav align-items-center flex-fill"> <li - v-for="(item, index) in ['log', 'refs', 'tree']" :key="index" + v-for="(item, index) in nav_items" :key="index" class="nav-item"> <router-link class="nav-link fs-4" :class="{ active: activePage === item }" @@ -38,10 +38,25 @@ export default { 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> |