Skip to content

Commit c2f5143

Browse files
committed
chore: test ci
1 parent 595deee commit c2f5143

7 files changed

Lines changed: 40 additions & 58 deletions

File tree

src/app/layout.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { Metadata } from "next";
22
import "./globals.css";
3-
import { DeviceProvider } from "@/components/providers/device-provider";
3+
// import { DeviceProvider } from "@/components/providers/device-provider";
44
import { SmoothScrollProvider } from "@/components/providers/smooth-scroll-provider";
5-
import { getIsMobileServer } from "@/lib/device";
5+
// import { getIsMobileServer } from "@/lib/device";
66
import { Header } from "@/components/layout/header/header";
77
import { 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
);

src/components/layout/header/header.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"use client";
22

3-
import Image from "next/image";
43
import { useIsMobile } from "@/hooks/use-mobile";
54
import { 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

src/components/sections/final-section.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"use client";
22

3-
import Image from "next/image";
43
import { useEffect, useState } from "react";
54
import { ArrowDownToLine } from "lucide-react";
65
import { 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">

src/components/sections/hero-section.tsx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"use client";
22

3-
import Image from "next/image";
43
import { Button } from "../ui/button";
54
import { ArrowDownToLine } from "lucide-react";
65
import { 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>

src/components/sections/intro-section.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"use client";
22

3-
import Image from "next/image";
43
import { useIsMobile } from "@/hooks/use-mobile";
54

65
export 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">

src/hooks/use-mobile.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"use client";
22

3-
import { useDevice } from "@/components/providers/device-provider";
3+
// import { useDevice } from "@/components/providers/device-provider";
44
import * as React from "react";
55

66
const MOBILE_BREAKPOINT = 768;
77

88
export 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)`);

src/lib/device.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { headers } from "next/headers";
1+
// import { headers } from "next/headers";
22

3-
const MOBILE_UA_REGEX =
4-
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/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+
// }

0 commit comments

Comments
 (0)