File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { Metadata } from "next" ;
22import "./globals.css" ;
3- import { DeviceProvider } from "@/components/providers/device-provider" ;
3+ // import { DeviceProvider } from "@/components/providers/device-provider";
44import { SmoothScrollProvider } from "@/components/providers/smooth-scroll-provider" ;
5- import { getIsMobileServer } from "@/lib/device" ;
5+ // import { getIsMobileServer } from "@/lib/device";
66import { Header } from "@/components/layout/header/header" ;
77import { cn } from "@/lib/utils" ;
88// import { Footer } from "@/components/layout/footer/footer";
@@ -21,7 +21,7 @@ export default async function RootLayout({
2121} : Readonly < {
2222 children : React . ReactNode ;
2323} > ) {
24- const isMobile = await getIsMobileServer ( ) ;
24+ // const isMobile = await getIsMobileServer();
2525
2626 return (
2727 < html lang = "zh" >
@@ -31,15 +31,15 @@ export default async function RootLayout({
3131 "antialiased"
3232 ) }
3333 >
34- < DeviceProvider isMobile = { isMobile } >
35- < SmoothScrollProvider >
36- < div className = "fixed top-0 right-0 left-0 z-50" >
37- < Header />
38- </ div >
39- < main className = "pt-16" > { children } </ main >
40- { /* <Footer /> */ }
41- </ SmoothScrollProvider >
42- </ DeviceProvider >
34+ { /* <DeviceProvider isMobile={isMobile}> */ }
35+ < SmoothScrollProvider >
36+ < div className = "fixed top-0 right-0 left-0 z-50" >
37+ < Header />
38+ </ div >
39+ < main className = "pt-16" > { children } </ main >
40+ { /* <Footer /> */ }
41+ </ SmoothScrollProvider >
42+ { /* </DeviceProvider> */ }
4343 </ body >
4444 </ html >
4545 ) ;
Original file line number Diff line number Diff line change 11"use client" ;
22
3- import Image from "next/image" ;
43import { useIsMobile } from "@/hooks/use-mobile" ;
54import { cn } from "@/lib/utils" ;
65
@@ -17,11 +16,9 @@ export function Header() {
1716 isMobile && "px-4"
1817 ) }
1918 >
20- < Image
19+ < img
2120 src = "/images/logo.webp"
2221 alt = "302 AI Studio Logo"
23- width = { 141 }
24- height = { 40 }
2522 style = { { width : "141px" , height : "40px" } }
2623 />
2724
Original file line number Diff line number Diff line change 11"use client" ;
22
3- import Image from "next/image" ;
43import { useEffect , useState } from "react" ;
54import { ArrowDownToLine } from "lucide-react" ;
65import { Button } from "../ui/button" ;
@@ -113,11 +112,10 @@ export function FinalSection() {
113112 ) }
114113 >
115114 < div className = "flex flex-col items-center" >
116- < Image
115+ < img
117116 src = { card . icon }
118117 alt = { card . title }
119- width = { 44 }
120- height = { 44 }
118+ style = { { width : "44px" , height : "44px" } }
121119 className = "h-11 w-11"
122120 />
123121 < h3 className = "mt-3 text-lg font-semibold text-black" >
@@ -281,11 +279,10 @@ export function FinalSection() {
281279 ) }
282280 >
283281 < div className = "flex flex-col items-center" >
284- < Image
282+ < img
285283 src = { card . icon }
286284 alt = { card . title }
287- width = { 44 }
288- height = { 44 }
285+ style = { { width : "44px" , height : "44px" } }
289286 className = "h-11 w-11"
290287 />
291288 < h3 className = "mt-3 text-lg font-semibold text-black" >
Original file line number Diff line number Diff line change 11"use client" ;
22
3- import Image from "next/image" ;
43import { Button } from "../ui/button" ;
54import { ArrowDownToLine } from "lucide-react" ;
65import { useIsMobile } from "@/hooks/use-mobile" ;
@@ -30,38 +29,33 @@ export function HeroSection() {
3029 variant = "outline"
3130 className = "text-black rounded-sm font-medium"
3231 >
33- < Image
32+ < img
3433 src = "/svgs/github.svg"
3534 alt = "GitHub"
36- width = { 16 }
37- height = { 16 }
35+ style = { { width : "16px" , height : "16px" } }
3836 />
3937 GitHub
4038 </ Button >
4139 </ div >
4240 </ div >
4341
44- < Image
42+ < img
4543 src = "/images/hero-section.webp"
4644 alt = "Hero section background image"
47- width = { 2880 }
48- height = { 2028 }
45+ style = { { width : "100%" , height : "auto" } }
4946 className = "w-full aspect-[2880/1900] object-cover z-10 -mt-[80px]"
50- priority
5147 />
5248 </ section >
5349 ) ;
5450 }
5551
5652 return (
5753 < section className = "relative mx-auto" >
58- < Image
54+ < img
5955 src = "/images/hero-section.webp"
6056 alt = "Hero section background image"
61- width = { 2880 }
62- height = { 2028 }
57+ style = { { width : "100%" , height : "auto" } }
6358 className = "w-full aspect-[2880/1900] object-cover"
64- priority
6559 />
6660
6761 < div className = "absolute top-[200px] left-0 w-full z-10 flex justify-center px-4" >
@@ -84,11 +78,10 @@ export function HeroSection() {
8478 variant = "outline"
8579 className = "text-black rounded-sm font-medium"
8680 >
87- < Image
81+ < img
8882 src = "/svgs/github.svg"
8983 alt = "GitHub"
90- width = { 16 }
91- height = { 16 }
84+ style = { { width : "16px" , height : "16px" } }
9285 />
9386 GitHub
9487 </ Button >
Original file line number Diff line number Diff line change 11"use client" ;
22
3- import Image from "next/image" ;
43import { useIsMobile } from "@/hooks/use-mobile" ;
54
65export function IntroSection ( ) {
@@ -21,27 +20,23 @@ export function IntroSection() {
2120 </ p >
2221 </ div >
2322
24- < Image
23+ < img
2524 src = "/images/intro-section.webp"
2625 alt = "Intro section background image"
27- width = { 2880 }
28- height = { 1600 }
26+ style = { { width : "100%" , height : "auto" } }
2927 className = "w-full aspect-[2880/1400] object-cover z-10 -mt-[70px]"
30- priority
3128 />
3229 </ section >
3330 ) ;
3431 }
3532
3633 return (
3734 < section className = "relative mx-auto" >
38- < Image
35+ < img
3936 src = "/images/intro-section.webp"
4037 alt = "Intro section background image"
41- width = { 2880 }
42- height = { 1600 }
38+ style = { { width : "100%" , height : "auto" } }
4339 className = "w-full aspect-[2880/1400] object-cover"
44- priority
4540 />
4641
4742 < div className = "absolute top-[76px] left-0 w-full z-10 flex justify-center px-4" >
Original file line number Diff line number Diff line change 11"use client" ;
22
3- import { useDevice } from "@/components/providers/device-provider" ;
3+ // import { useDevice } from "@/components/providers/device-provider";
44import * as React from "react" ;
55
66const MOBILE_BREAKPOINT = 768 ;
77
88export function useIsMobile ( ) : boolean {
9- const { isMobile : serverIsMobile } = useDevice ( ) ;
9+ // const { isMobile: serverIsMobile } = useDevice();
1010
11- const [ isMobile , setIsMobile ] = React . useState < boolean > ( serverIsMobile ) ;
11+ const [ isMobile , setIsMobile ] = React . useState < boolean > ( false ) ;
1212
1313 React . useEffect ( ( ) => {
1414 const mql = window . matchMedia ( `(max-width: ${ MOBILE_BREAKPOINT - 1 } px)` ) ;
Original file line number Diff line number Diff line change 1- import { headers } from "next/headers" ;
1+ // import { headers } from "next/headers";
22
3- const MOBILE_UA_REGEX =
4- / A n d r o i d | w e b O S | i P h o n e | i P a d | i P o d | B l a c k B e r r y | I E M o b i l e | O p e r a M i n i | M o b i l e | m o b i l e | C r i O S / i;
3+ // const MOBILE_UA_REGEX =
4+ // /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i;
55
66
7- export async function getIsMobileServer ( ) : Promise < boolean > {
8- const headersList = await headers ( ) ;
9- const userAgent = headersList . get ( "user-agent" ) || "" ;
10- return MOBILE_UA_REGEX . test ( userAgent ) ;
11- }
7+ // export async function getIsMobileServer(): Promise<boolean> {
8+ // const headersList = await headers();
9+ // const userAgent = headersList.get("user-agent") || "";
10+ // return MOBILE_UA_REGEX.test(userAgent);
11+ // }
You can’t perform that action at this time.
0 commit comments