From 47004c5ca8b1bd6ac1bef47d4b3b8c67c30dd7a5 Mon Sep 17 00:00:00 2001 From: arvinxx Date: Sun, 3 Sep 2023 18:16:53 +0800 Subject: [PATCH] =?UTF-8?q?:lipstick:=20style:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=9A=97=E8=89=B2=E4=B8=BB=E9=A2=98=E8=A1=A8=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- next.config.mjs | 2 +- package.json | 6 +++--- public/manifest-dev.json | 2 +- src/pages/_app.tsx | 12 ++++++++++++ src/pages/global.css | 6 ++++++ src/type.ts | 6 ++++-- 6 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 src/pages/_app.tsx create mode 100644 src/pages/global.css diff --git a/next.config.mjs b/next.config.mjs index 55368fb..c81fa3b 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,7 +1,7 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, - crossOrigin: 'anonymous', + transpilePackages: ['@lobehub/ui'], async headers() { return [ { diff --git a/package.json b/package.json index 31eba33..3b54082 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/public/manifest-dev.json b/public/manifest-dev.json index fc1ef07..7ae5be9 100644 --- a/public/manifest-dev.json +++ b/public/manifest-dev.json @@ -14,7 +14,7 @@ "gender": { "type": "string", "enum": ["man", "woman"], - "description": "用户的性别" + "description": "对话用户的性别,需要询问用户后才知道这个信息" } }, "required": ["mood", "gender"], diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx new file mode 100644 index 0000000..8fe3c1f --- /dev/null +++ b/src/pages/_app.tsx @@ -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 ( + + + + ); +} diff --git a/src/pages/global.css b/src/pages/global.css new file mode 100644 index 0000000..9dc4891 --- /dev/null +++ b/src/pages/global.css @@ -0,0 +1,6 @@ +html, +body { + background: transparent !important; + /*使用 iframe 嵌入时,如果在暗色模式下仍需要保持透明背景,需要强制设定 color-scheme 为 light */ + color-scheme: light !important; +} diff --git a/src/type.ts b/src/type.ts index 1d82a23..48f016d 100644 --- a/src/type.ts +++ b/src/type.ts @@ -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; }