Skip to content

Commit e5af48a

Browse files
committed
refactor nav area
1 parent c770aaa commit e5af48a

File tree

1 file changed

+34
-10
lines changed

1 file changed

+34
-10
lines changed

src/WorkScreen.vue

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
<template>
22
<div class="grid app-grid-template h-screen">
33
<div style="grid-area: head; background-color: red">
4+
<h1>
5+
Gist User Script Manager
6+
</h1>
47
<AutoLogin/>
58
</div>
6-
<div style="grid-area: nav; background-color: green">
7-
<button @click="listQuery">refresh</button>
8-
<a v-for="entry in gistEntries" :key="entry.id" href="javascript:void(0)" @click="code = entry.code">
9-
{{ entry.name }}
10-
</a>
9+
<div style="grid-area: nav;" class="nav-grid-template">
10+
<button @click="listQuery" class="w-full mt-2 flex mr-3">
11+
<fa type="fab" icon="github" class="h-4 mr-2"/>
12+
refresh
13+
</button>
14+
<input type="text" v-model="filter" class="form-input w-full mt-2 mr-3"/>
15+
<div class="overflow-y-auto w-full mt-2 h-full h-full">
16+
<div v-for="entry in gistEntries" :key="entry.id" class="flex flex-wrap w-full mt-2">
17+
<a @click="code = entry.code" class="w-full cursor-pointer mr-2">{{ entry.name }}</a>
18+
<div class="w-full h-px border-gray-400 border-t border-solid mt-1 mr-2">&nbsp;</div>
19+
</div>
20+
</div>
1121
</div>
1222
<div style="grid-area: main; background-color: yellow">
1323
<MonacoEditor :code="code" style="height: calc(100% - 50px)"/>
@@ -33,7 +43,7 @@ interface GistEntries {
3343
3444
export const gistEntries = ref<GistEntries[]>([]);
3545
export const listQuery = async () => {
36-
gistEntries.value = (await graphQlClient.value<List>(listGql)).viewer.gists.edges.map(({node}) => ({
46+
gistEntries.value = (await graphQlClient.value<List>(listGql))?.viewer.gists.edges.map(({node}) => ({
3747
id: node.name,
3848
name: node.files[0].name,
3949
code: node.files[0].text
@@ -42,6 +52,8 @@ export const listQuery = async () => {
4252
4353
export const code = ref<string>("");
4454
55+
export const filter = ref<string>("");
56+
4557
onMounted(() => {
4658
listQuery();
4759
});
@@ -51,10 +63,22 @@ onMounted(() => {
5163
<style scoped>
5264
.app-grid-template {
5365
grid-template-areas:
54-
"head head"
55-
"nav main";
56-
grid-template-rows: 70px 1fr;
57-
grid-template-columns: 150px 1fr;
66+
"head head head"
67+
". nav main";
68+
grid-template-rows: 70px minmax(0, 1fr);
69+
grid-template-columns: 8px 160px 1fr;
70+
height: 100vh;
71+
max-height: 100%;
72+
overflow-y: hidden;
73+
}
74+
.nav-grid-template {
75+
display: grid;
76+
grid-template-areas:
77+
"button"
78+
"filter"
79+
"result";
80+
grid-template-rows: auto auto 1fr;
81+
height: 100%;
5882
}
5983
</style>
6084

0 commit comments

Comments
 (0)