fix: 提交样式和侧边栏

This commit is contained in:
2025-07-29 03:28:40 -07:00
parent a8c4ec4118
commit d6bb9f3683
13 changed files with 433 additions and 122 deletions
@@ -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 -10
View File
@@ -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}</>;
}
+1 -2
View File
@@ -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');
}
}
+4 -4
View File
@@ -59,7 +59,7 @@ export default function LoginForm({
<FormItem className={'mb-5'}>
<FormControl>
<Input
className={'h-[60px] text-xl'}
className={'h-[60px] text-xl shadow-[inset_0_0_7.6px_0_#00000040]'}
placeholder='Email'
type='email'
{...field}
@@ -76,7 +76,7 @@ export default function LoginForm({
<FormItem className={'mb-2'}>
<FormControl>
<Input
className={'h-[60px] text-xl'}
className={'h-[60px] text-xl shadow-[inset_0_0_7.6px_0_#00000040]'}
placeholder='password'
type='password'
{...field}
@@ -104,14 +104,14 @@ export default function LoginForm({
<Button
variant='link'
type='button'
className='p-0'
className='p-0 text-[#225BA9]'
onClick={() => onSwitchForm('reset')}
>
{t('forgotPassword')}
</Button>
<Button
variant='link'
className='p-0'
className='p-0 text-[#225BA9]'
onClick={() => {
setInitialValues(undefined);
onSwitchForm('register');
+8 -6
View File
@@ -102,7 +102,7 @@ export default function RegisterForm({
<FormItem>
<FormControl>
<Input
className={'h-[60px] text-xl'}
className={'h-[60px] text-xl shadow-[inset_0_0_7.6px_0_#00000040]'}
placeholder='Enter your email...'
type='email'
{...field}
@@ -119,7 +119,7 @@ export default function RegisterForm({
<FormItem>
<FormControl>
<Input
className={'h-[60px] text-xl'}
className={'h-[60px] text-xl shadow-[inset_0_0_7.6px_0_#00000040]'}
placeholder='Enter your password...'
type='password'
{...field}
@@ -136,7 +136,7 @@ export default function RegisterForm({
<FormItem>
<FormControl>
<Input
className={'h-[60px] text-xl'}
className={'h-[60px] text-xl shadow-[inset_0_0_7.6px_0_#00000040]'}
disabled={loading}
placeholder='Enter password again...'
type='password'
@@ -157,7 +157,9 @@ export default function RegisterForm({
<div className='flex items-center gap-8'>
<Input
disabled={loading}
className={'h-[60px] flex-1 text-xl'}
className={
'h-[60px] flex-1 text-xl shadow-[inset_0_0_7.6px_0_#00000040]'
}
placeholder='Enter code...'
type='text'
{...field}
@@ -184,7 +186,7 @@ export default function RegisterForm({
<FormItem>
<FormControl>
<Input
className={'h-[60px] text-xl'}
className={'h-[60px] text-xl shadow-[inset_0_0_7.6px_0_#00000040]'}
disabled={loading || !!localStorage.getItem('invite')}
placeholder={t('invite')}
{...field}
@@ -215,7 +217,7 @@ export default function RegisterForm({
{t('existingAccount')}&nbsp;
<Button
variant='link'
className='p-0'
className='p-0 text-[#225BA9]'
onClick={() => {
setInitialValues(undefined);
onSwitchForm('login');
+4 -4
View File
@@ -65,7 +65,7 @@ export default function ResetForm({
<FormItem>
<FormControl>
<Input
className={'h-[60px] text-xl'}
className={'h-[60px] text-xl shadow-[inset_0_0_7.6px_0_#00000040]'}
placeholder='Enter your email...'
type='email'
{...field}
@@ -83,7 +83,7 @@ export default function ResetForm({
<FormControl>
<div className='flex items-center gap-8'>
<Input
className={'h-[60px] flex-1 text-xl'}
className={'h-[60px] flex-1 text-xl shadow-[inset_0_0_7.6px_0_#00000040]'}
disabled={loading}
placeholder='Enter code...'
type='text'
@@ -110,7 +110,7 @@ export default function ResetForm({
<FormItem>
<FormControl>
<Input
className={'h-[60px] text-xl'}
className={'h-[60px] text-xl shadow-[inset_0_0_7.6px_0_#00000040]'}
placeholder='Enter your new password...'
type='password'
{...field}
@@ -139,7 +139,7 @@ export default function ResetForm({
{t('existingAccount')}&nbsp;
<Button
variant='link'
className='p-0'
className='p-0 text-[#225BA9]'
onClick={() => {
setInitialValues(undefined);
onSwitchForm('login');