fix: 提交样式和侧边栏
This commit is contained in:
@@ -7,9 +7,9 @@ import { SidebarRight } from './sidebar-right';
|
||||
export default async function DashboardLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<SidebarProvider className='container'>
|
||||
<SidebarLeft className='sticky top-[84px] hidden w-52 border-r-0 bg-transparent lg:flex' />
|
||||
<SidebarLeft className='sticky w-[288px] border-r-0 bg-transparent lg:flex' />
|
||||
<SidebarInset className='relative p-4'>{children}</SidebarInset>
|
||||
<SidebarRight className='sticky top-[84px] hidden w-52 border-r-0 bg-transparent 2xl:flex' />
|
||||
<SidebarRight className='sticky top-[84px] hidden w-[288px] border-r-0 bg-transparent 2xl:flex' />
|
||||
<Announcement type='popup' Authorization={(await cookies()).get('Authorization')?.value} />
|
||||
</SidebarProvider>
|
||||
);
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
'use client';
|
||||
import { UserNav } from '@/components/user-nav';
|
||||
import { navs } from '@/config/navs';
|
||||
import {
|
||||
Sidebar,
|
||||
SidebarContent,
|
||||
SidebarGroup,
|
||||
SidebarGroupContent,
|
||||
SidebarGroupLabel,
|
||||
SidebarMenu,
|
||||
SidebarMenuButton,
|
||||
SidebarMenuItem,
|
||||
} from '@workspace/ui/components/sidebar';
|
||||
import { Icon } from '@workspace/ui/custom-components/icon';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import Image from 'next/legacy/image';
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
|
||||
@@ -19,34 +18,39 @@ export function SidebarLeft({ ...props }: React.ComponentProps<typeof Sidebar>)
|
||||
const t = useTranslations('menu');
|
||||
const pathname = usePathname();
|
||||
return (
|
||||
<Sidebar collapsible='none' side='left' {...props}>
|
||||
<SidebarContent>
|
||||
<SidebarMenu>
|
||||
{navs.map((nav) => (
|
||||
<SidebarGroup key={nav.title}>
|
||||
{nav.items && <SidebarGroupLabel>{t(nav.title)}</SidebarGroupLabel>}
|
||||
<SidebarGroupContent>
|
||||
<SidebarMenu>
|
||||
{(nav.items || [nav]).map((item) => (
|
||||
<SidebarMenuItem key={item.title}>
|
||||
<SidebarMenuButton
|
||||
asChild
|
||||
tooltip={t(item.title)}
|
||||
isActive={item.url === pathname}
|
||||
>
|
||||
<Link href={item.url}>
|
||||
{item.icon && <Icon icon={item.icon} />}
|
||||
<span>{t(item.title)}</span>
|
||||
</Link>
|
||||
</SidebarMenuButton>
|
||||
</SidebarMenuItem>
|
||||
))}
|
||||
</SidebarMenu>
|
||||
</SidebarGroupContent>
|
||||
</SidebarGroup>
|
||||
<Sidebar collapsible='none' side='left' {...props} className={'h-auto bg-white'}>
|
||||
<div className='pb-7 pt-12'>
|
||||
<Image src={'image.png'} width={102} height={49} alt='logo' unoptimized />
|
||||
</div>
|
||||
<SidebarContent className={''}>
|
||||
<SidebarMenu className={'gap-2.5'}>
|
||||
{navs.map((nav, navIndex) => (
|
||||
<SidebarMenu key={navIndex} className={navIndex === 0 ? 'mb-[42px]' : 0}>
|
||||
{(nav.items || [nav]).map((item) => (
|
||||
<SidebarMenuItem key={item.title} className={''}>
|
||||
<SidebarMenuButton
|
||||
className={
|
||||
'h-[60px] rounded-full px-5 py-[18px] text-xl hover:bg-[#0F2C53] active:bg-[#0F2C53] data-[active=true]:bg-[#0F2C53]'
|
||||
}
|
||||
asChild
|
||||
tooltip={t(item.title)}
|
||||
isActive={item.url === pathname}
|
||||
>
|
||||
<Link href={item.url}>
|
||||
{item.icon && <Icon className={'!size-6'} icon={item.icon} />}
|
||||
<span>{t(item.title)}</span>
|
||||
</Link>
|
||||
</SidebarMenuButton>
|
||||
</SidebarMenuItem>
|
||||
))}
|
||||
</SidebarMenu>
|
||||
))}
|
||||
</SidebarMenu>
|
||||
</SidebarContent>
|
||||
|
||||
<div>
|
||||
<UserNav from='profile' />
|
||||
</div>
|
||||
</Sidebar>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
import Footer from '@/components/footer';
|
||||
import Header from '@/components/Header/header';
|
||||
|
||||
export default async function MainLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
<Header />
|
||||
{children}
|
||||
<Footer />
|
||||
</>
|
||||
);
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Stats } from '@/components/main/stats';*/
|
||||
import NewHeader from '@/components/Header/NewHeader';
|
||||
import { queryUserInfo } from '@/services/user/user';
|
||||
import { cookies } from 'next/headers';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
import FooterCopyright from '@/components/main/FooterCopyright';
|
||||
import FullScreenVideoBackground from '@/components/main/FullScreenVideoBackground';
|
||||
@@ -26,7 +25,7 @@ export default async function Home() {
|
||||
}
|
||||
|
||||
if (user) {
|
||||
redirect('/dashboard');
|
||||
// redirect('/dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user