+
}
+ startContent={}
onClick={() => router.push('/admin')}
>
- 控制台
+ 控制台
}
+ startContent={}
onClick={() => router.push('/admin/upload')}
>
- 上传
+ 上传
}
+ startContent={}
onClick={() => router.push('/admin/list')}
>
- 图片维护
+ 图片维护
}
+ startContent={}
onClick={() => router.push('/admin/tag')}
>
- 标签管理
+ 标签管理
}
+ startContent={}
onClick={() => router.push('/admin/settings')}
>
- 设置
+ 设置
diff --git a/components/layout/DropMenu.tsx b/components/layout/DropMenu.tsx
index d7959ab..8ab6020 100644
--- a/components/layout/DropMenu.tsx
+++ b/components/layout/DropMenu.tsx
@@ -7,7 +7,7 @@ import { loginOut } from '~/server/lib/actions'
import { useSession } from 'next-auth/react'
import { useEffect, useState } from 'react'
import { useTheme } from 'next-themes'
-import { DesktopIcon, ExitIcon, GitHubLogoIcon, HomeIcon, MoonIcon, PersonIcon, SunIcon } from '@radix-ui/react-icons'
+import { Home, MonitorDot, SunMedium, MoonStar, Github, LogOut, LogIn } from 'lucide-react'
export const DropMenu = () => {
const router = useRouter()
@@ -41,7 +41,7 @@ export const DropMenu = () => {
pathname.startsWith('/admin') ?
}
+ startContent={
}
onClick={() => router.push('/')}
>
首页
@@ -49,7 +49,7 @@ export const DropMenu = () => {
:
}
+ startContent={
}
onClick={() => router.push('/admin')}
>
控制台
@@ -57,7 +57,7 @@ export const DropMenu = () => {
}
}
+ startContent={
}
showDivider
>
{
@@ -68,14 +68,14 @@ export const DropMenu = () => {
:
}
+ startContent={theme === 'light' ?
:
}
onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}
>
{ theme === 'light' ? '切换至⌈常夜⌋' : '切换至⌈白夜⌋' }
}
+ startContent={
}
onClick={() => router.push('https://github.com/besscroft')}
>
GitHub
@@ -87,20 +87,20 @@ export const DropMenu = () => {
key="login"
showDivider
onClick={() => router.push('/login')}
- startContent={
}
+ startContent={
}
>
登录
:
}
+ startContent={theme === 'light' ?
:
}
onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}
>
{ theme === 'light' ? '切换至⌈常夜⌋' : '切换至⌈白夜⌋' }
}
+ startContent={
}
onClick={() => router.push('https://github.com/besscroft')}
>
GitHub
diff --git a/components/layout/Transitions.tsx b/components/layout/Transitions.tsx
deleted file mode 100644
index fcdb3b0..0000000
--- a/components/layout/Transitions.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-'use client'
-
-import { AnimatePresence, motion } from 'framer-motion'
-import { useRouter } from 'next-nprogress-bar'
-import {
- createContext,
- MouseEventHandler,
- PropsWithChildren,
- use,
- useTransition,
-} from 'react'
-
-export const DELAY = 200;
-
-const sleep = (ms: number) =>
- new Promise
((resolve) => setTimeout(() => resolve(), ms));
-const noop = () => {};
-
-type TransitionContext = {
- pending: boolean;
- navigate: (url: string) => void;
-};
-const Context = createContext({
- pending: false,
- navigate: noop,
-});
-export const usePageTransition = () => use(Context);
-
-type Props = PropsWithChildren<{
- className?: string;
-}>;
-
-export default function Transitions({ children, className }: Props) {
- const [pending, start] = useTransition();
- const router = useRouter();
-
- const navigate = (href: string) => {
- start(async () => {
- router.push(href);
- await sleep(DELAY);
- });
- };
-
- const onClick: MouseEventHandler = (e) => {
- const a = (e.target as Element).closest("a");
- if (a) {
- e.preventDefault();
- const href = a.getAttribute("href");
- if (href) {
- navigate(href);
- }
- }
- };
-
- return (
-
-
- {children}
-
-
- );
-}
-
-export function Animate({ children, className }: Props) {
- const { pending } = usePageTransition();
- return (
-
- {!pending && (
-
- {children}
-
- )}
-
- );
-}
\ No newline at end of file
diff --git a/components/layout/VaulDrawer.tsx b/components/layout/VaulDrawer.tsx
index 61d33b8..fc675a2 100644
--- a/components/layout/VaulDrawer.tsx
+++ b/components/layout/VaulDrawer.tsx
@@ -9,19 +9,19 @@ import { useEffect, useState } from 'react'
import { useTheme } from 'next-themes'
import { loginOut } from '~/server/lib/actions'
import {
- BookmarkIcon,
- DashboardIcon,
- DesktopIcon,
- ExitIcon,
- GearIcon,
- HomeIcon,
- InfoCircledIcon,
- MoonIcon,
- Pencil2Icon,
- PersonIcon,
- RocketIcon,
- SunIcon
-} from '@radix-ui/react-icons'
+ LayoutGrid,
+ MonitorDot,
+ ImageUp,
+ Image,
+ Milestone,
+ Settings,
+ Info,
+ LogOut,
+ SunMedium,
+ MoonStar,
+ LogIn,
+ Home
+} from 'lucide-react'
export default function VaulDrawer() {
const { data: session, status } = useSession()
@@ -41,7 +41,7 @@ export default function VaulDrawer() {
return (
-
+
@@ -57,7 +57,7 @@ export default function VaulDrawer() {
>
}
+ startContent={}
onClick={() => router.push('/')}
>
@@ -66,7 +66,7 @@ export default function VaulDrawer() {
}
+ startContent={}
onClick={() => router.push('/about')}
showDivider
>
@@ -76,7 +76,7 @@ export default function VaulDrawer() {
}
+ startContent={}
onClick={() => router.push('/admin')}
>
@@ -85,7 +85,7 @@ export default function VaulDrawer() {
}
+ startContent={}
onClick={() => router.push('/admin/upload')}
>
@@ -94,7 +94,7 @@ export default function VaulDrawer() {
}
+ startContent={}
onClick={() => router.push('/admin/list')}
>
@@ -103,7 +103,7 @@ export default function VaulDrawer() {
}
+ startContent={}
onClick={() => router.push('/admin/tag')}
>
@@ -112,7 +112,7 @@ export default function VaulDrawer() {
}
+ startContent={}
onClick={() => router.push('/admin/settings')}
showDivider
>
@@ -122,7 +122,7 @@ export default function VaulDrawer() {
}
+ startContent={}
>
{
await loginOut()
@@ -132,7 +132,7 @@ export default function VaulDrawer() {
:
}
+ startContent={theme === 'light' ?
:
}
onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}
>
{ theme === 'light' ? '切换至⌈常夜⌋' : '切换至⌈白夜⌋' }
@@ -145,7 +145,7 @@ export default function VaulDrawer() {
router.push('/')}
- startContent={}
+ startContent={}
>
首页
@@ -155,7 +155,7 @@ export default function VaulDrawer() {
key="about"
showDivider
onClick={() => router.push('/about')}
- startContent={}
+ startContent={}
>
关于
@@ -164,13 +164,13 @@ export default function VaulDrawer() {
router.push('/login')}
- startContent={}
+ startContent={}
>
登录
: }
+ startContent={theme === 'light' ? : }
onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}
>
{ theme === 'light' ? '切换至⌈常夜⌋' : '切换至⌈白夜⌋' }