Skip to content

Commit a2a8914

Browse files
committed
feat: test
1 parent a59e3df commit a2a8914

File tree

3 files changed

+22
-26
lines changed

3 files changed

+22
-26
lines changed

markdown/index.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
{
33
"path": "yyblog.md",
44
"title": "yyblog",
5-
"tag":"技术/react"
5+
"tag": "技术/react"
66
},
77
{
88
"path": "react19.md",
99
"title": "react19",
10-
"tag":"随笔/生活"
10+
"tag": "随笔/生活"
1111
}
1212
]

markdown/react19.md

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ export function Banner({
165165

166166
```tsx
167167
//layout
168-
import { Banner } from "../components/Banner";
169-
import { getDailyWord } from "@/utils/getDailyWord";
168+
import { Banner } from '../components/Banner';
169+
import { getDailyWord } from '@/utils/getDailyWord';
170170

171171
export default async function FrontLayout({
172172
children,
@@ -179,25 +179,21 @@ export default async function FrontLayout({
179179
return (
180180
<div className="flex flex-col items-center">
181181
<div className="w-[100vw]">
182-
<Banner
183-
language={language}
184-
isGetDailyWord={true}
185-
wordsFetch={wordsFetch}
186-
></Banner>
182+
<Banner language={language} isGetDailyWord={true} wordsFetch={wordsFetch}></Banner>
187183
</div>
188184
<section className="w-full">{children}</section>
189185
</div>
190186
);
191187
}
192188
//TypeWrite
193-
("use client");
194-
import { usePathname } from "next/navigation";
195-
import { ReactTyped } from "react-typed";
196-
import { getDailyWord } from "@/utils/getDailyWord";
197-
import { Suspense, use, useState } from "react";
198-
import { DailyWord } from "@/utils/getDailyWord";
199-
import { splitPathname } from "@/utils/dealPathname";
200-
import { useTranslation } from "@/app/i18n/client";
189+
('use client');
190+
import { usePathname } from 'next/navigation';
191+
import { ReactTyped } from 'react-typed';
192+
import { getDailyWord } from '@/utils/getDailyWord';
193+
import { Suspense, use, useState } from 'react';
194+
import { DailyWord } from '@/utils/getDailyWord';
195+
import { splitPathname } from '@/utils/dealPathname';
196+
import { useTranslation } from '@/app/i18n/client';
201197
export function MyTypeWrite({
202198
language,
203199
isGetDailyWord,
@@ -210,21 +206,21 @@ export function MyTypeWrite({
210206
let word;
211207
const pathName = usePathname();
212208
const title = splitPathname(pathName);
213-
const { t } = useTranslation(language, "translations");
209+
const { t } = useTranslation(language, 'translations');
214210
if (isGetDailyWord && wordsFetch) {
215211
const words = use(wordsFetch);
216-
word = language === "zh-CN" ? words.note : words.content;
212+
word = language === 'zh-CN' ? words.note : words.content;
217213
}
218214
return (
219215
<ReactTyped
220216
strings={!word ? [t(title)] : [word]}
221217
typeSpeed={50}
222218
style={{
223-
display: "flex",
224-
lineHeight: "250px",
225-
fontSize: "4rem",
226-
justifyContent: "center",
227-
color: "white",
219+
display: 'flex',
220+
lineHeight: '250px',
221+
fontSize: '4rem',
222+
justifyContent: 'center',
223+
color: 'white',
228224
}}
229225
/>
230226
);
@@ -249,4 +245,4 @@ React19的更新远不止于此,目前我只用上这两个方法。
249245

250246
[关于USE](https://react.dev/reference/react/use)
251247

252-
[关于Compiler](https://react.dev/learn/react-compiler#)
248+
[关于Compiler](https://react.dev/learn/react-compiler#)

next.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let nextConfig = {
2020
config.module.rules.push({
2121
test: /\.md$/,
2222
use: 'raw-loader',
23-
type:'asset/source'
23+
type: 'asset/source',
2424
});
2525

2626
return config;

0 commit comments

Comments
 (0)