Skip to content

Commit dfd5e63

Browse files
committed
refactor: update UI components for Nuxt UI 4
1 parent 6ab0a70 commit dfd5e63

6 files changed

Lines changed: 84 additions & 42 deletions

File tree

src/app.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
export default defineAppConfig({
22
ui: {
3-
primary: 'sky',
4-
gray: 'cool',
3+
colors: {
4+
primary: 'sky',
5+
neutral: 'slate',
6+
}
57
}
68
})

src/app.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<template>
2-
<NuxtLayout>
3-
<NuxtPage />
4-
</NuxtLayout>
5-
</template>
2+
<UApp>
3+
<NuxtLayout>
4+
<NuxtPage />
5+
</NuxtLayout>
6+
</UApp>
7+
</template>

src/components/AppHeader.vue

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
<template>
22
<UpdateBanner />
3-
<header class="border-b border-gray-200 dark:border-gray-800">
4-
<div class="logo">WoWthing Sync</div>
5-
<UHorizontalNavigation :links="links" />
3+
<header class="border-b border-gray-200 dark:border-gray-800 bg-gray-100 dark:bg-gray-900">
4+
<div class="mx-auto flex w-full max-w-5xl items-center gap-6 pl-6 pr-4 pt-2">
5+
<p class="text-2xl font-semibold tracking-tight text-slate-900 dark:text-white">
6+
WoWthing Sync
7+
</p>
8+
<div class="ml-auto">
9+
<UNavigationMenu
10+
:items="navigationItems"
11+
highlight
12+
variant="pill"
13+
class="justify-end"
14+
/>
15+
</div>
16+
</div>
617
</header>
718
</template>
819

920
<script lang="ts" setup>
10-
const links = [
21+
import type { NavigationMenuItem } from '@nuxt/ui';
22+
23+
const navigationItems = [
1124
{ label: 'Dashboard', to: '/' },
1225
{ label: 'Settings', to: '/settings' },
13-
];
26+
] satisfies NavigationMenuItem[];
1427
</script>
15-
16-
<style scoped>
17-
header {
18-
display: flex;
19-
align-items: center;
20-
}
21-
22-
.logo {
23-
white-space: nowrap;
24-
margin-bottom: 4px;
25-
font-size: 25px;
26-
user-select: none;
27-
padding: 10px 50px 10px 30px;
28-
}
29-
</style>

src/layouts/default.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
2-
<div>
2+
<div class="pb-14">
33
<AppHeader />
4-
<main>
4+
<main class="mx-auto w-full max-w-5xl px-6 py-6">
55
<slot />
66
</main>
77
<AppFooter />
88
</div>
9-
</template>
9+
</template>

src/pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="container py-16">
2+
<div class="container py-10">
33
<div class="text-center">
44
<h1 class="mb-5">Addon Sync</h1>
55

src/pages/settings.vue

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,78 @@
11
<template>
2-
<div class="container pt-5">
3-
<h1 class="mb-5">Settings</h1>
2+
<div class="space-y-6">
3+
<h1>Settings</h1>
44

5-
<UFormGroup label="API Key" name="apiKey" help="Visit Settings -> Account to find your API Key." class="mb-6">
6-
<UInput v-model="apiKey" autocomplete="off" :ui="{ icon: { trailing: { pointer: '' } } }" :type="showPassword ? 'text' : 'password'">
5+
<UFormField
6+
label="API Key"
7+
name="apiKey"
8+
help="Visit Settings -> Account to find your API Key."
9+
class="w-full"
10+
>
11+
<UInput
12+
v-model="apiKey"
13+
autocomplete="off"
14+
class="w-full"
15+
:ui="{ icon: { trailing: { pointer: '' } } }"
16+
:type="showPassword ? 'text' : 'password'"
17+
>
718
<template #trailing>
819
<UButton
920
color="gray"
1021
variant="link"
1122
:icon="showPassword ? 'i-heroicons-eye-slash' : 'i-heroicons-eye'"
1223
:padded="false"
24+
class="cursor-pointer"
1325
@click="toggleShowPassword"
1426
/>
1527
</template>
1628
</UInput>
17-
</UFormGroup>
29+
</UFormField>
1830

19-
<UFormGroup label='World of Warcraft "_retail_" Folder' name="folder" class="mb-6">
20-
<UInput v-model="folder" readonly @click="openFolderDialog">
31+
<UFormField
32+
label='World of Warcraft "_retail_" Folder'
33+
name="folder"
34+
class="w-full"
35+
>
36+
<UInput
37+
v-model="folder"
38+
readonly
39+
class="w-full"
40+
:ui="{
41+
root: 'cursor-pointer',
42+
base: 'cursor-pointer select-none',
43+
trailing: 'cursor-pointer pointer-events-auto text-right'
44+
}"
45+
@click="openFolderDialog"
46+
>
2147
<template #trailing>
22-
<span class="text-gray-500 dark:text-gray-400 text-xs">Choose Directory</span>
48+
<span
49+
class="text-gray-500 dark:text-gray-400 text-xs cursor-pointer"
50+
@click.stop="openFolderDialog"
51+
>
52+
Choose Directory
53+
</span>
2354
</template>
2455
</UInput>
25-
</UFormGroup>
56+
</UFormField>
2657

27-
<UCheckbox label="Enable desktop notifications" v-model="notificationsEnabled" class="mb-2" />
58+
<div class="space-y-3">
59+
<UCheckbox
60+
label="Enable desktop notifications"
61+
v-model="notificationsEnabled"
62+
class="w-full justify-start"
63+
/>
2864

29-
<UCheckbox label="Launch WoWthing Sync when you start your computer" v-model="autoStart" class="mb-2" />
65+
<UCheckbox
66+
label="Launch WoWthing Sync when you start your computer"
67+
v-model="autoStart"
68+
class="w-full justify-start"
69+
/>
70+
</div>
3071
</div>
3172
</template>
3273

3374
<script setup lang="ts">
3475
import { open } from '@tauri-apps/plugin-dialog';
35-
import { enable, isEnabled, disable } from "@tauri-apps/plugin-autostart";
3676
3777
const apiKey = useApiKeys();
3878
const autoStart = useAutoStart();

0 commit comments

Comments
 (0)