🐛 Fixes bugs in existing pages

This commit is contained in:
2025-11-29 11:10:05 +08:00
parent 54bf8cf915
commit adceb3a61b
4 changed files with 53 additions and 32 deletions

View File

@@ -7,8 +7,17 @@
:rows="5" :rows="5"
auto-grow auto-grow
></n-input> ></n-input>
<div class="flex justify-end mt-4"> <div class="flex justify-end mt-3">
<n-button append-icon="mdi-send" size="small">Send</n-button> <n-button type="primary">
<template #icon>
<n-icon :component="SendIcon" />
</template>
Send
</n-button>
</div> </div>
</n-card> </n-card>
</template> </template>
<script setup lang="ts">
import { SendIcon } from "lucide-vue-next"
</script>

View File

@@ -3,34 +3,29 @@
<header <header
class="navbar bg-transparent shadow-lg fixed top-0 left-0 right-0 backdrop-blur-2xl z-1000 h-[64px]" class="navbar bg-transparent shadow-lg fixed top-0 left-0 right-0 backdrop-blur-2xl z-1000 h-[64px]"
> >
<div class="container mx-auto flex items-center"> <div class="container mx-auto flex items-center justify-between px-5">
<img <div class="flex gap-2">
:src="IconLight" <div class="flex items-center justify-center w-[40px]">
width="32" <img :src="IconLight" alt="The Solar Network" class="fit-cover" />
height="32" </div>
class="mr-4"
alt="The Solar Network"
/>
<n-menu <n-menu
v-model:value="activeKey" v-model:value="activeKey"
mode="horizontal" mode="horizontal"
:options="menuOptions" :options="menuOptions"
/> />
</div>
<div class="grow" />
<n-dropdown :options="dropdownOptions" @select="handleDropdownSelect"> <n-dropdown :options="dropdownOptions" @select="handleDropdownSelect">
<n-avatar <n-avatar
round :size="32"
class="mr-4 cursor-pointer"
:src=" :src="
user?.profile.picture user?.profile.picture
? `${apiBase}/drive/files/${user?.profile.picture?.id}` ? `${apiBase}/drive/files/${user?.profile.picture?.id}`
: undefined : undefined
" "
> >
<n-icon :component="UserCircleIcon" /> <n-icon :component="UserIcon" :size="20" />
</n-avatar> </n-avatar>
</n-dropdown> </n-dropdown>
</div> </div>
@@ -47,8 +42,14 @@ import IconLight from "~/assets/images/cloudy-lamb.png"
import type { MenuOption } from "naive-ui" import type { MenuOption } from "naive-ui"
import { computed, h } from "vue" import { computed, h } from "vue"
import { useRouter, useRoute } from "vue-router" import { useRouter, useRoute, RouterLink } from "vue-router"
import { CompassIcon, UserCircleIcon } from "lucide-vue-next" import {
CompassIcon,
LayoutDashboardIcon,
LogInIcon,
UserIcon,
UserPlusIcon
} from "lucide-vue-next"
const apiBase = useSolarNetworkUrl() const apiBase = useSolarNetworkUrl()
const router = useRouter() const router = useRouter()
@@ -63,17 +64,18 @@ const activeKey = computed(() => {
}) })
function renderIcon(icon: any) { function renderIcon(icon: any) {
return () => h(NIcon, null, { default: () => icon }) return () => h(NIcon, null, { default: () => h(icon) })
}
function renderLabel(label: string, route: string) {
return () => h(RouterLink, { to: route }, { default: () => label })
} }
const menuOptions: MenuOption[] = [ const menuOptions: MenuOption[] = [
{ {
label: "Explore", label: renderLabel("Explore", "/"),
key: "explore", key: "explore",
icon: renderIcon(h(CompassIcon)), icon: renderIcon(CompassIcon)
props: {
onClick: () => router.push("/")
}
} }
] ]
@@ -83,7 +85,7 @@ const dropdownOptions = computed(() => {
{ {
label: "Dashboard", label: "Dashboard",
key: "/accounts/me", key: "/accounts/me",
icon: () => h("span", { class: "mdi mdi-view-dashboard" }) icon: renderIcon(LayoutDashboardIcon)
} }
] ]
} else { } else {
@@ -91,12 +93,12 @@ const dropdownOptions = computed(() => {
{ {
label: "Login", label: "Login",
key: "/auth/login", key: "/auth/login",
icon: () => h("span", { class: "mdi mdi-login" }) icon: renderIcon(LogInIcon)
}, },
{ {
label: "Create Account", label: "Create Account",
key: "/auth/create-account", key: "/auth/create-account",
icon: () => h("span", { class: "mdi mdi-account-plus" }) icon: renderIcon(UserPlusIcon)
} }
] ]
} }

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="py-6"> <div class="py-6 px-5">
<div v-if="pending" class="text-center py-12"> <div v-if="pending" class="text-center py-12">
<n-spin size="large" /> <n-spin size="large" />
<p class="mt-4">Loading post...</p> <p class="mt-4">Loading post...</p>

View File

@@ -94,6 +94,16 @@ export default defineNuxtConfig({
primaryColorSuppl: "#4C5EC5FF", primaryColorSuppl: "#4C5EC5FF",
borderRadius: "16px", borderRadius: "16px",
borderRadiusSmall: "8px" borderRadiusSmall: "8px"
},
Input: {
borderRadius: "8px",
borderRadiusMedium: "8px",
borderRadiusSmall: "4px"
},
Button: {
borderRadius: "8px",
borderRadiusMedium: "8px",
borderRadiusSmall: "4px"
} }
}, },
light: {}, light: {},