Skip to content

Commit 72d2475

Browse files
committed
.
1 parent 4937447 commit 72d2475

File tree

4 files changed

+75
-50
lines changed

4 files changed

+75
-50
lines changed

app/layout.tsx

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import * as React from "react"
22
import type { Metadata } from "next";
3-
import Link from "next/link"
4-
import Image from 'next/image'
53

64

75

8-
import { Button } from "@/components/ui/button"
96
import { SidebarProvider } from "@/components/ui/sidebar"
10-
import { AppSidebar } from "@/components/app-sidebar"
11-
import { CustomTrigger } from "@/components/ui/sidebartrigger"
7+
import { Header } from "@/components/header"
128

139

1410

@@ -59,48 +55,7 @@ export default function RootLayout({
5955

6056

6157

62-
<header>
63-
64-
65-
66-
<AppSidebar />
67-
68-
69-
70-
<div className="fixed flex flex-row gap-3 p-6 z-20 flex-wrap w-full justify-between md:w-fit md:justify-start">
71-
72-
<Button asChild className="bg-background text-foreground hover:bg-white group">
73-
<Link href="/" className="select-none">
74-
<Image
75-
src="/logo/OpenDriveLab/D.png"
76-
alt="OpenDriveLab"
77-
width={24}
78-
height={24}
79-
className="group-hover:scale-125 transition delay-100 duration-200"
80-
/>
81-
</Link>
82-
</Button>
83-
84-
<CustomTrigger />
85-
86-
</div>
87-
88-
89-
90-
<div className="fixed right-0 bottom-0 m-6 z-20">
91-
<Link href="#" className="bg-background text-foreground hover:bg-o-blue hover:text-background rounded-full flex justify-center items-center p-2 select-none">
92-
<span>
93-
<svg fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor" className="size-6">
94-
<path strokeLinecap="round" strokeLinejoin="round" d="m4.5 18.75 7.5-7.5 7.5 7.5" />
95-
<path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 7.5-7.5 7.5 7.5" />
96-
</svg>
97-
</span>
98-
</Link>
99-
</div>
100-
101-
102-
103-
</header>
58+
<Header/>
10459

10560

10661

app/not-found.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ export const metadata: Metadata = {
55

66

77

8-
import NotFound404 from '@/components/404'
8+
import Redirect from '@/components/redirect'
99

1010

1111

1212
export default function NotFound() {
1313
return (
14-
<NotFound404/>
14+
<Redirect/>
1515
)
1616
}

components/header.tsx

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
"use client"
2+
3+
4+
5+
import * as React from "react"
6+
import Link from "next/link"
7+
import Image from 'next/image'
8+
import { usePathname } from 'next/navigation';
9+
10+
11+
12+
import { Button } from "@/components/ui/button"
13+
import { AppSidebar } from "@/components/app-sidebar"
14+
import { CustomTrigger } from "@/components/ui/sidebartrigger"
15+
16+
17+
18+
export function Header() {
19+
20+
21+
22+
const pathname = usePathname()
23+
24+
25+
26+
return (
27+
<header key={pathname}>
28+
29+
30+
31+
<AppSidebar />
32+
33+
34+
35+
<div className="fixed flex flex-row gap-3 p-6 z-20 flex-wrap w-full justify-between md:w-fit md:justify-start">
36+
37+
<Button asChild className="bg-background text-foreground hover:bg-white group">
38+
<Link href="/" className="select-none">
39+
<Image
40+
src="/logo/OpenDriveLab/D.png"
41+
alt="OpenDriveLab"
42+
width={24}
43+
height={24}
44+
className="group-hover:scale-125 transition delay-100 duration-200"
45+
/>
46+
</Link>
47+
</Button>
48+
49+
<CustomTrigger />
50+
51+
</div>
52+
53+
54+
55+
<div className="fixed right-0 bottom-0 m-6 z-20">
56+
<Link href="#" className="bg-background text-foreground hover:bg-o-blue hover:text-background rounded-full flex justify-center items-center p-2 select-none">
57+
<span>
58+
<svg fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor" className="size-6">
59+
<path strokeLinecap="round" strokeLinejoin="round" d="m4.5 18.75 7.5-7.5 7.5 7.5" />
60+
<path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 7.5-7.5 7.5 7.5" />
61+
</svg>
62+
</span>
63+
</Link>
64+
</div>
65+
66+
67+
68+
</header>
69+
)
70+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { redirect, usePathname } from 'next/navigation'
66

77

88

9-
export default function NotFound404() {
9+
export default function Redirect() {
1010

1111

1212

0 commit comments

Comments
 (0)