From bfdd1be1488b0d5eec08caa337a75b4273b94249 Mon Sep 17 00:00:00 2001 From: eeymoo Date: Fri, 29 Aug 2025 15:03:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9=E9=85=8D=E7=BD=AE=EF=BC=8C=E4=BC=98=E5=8C=96=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=B1=8F=E5=B9=95=E7=9A=84=E6=B8=B2=E6=9F=93=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/app/features/setting/screen.tsx | 62 ++---------------------- packages/config/src/index.ts | 1 + packages/config/src/settings.ts | 48 ++++++++++++++++++ 3 files changed, 52 insertions(+), 59 deletions(-) create mode 100644 packages/config/src/settings.ts diff --git a/packages/app/features/setting/screen.tsx b/packages/app/features/setting/screen.tsx index 43a97e4..d597dc0 100644 --- a/packages/app/features/setting/screen.tsx +++ b/packages/app/features/setting/screen.tsx @@ -1,67 +1,11 @@ -import { View, Text } from 'react-native' +import { View } from 'react-native' import { Settings } from '@my/ui' -import type { SettingsItemProps } from '@my/ui' +import { settings } from '@my/config' export function SettingsScreen() { - const appName = 'flexlark' - const version = 'dev 0.0.0' - const items: SettingsItemProps[] = [ - { - id: 'notification', - label: '通知', - description: '通知内有关于通知的相关设置', - type: 'group', - options: { - children: [ - { - id: 'enableNotification', - label: '是否通知', - description: '开启后将收到系统通知', - type: 'switch', - options: {}, - }, - { - id: 'notificationContent', - label: '通知内容', - description: '设置通知的内容', - type: 'input', - options: {}, - }, - ], - }, - }, - { - id: 'about', - type: 'group', - label: '关于', - options: { - children: [ - { - id: 'about-flexlark', - label: `关于灵动云雀`, - description: `我们是什么?`, - type: 'link', - options: { - url: 'https://flexlark.org/', - }, - }, - { - id: 'about-app', - label: `关于${appName}`, - description: `当前应用正在激烈开发中`, - type: 'alert', - options: { - message: `版本号:${version}`, - }, - }, - ], - }, - }, - ] - return ( - + ) } diff --git a/packages/config/src/index.ts b/packages/config/src/index.ts index 3c8e896..9a4caf2 100644 --- a/packages/config/src/index.ts +++ b/packages/config/src/index.ts @@ -1 +1,2 @@ export * from './tamagui.config' +export * from './settings' diff --git a/packages/config/src/settings.ts b/packages/config/src/settings.ts new file mode 100644 index 0000000..9abbd6f --- /dev/null +++ b/packages/config/src/settings.ts @@ -0,0 +1,48 @@ +import { SettingsProps } from '@my/ui' + +export const settings: SettingsProps['items'] = [ + { + id: 'notification', + label: '通知', + description: '通知内有关于通知的相关设置', + type: 'group', + options: { + children: [ + { + id: 'enableNotification', + label: '是否通知', + description: '开启后将收到系统通知', + type: 'switch', + options: {}, + }, + ], + }, + }, + { + id: 'about', + type: 'group', + label: '关于', + options: { + children: [ + { + id: 'about-flexlark', + label: `关于灵动云雀`, + description: `我们是什么?`, + type: 'link', + options: { + url: 'https://flexlark.org/', + }, + }, + { + id: 'about-app', + label: `关于灵动云雀`, + description: `当前应用正在激烈开发中`, + type: 'alert', + options: { + message: `版本号: bate v0.0.0`, + }, + }, + ], + }, + }, +]