Skip to content

Commit 47004c5

Browse files
committed
💄 style: 优化暗色主题表现
1 parent 8d354b4 commit 47004c5

File tree

6 files changed

+27
-7
lines changed

6 files changed

+27
-7
lines changed

next.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
33
reactStrictMode: true,
4-
crossOrigin: 'anonymous',
4+
transpilePackages: ['@lobehub/ui'],
55
async headers() {
66
return [
77
{

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@
3838
"@lobehub/chat-plugin-sdk": "^1.15.1",
3939
"@lobehub/chat-plugins-gateway": "^1",
4040
"@lobehub/ui": "latest",
41-
"@types/react": "18.2.21",
42-
"@types/react-dom": "18.2.7",
4341
"antd": "^5",
4442
"antd-style": "^3",
4543
"dayjs": "^1",
46-
"next": "^13.4.19",
44+
"next": "13.4.7",
4745
"react": "^18.2.0",
4846
"react-dom": "^18.2.0",
4947
"react-layout-kit": "^1"
5048
},
5149
"devDependencies": {
5250
"@lobehub/lint": "latest",
51+
"@types/react": "18.2.21",
52+
"@types/react-dom": "18.2.7",
5353
"@vercel/node": "^2",
5454
"@vitest/coverage-v8": "latest",
5555
"commitlint": "^17",

public/manifest-dev.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"gender": {
1515
"type": "string",
1616
"enum": ["man", "woman"],
17-
"description": "用户的性别"
17+
"description": "对话用户的性别,需要询问用户后才知道这个信息"
1818
}
1919
},
2020
"required": ["mood", "gender"],

src/pages/_app.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { ThemeProvider } from '@lobehub/ui';
2+
import type { AppProps } from 'next/app';
3+
4+
import './global.css';
5+
6+
export default function App({ Component, pageProps }: AppProps) {
7+
return (
8+
<ThemeProvider themeMode={'auto'}>
9+
<Component {...pageProps} />
10+
</ThemeProvider>
11+
);
12+
}

src/pages/global.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
html,
2+
body {
3+
background: transparent !important;
4+
/*使用 iframe 嵌入时,如果在暗色模式下仍需要保持透明背景,需要强制设定 color-scheme 为 light */
5+
color-scheme: light !important;
6+
}

src/type.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ export interface ClothesItem {
22
description: string;
33
name: string;
44
}
5+
type Mood = 'happy' | 'sad' | 'anger' | 'fear' | 'surprise' | 'disgust';
6+
57
export interface ResponseData {
68
clothes: ClothesItem[];
7-
mood: string;
9+
mood: Mood;
810
today: number;
911
}
1012

1113
export interface RequestData {
1214
gender: 'man' | 'woman';
13-
mood: string;
15+
mood: Mood;
1416
}

0 commit comments

Comments
 (0)