Skip to content

Commit

Permalink
feat: 新增页面
Browse files Browse the repository at this point in the history
  • Loading branch information
besscroft committed Apr 7, 2024
1 parent 76d83c8 commit fd33be0
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 6 deletions.
12 changes: 11 additions & 1 deletion app/(default)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
'use client'

import React from 'react'
import Image from "next/image"
import fufu from '~/public/112962239_p0.jpg'

export default function Home() {
return (
<main className="flex flex-col items-center justify-between">

<Image
width={360}
src={fufu}
alt="芙芙"
/>
</main>
);
}
22 changes: 22 additions & 0 deletions app/admin/list/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Card, CardBody } from '@nextui-org/card'

export default async function List() {
return (
<div className="flex flex-col space-y-2 h-full flex-1">
<Card>
<CardBody>
<p>
图片维护
</p>
</CardBody>
</Card>
<Card className="flex-1">
<CardBody>
<p>
图片维护页面
</p>
</CardBody>
</Card>
</div>
)
}
2 changes: 1 addition & 1 deletion app/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export default async function Admin() {
</CardBody>
</Card>
</div>
)
)
}
22 changes: 22 additions & 0 deletions app/admin/tag/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Card, CardBody } from '@nextui-org/card'

export default async function List() {
return (
<div className="flex flex-col space-y-2 h-full flex-1">
<Card>
<CardBody>
<p>
标签管理
</p>
</CardBody>
</Card>
<Card className="flex-1">
<CardBody>
<p>
标签管理页面
</p>
</CardBody>
</Card>
</div>
)
}
22 changes: 22 additions & 0 deletions app/admin/upload/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Card, CardBody } from '@nextui-org/card'

export default async function Upload() {
return (
<div className="flex flex-col space-y-2 h-full flex-1">
<Card>
<CardBody>
<p>
上传
</p>
</CardBody>
</Card>
<Card className="flex-1">
<CardBody>
<p>
上传页面
</p>
</CardBody>
</Card>
</div>
)
}
24 changes: 24 additions & 0 deletions components/BaseSide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,30 @@ export const BaseSide = () => {
>
控制台
</ListboxItem>
<ListboxItem
className={pathname === '/admin/upload' ? 'text-teal-300 ' + buttonClasses : buttonClasses}
key="upload"
startContent={<MonitorMobileIcon className={iconClasses}/>}
onClick={() => router.push('/admin/upload')}
>
上传
</ListboxItem>
<ListboxItem
className={pathname === '/admin/list' ? 'text-teal-300 ' + buttonClasses : buttonClasses}
key="list"
startContent={<MonitorMobileIcon className={iconClasses}/>}
onClick={() => router.push('/admin/list')}
>
图片维护
</ListboxItem>
<ListboxItem
className={pathname === '/admin/tag' ? 'text-teal-300 ' + buttonClasses : buttonClasses}
key="tag"
startContent={<MonitorMobileIcon className={iconClasses}/>}
onClick={() => router.push('/admin/tag')}
>
标签管理
</ListboxItem>
<ListboxItem
className={pathname === '/admin/settings' ? 'text-teal-400 ' + buttonClasses : buttonClasses}
key="settings"
Expand Down
4 changes: 2 additions & 2 deletions components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export default function Header() {
<Logo />
</NavbarBrand>
<NavbarContent className="hidden sm:flex gap-4 select-none" justify="center">
<NavbarItem onClick={() => router.push('/')}>
<NavbarItem onClick={() => router.push('/')} className="cursor-pointer">
首页
</NavbarItem>
<NavbarItem onClick={() => router.push('/about')}>
<NavbarItem onClick={() => router.push('/about')} className="cursor-pointer">
关于
</NavbarItem>
</NavbarContent>
Expand Down
45 changes: 43 additions & 2 deletions components/VaulDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,38 @@ export default function VaulDrawer() {
</Drawer.Close>
</ListboxItem>
}
<ListboxItem
key="upload"
startContent={<LockFilledIcon className={iconClasses} />}
onClick={() => router.push('/admin/upload')}
>
<Drawer.Close className="w-full text-left">
上传
</Drawer.Close>
</ListboxItem>
<ListboxItem
key="list"
startContent={<LockFilledIcon className={iconClasses} />}
onClick={() => router.push('/admin/list')}
>
<Drawer.Close className="w-full text-left">
图片维护
</Drawer.Close>
</ListboxItem>
<ListboxItem
key="tag"
startContent={<LockFilledIcon className={iconClasses} />}
onClick={() => router.push('/admin/tag')}
>
<Drawer.Close className="w-full text-left">
标签管理
</Drawer.Close>
</ListboxItem>
<ListboxItem
key="settings"
startContent={<LockFilledIcon className={iconClasses} />}
onClick={() => router.push('/admin/settings')}
showDivider
>
<Drawer.Close className="w-full text-left">
设置
Expand All @@ -95,7 +123,6 @@ export default function VaulDrawer() {
<ListboxItem
key="loginOut"
startContent={<CloseIcon className={iconClasses} />}
showDivider
>
<div onClick={async () => {
await loginOut()
Expand All @@ -116,8 +143,22 @@ export default function VaulDrawer() {
aria-label="移动端菜单"
>
<ListboxItem
key="login"
key="home"
onClick={() => router.push('/')}
startContent={<AvatarIcon className={iconClasses} />}
>
首页
</ListboxItem>
<ListboxItem
key="about"
showDivider
onClick={() => router.push('/about')}
startContent={<AvatarIcon className={iconClasses} />}
>
关于
</ListboxItem>
<ListboxItem
key="login"
onClick={() => router.push('/login')}
startContent={<AvatarIcon className={iconClasses} />}
>
Expand Down

0 comments on commit fd33be0

Please sign in to comment.