Skip to content

Commit e1e8b69

Browse files
committedMar 11, 2025
feat: 完成初始化布局
1 parent 1ab5f13 commit e1e8b69

File tree

4 files changed

+29
-21
lines changed

4 files changed

+29
-21
lines changed
 

‎src/app/layout.tsx

+19-17
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Logo } from '@icons';
1+
import { Logo, QQ } from '@icons';
22
import type { Metadata } from 'next';
33
import { Geist, Geist_Mono } from 'next/font/google';
44
import { Banner, Head } from 'nextra/components';
55
import { getPageMap } from 'nextra/page-map';
66
import { Footer, Layout, Link, Navbar } from 'nextra-theme-docs';
77

8-
import '@/css/global.css';
8+
import '@css/global.css';
99
import { cn } from '@/lib/utils';
1010

1111
const geistSans = Geist({
@@ -30,22 +30,20 @@ export const metadata: Metadata = {
3030
icon: '/favicon.svg'
3131
},
3232
keywords: ['Soybean-React', 'Soybean-React-Docs', 'react', 'admin', 'template'],
33-
title: 'soybean-admin-react-docs'
33+
title: {
34+
default: 'Soybean-React-Docs',
35+
template: '%s | Soybean-React'
36+
}
3437
};
3538
const navbar = (
3639
<Navbar
37-
logo={
38-
<Logo
39-
height="20"
40-
className={cn(
41-
'hover:transition-all hover:duration-1000 motion-reduce:hover:transition-none',
42-
'[mask-image:linear-gradient(60deg,#000_25%,rgba(0,0,0,.2)_50%,#000_75%)] [mask-position:0] [mask-size:400%]',
43-
'hover:[mask-position:100%]'
44-
)}
45-
/>
46-
}
47-
// ... Your additional navbar options
48-
/>
40+
chatIcon={<QQ className="w-[24px] h-[24px] " />}
41+
chatLink="https://qm.qq.com/cgi-bin/qm/qr?k=lf7vqv-9JgJ_NDBAUk9EofQEfpqDw7so&jump_from=webapi&authKey=Ueo/dyEtrRm1vgkMI4yqiKjBRtKQuaEGNxMaXX56CoPQz2GRFP+qAADfKoe3ajJN"
42+
logo={<Logo className="w-[32px] h-[32px] text-[var(--soybean)]" />}
43+
projectLink="https://github.com/soybeanjs/soybean-admin-react"
44+
>
45+
<div className="flex items-center gap-2">1111</div>
46+
</Navbar>
4947
);
5048

5149
const banner = (
@@ -84,12 +82,16 @@ export default async function RootLayout({ children }: { children: React.ReactNo
8482
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
8583
<Layout
8684
banner={banner}
87-
docsRepositoryBase="https://github.com/shuding/nextra/tree/main/docs"
88-
editLink="Edit this page on GitHub"
85+
docsRepositoryBase="https://github.com/soybeanjs/soybean-admin-react-docs"
86+
editLink="在github上编辑此页面"
8987
footer={footer}
9088
navbar={navbar}
9189
pageMap={pageMap}
9290
sidebar={{ defaultMenuCollapseLevel: 1 }}
91+
feedback={{
92+
content: '反馈',
93+
labels: 'feedback'
94+
}}
9395
>
9496
{children}
9597
</Layout>

‎src/assets/css/global.css

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
--popover: oklch(1 0 0);
1313
--popover-foreground: oklch(0.145 0 0);
1414
--primary: oklch(0.205 0 0);
15+
--soybean:#646cff;
1516
--primary-foreground: oklch(0.985 0 0);
1617
--secondary: oklch(0.97 0 0);
1718
--secondary-foreground: oklch(0.205 0 0);

‎src/components/icons/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { default as Logo } from './logo.svg?svgr';
2+
export { default as QQ } from './qq.svg?svgr';

‎tailwind.config.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ export default {
77
// Or if using `src` directory:
88
'./src/**/*.{js,jsx,ts,tsx,md,mdx}'
99
],
10+
plugins: [],
1011
theme: {
11-
extend: {}
12-
},
13-
plugins: []
14-
}
12+
extend: {
13+
colors: {
14+
soybean: 'var(--soybean)'
15+
}
16+
}
17+
}
18+
};

0 commit comments

Comments
 (0)