包括 子组件input、switch、alert、line、link、group 包括 实现 SettingStore 状态管理 (MobX) 支持持久化 包括 类型相关内容声明
68 lines
1.6 KiB
TypeScript
68 lines
1.6 KiB
TypeScript
import { View, Text } from 'react-native'
|
|
import { Settings } from '@my/ui'
|
|
import type { SettingsItemProps } from '@my/ui'
|
|
|
|
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 (
|
|
<View>
|
|
<Settings items={items} />
|
|
</View>
|
|
)
|
|
}
|