Skip to content

Commit f9f2ec1

Browse files
committed
chore: fix nav bar
1 parent f9f3682 commit f9f2ec1

File tree

5 files changed

+48
-47
lines changed

5 files changed

+48
-47
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ packages/kit/skills
1919
*.tsbuildinfo
2020
docs/.vitepress/cache
2121
.turbo
22+
.context

packages/self-inspect/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"sideEffects": false,
2020
"exports": {
2121
".": "./dist/index.mjs",
22-
"./dirs": "./dist/dirs.mjs",
2322
"./package.json": "./package.json"
2423
},
2524
"types": "./dist/index.d.mts",
Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,22 @@
11
<script setup lang="ts">
22
import { useHead } from '#app/composables/head'
3-
import PanelSideNav from '@vitejs/devtools-ui/components/PanelSideNav.vue'
4-
import { useSideNav } from '@vitejs/devtools-ui/composables/nav'
3+
import { toggleDark } from '@vitejs/devtools-ui/composables/dark'
54
import { useRefresh } from './composables/refresh'
65
import { connect, connectionState } from './composables/rpc'
76
import './styles/global.css'
8-
import '@vitejs/devtools-ui/composables/dark'
97
108
useHead({
119
title: 'DevTools Self Inspect',
1210
})
1311
1412
connect()
1513
16-
useSideNav([
17-
{
18-
title: 'RPC Functions',
19-
to: '/rpc',
20-
icon: 'i-ph-plugs-connected-duotone',
21-
},
22-
{
23-
title: 'Docks',
24-
to: '/docks',
25-
icon: 'i-ph-layout-duotone',
26-
},
27-
{
28-
title: 'Client Scripts',
29-
to: '/scripts',
30-
icon: 'i-ph-code-duotone',
31-
},
32-
{
33-
title: 'DevTools Plugins',
34-
to: '/plugins',
35-
icon: 'i-ph-puzzle-piece-duotone',
36-
},
37-
])
14+
const navItems = [
15+
{ title: 'RPC Functions', to: '/rpc', icon: 'i-ph-plugs-connected-duotone' },
16+
{ title: 'Docks', to: '/docks', icon: 'i-ph-layout-duotone' },
17+
{ title: 'Client Scripts', to: '/scripts', icon: 'i-ph-code-duotone' },
18+
{ title: 'Plugins', to: '/plugins', icon: 'i-ph-puzzle-piece-duotone' },
19+
]
3820
3921
const { refresh, loading } = useRefresh()
4022
</script>
@@ -47,25 +29,45 @@ const { refresh, loading } = useRefresh()
4729
v-else-if="!connectionState.connected"
4830
text="Connecting..."
4931
/>
50-
<div v-else h-vh w-screen max-w-screen max-h-screen of-hidden>
51-
<PanelSideNav />
52-
<div pl-12 h-full flex="~ col" of-hidden>
53-
<div flex="~ items-center justify-end" border="b base" px3 h8 shrink-0>
54-
<button
55-
p1.5 rounded
56-
hover:bg-active
57-
op50 hover:op100
58-
transition-colors
59-
title="Refresh"
60-
:disabled="loading"
61-
@click="refresh"
62-
>
63-
<span i-ph-arrow-clockwise text-sm :class="loading ? 'animate-spin' : ''" />
64-
</button>
65-
</div>
66-
<div flex-1 of-auto>
67-
<NuxtPage />
68-
</div>
32+
<div v-else h-vh flex="~ col" of-hidden>
33+
<div flex="~ items-center" border="b base" h9 shrink-0>
34+
<NuxtLink
35+
v-for="item in navItems" :key="item.to"
36+
:to="item.to"
37+
flex="~ items-center gap-1.5"
38+
px3 h-full text-sm
39+
op50 hover:op100 transition-colors
40+
border="b-2 transparent"
41+
active-class="op100! border-b-primary!"
42+
>
43+
<span :class="item.icon" text-base />
44+
<span>{{ item.title }}</span>
45+
</NuxtLink>
46+
<div flex-1 />
47+
<button
48+
mr2 p1.5 rounded
49+
hover:bg-active
50+
op50 hover:op100
51+
transition-colors
52+
title="Refresh"
53+
:disabled="loading"
54+
@click="refresh"
55+
>
56+
<span i-ph-arrow-clockwise text-sm :class="loading ? 'animate-spin' : ''" />
57+
</button>
58+
<button
59+
mr2 p1.5 rounded
60+
hover:bg-active
61+
op50 hover:op100
62+
transition-colors
63+
title="Toggle dark mode"
64+
@click="toggleDark"
65+
>
66+
<span class="i-ph-sun-duotone dark:i-ph-moon-duotone" text-sm />
67+
</button>
68+
</div>
69+
<div flex-1 of-auto>
70+
<NuxtPage />
6971
</div>
7072
</div>
7173
</template>

packages/self-inspect/src/app/styles/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ html {
1717
}
1818
html.dark {
1919
color-scheme: dark;
20-
background-color: black;
20+
background-color: #121212;
2121
}
2222
body {
2323
--uno: color-base;

packages/self-inspect/tsdown.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { defineConfig } from 'tsdown'
33
export default defineConfig({
44
entry: {
55
index: 'src/index.ts',
6-
dirs: 'src/dirs.ts',
76
},
87
tsconfig: '../../tsconfig.base.json',
98
target: 'esnext',

0 commit comments

Comments
 (0)