Skip to content

Commit cba6002

Browse files
committed
refactor(FileExplorer): update styling and display
1 parent f85e061 commit cba6002

File tree

2 files changed

+33
-58
lines changed

2 files changed

+33
-58
lines changed

src/editor/FileExplorer.vue

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
11
<template>
22
<v-navigation-drawer v-model="store.state.showFileExplorer" :width="240">
3-
<v-list-item height="43px">
3+
<v-list-item class="px-2">
44
<template v-slot:prepend>
55
<v-btn
6-
class="px-0 rounded-md"
76
variant="flat"
87
size="small"
9-
min-width="30px"
8+
:icon="`svg:${mdiDockLeft}`"
109
@click="store.state.showFileExplorer = false"
11-
>
12-
<IconPanelLeftClose />
13-
</v-btn>
10+
></v-btn>
1411
</template>
12+
1513
<template v-slot:append>
1614
<v-btn
17-
class="px-0 rounded-md"
18-
variant="flat"
15+
variant="text"
1916
size="small"
20-
min-width="30px"
17+
:append-icon="`svg:${mdiFilePlusOutline}`"
18+
text="Add File"
19+
border
20+
slim
2121
@click="startAddFile"
22-
>
23-
<v-icon :size="24" :icon="`svg:${mdiFilePlusOutline}`" />
24-
</v-btn>
22+
></v-btn>
2523
</template>
2624
</v-list-item>
2725

2826
<v-divider />
2927

3028
<v-list
3129
:selected="[activeFile]"
32-
class="py-1 px-1 overflow-y-scroll file-list"
30+
class="py-1 px-1 overflow-y-auto d-flex flex-column ga-1"
3331
density="compact"
34-
:style="{ 'max-height': 'calc(100% - 44px)' }"
32+
max-height="calc(100% - 44px)"
3533
>
3634
<v-list-item
3735
v-for="file in files"
3836
:key="file"
3937
:value="file"
4038
rounded
39+
:title="stripSrcPrefix(file)"
4140
slim
4241
@click="activeFile = file"
4342
>
@@ -48,44 +47,38 @@
4847
size="small"
4948
/>
5049
</template>
51-
<v-list-item-title :title="stripSrcPrefix(file)" class="file-name">
52-
{{ stripSrcPrefix(file) }}
53-
</v-list-item-title>
50+
5451
<template v-slot:append>
5552
<v-icon-btn
5653
icon="$close"
57-
size="26px"
58-
icon-size="20px"
59-
variant="text"
54+
size="26"
55+
icon-size="14"
56+
variant="plain"
6057
@click.stop="store.deleteFile(file)"
6158
/>
6259
</template>
6360
</v-list-item>
6461

65-
<v-list-item
62+
<v-text-field
6663
v-if="pending"
67-
:prepend-icon="`svg:${getFileIcon(pendingFilename)}`"
68-
slim
69-
>
70-
<v-list-item-title>
71-
<v-text-field
72-
v-model="pendingFilename"
73-
density="compact"
74-
hide-details
75-
autofocus
76-
single-line
77-
base-color="primary"
78-
color="primary"
79-
@blur="doneNameFile"
80-
@keyup.enter="doneNameFile"
81-
@keyup.esc="cancelNameFile"
82-
/>
83-
</v-list-item-title>
84-
</v-list-item>
64+
v-model="pendingFilename"
65+
density="compact"
66+
hide-details
67+
autofocus
68+
single-line
69+
:prepend-inner-icon="`svg:${getFileIcon(pendingFilename)}`"
70+
base-color="primary"
71+
color="primary"
72+
variant="outlined"
73+
@blur="doneNameFile"
74+
@keyup.enter="doneNameFile"
75+
@keyup.esc="cancelNameFile"
76+
/>
8577
</v-list>
8678

8779
<template v-slot:append>
8880
<v-divider />
81+
8982
<v-list
9083
:selected="[activeFile]"
9184
@update:selected="activeFile = $event[0] ?? activeFile"
@@ -127,12 +120,12 @@ import type { Store } from 'src/store'
127120
import { inject } from 'vue'
128121
import { useFileSelector } from '../composables/useFileSelector'
129122
import { VIconBtn } from 'vuetify/labs/components'
130-
import IconPanelLeftClose from '../icons/IconPanelLeftClose.vue'
131123
import {
132124
mdiFilePlusOutline,
133125
mdiLanguageTypescript,
134126
mdiMap,
135127
mdiLink,
128+
mdiDockLeft,
136129
} from '@mdi/js'
137130
138131
const store = inject('store') as Store

src/icons/IconPanelLeftClose.vue

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)