Skip to content

Commit

Permalink
💄 style: 优化暗色主题表现
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Sep 3, 2023
1 parent 8d354b4 commit 47004c5
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
crossOrigin: 'anonymous',
transpilePackages: ['@lobehub/ui'],
async headers() {
return [
{
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@
"@lobehub/chat-plugin-sdk": "^1.15.1",
"@lobehub/chat-plugins-gateway": "^1",
"@lobehub/ui": "latest",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"antd": "^5",
"antd-style": "^3",
"dayjs": "^1",
"next": "^13.4.19",
"next": "13.4.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-layout-kit": "^1"
},
"devDependencies": {
"@lobehub/lint": "latest",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"@vercel/node": "^2",
"@vitest/coverage-v8": "latest",
"commitlint": "^17",
Expand Down
2 changes: 1 addition & 1 deletion public/manifest-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"gender": {
"type": "string",
"enum": ["man", "woman"],
"description": "用户的性别"
"description": "对话用户的性别,需要询问用户后才知道这个信息"
}
},
"required": ["mood", "gender"],
Expand Down
12 changes: 12 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ThemeProvider } from '@lobehub/ui';
import type { AppProps } from 'next/app';

import './global.css';

export default function App({ Component, pageProps }: AppProps) {
return (
<ThemeProvider themeMode={'auto'}>
<Component {...pageProps} />
</ThemeProvider>
);
}
6 changes: 6 additions & 0 deletions src/pages/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
html,
body {
background: transparent !important;
/*使用 iframe 嵌入时,如果在暗色模式下仍需要保持透明背景,需要强制设定 color-scheme 为 light */
color-scheme: light !important;
}
6 changes: 4 additions & 2 deletions src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ export interface ClothesItem {
description: string;
name: string;
}
type Mood = 'happy' | 'sad' | 'anger' | 'fear' | 'surprise' | 'disgust';

export interface ResponseData {
clothes: ClothesItem[];
mood: string;
mood: Mood;
today: number;
}

export interface RequestData {
gender: 'man' | 'woman';
mood: string;
mood: Mood;
}

0 comments on commit 47004c5

Please sign in to comment.