(private repo) display if fav repo is priva…

This commit is contained in:
2021-03-19 23:54:20 +01:00
parent 68fdc6fda3
commit 2bd9cb8dd0
2 changed files with 78 additions and 50 deletions

View File

@@ -19,11 +19,13 @@ export const useRepos = () => {
per_page: 100 per_page: 100
}) })
return repoList.data.items.map((item) => ({ return repoList.data.items
.map((item) => ({
id: `${item.id}`, id: `${item.id}`,
name: item.name, name: item.name,
isPrivate: item.private isPrivate: item.private
})) }))
.sort((a, b) => (a.name < b.name ? -1 : 1))
}, []) }, [])
return { return {

View File

@@ -1,11 +1,21 @@
<template> <template>
<div class="repo-list"> <div class="repo-list">
<go-back />
<h1 class="title is-1">Repositories</h1> <h1 class="title is-1">Repositories</h1>
<go-back />
<span v-if="!isReady">loading...</span> <span v-if="!isReady">loading...</span>
<div v-else class="columns is-centered"> <div v-else class="columns is-centered">
<div class="column is-one-third"> <div class="column is-one-third">
<table class="table is-striped is-hoverable is-fullwidth"> <table
class="table is-striped is-hoverable"
v-if="favoriteRepos.length > 0"
>
<thead>
<tr>
<th></th>
<th>Favorites</th>
</tr>
</thead>
<tbody>
<tr v-for="repo in favoriteRepos" :key="repo.id"> <tr v-for="repo in favoriteRepos" :key="repo.id">
<td> <td>
<input <input
@@ -29,6 +39,17 @@
</router-link> </router-link>
</td> </td>
</tr> </tr>
</tbody>
</table>
<br v-if="favoriteRepos.length > 0" />
<table class="table is-striped is-hoverable">
<thead>
<tr>
<th></th>
<th>Repos</th>
</tr>
</thead>
<tbody>
<tr v-for="repo in otherRepos" :key="repo.id"> <tr v-for="repo in otherRepos" :key="repo.id">
<td> <td>
<input <input
@@ -50,6 +71,7 @@
</router-link> </router-link>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</div> </div>
</div> </div>
@@ -95,5 +117,9 @@ export default defineComponent({
text-align: center; text-align: center;
overflow-y: auto; overflow-y: auto;
table {
margin: auto;
}
} }
</style> </style>