refactor: 精简设置项组件的属性解构,移除未使用的变量
This commit is contained in:
@@ -11,7 +11,7 @@ import { SettingsGroup } from './items/SettingsGroup'
|
||||
import { SettingsLink } from './items/SettingsLink'
|
||||
|
||||
export function SettingsItem(props: SettingsItemProps) {
|
||||
const { label, description, type } = props
|
||||
const { type } = props
|
||||
const Component = settingsItemRander(type)
|
||||
return <Component {...props} />
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ListItem, Toast, useToastController, useToastState, YStack } from '@my/ui'
|
||||
import type { SettingsAlertOption, SettingsItemProps } from '@my/ui'
|
||||
import { useCallback, useState } from 'react'
|
||||
import type { SettingsItemProps } from '@my/ui'
|
||||
import { useCallback } from 'react'
|
||||
|
||||
export interface SettingsAlertProps {
|
||||
title: string
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ListItem, Toast, useToastController, useToastState, YStack } from '@my/ui'
|
||||
import type { SettingsAlertOption, SettingsItemProps } from '@my/ui'
|
||||
import { useCallback, useState } from 'react'
|
||||
import type { SettingsItemProps } from '@my/ui'
|
||||
import { useCallback } from 'react'
|
||||
|
||||
export interface SettingsAlertProps {
|
||||
title: string
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Button, Input, XStack, YStack, styled, Text, View } from '@my/ui'
|
||||
import { Button, Input, XStack, YStack, styled, Text } from '@my/ui'
|
||||
import { withSettingsSheet, WithSettingsSheetProps } from './SettingsSheet'
|
||||
import { useState } from 'react'
|
||||
import { settingsStore } from '../../store'
|
||||
@@ -33,7 +33,7 @@ const Footer = styled(XStack, {
|
||||
})
|
||||
|
||||
const SettingsInputComponent = (props: WithSettingsSheetProps<'input'>) => {
|
||||
const { label, icon, description, disabled, options, onClose } = props
|
||||
const { label, description, onClose } = props
|
||||
const [value, setValue] = useState('')
|
||||
/**
|
||||
* 确认按钮事件
|
||||
|
||||
@@ -10,9 +10,7 @@ const Line = styled(Separator, {
|
||||
marginVertical: '$4',
|
||||
})
|
||||
|
||||
export const SettingsLine = (props: SettingsItemProps<'alert'>) => {
|
||||
const { label } = props
|
||||
|
||||
export const SettingsLine = (_props: SettingsItemProps<'alert'>) => {
|
||||
return (
|
||||
<>
|
||||
<Line alignSelf="stretch" />
|
||||
|
||||
@@ -8,6 +8,7 @@ export interface SettingsAlertProps {
|
||||
}
|
||||
|
||||
export const SettingsPage = (props: SettingsItemProps<'alert'>) => {
|
||||
// TODO 尚未完成开发
|
||||
const { label, icon, description, disabled, options } = props
|
||||
const toast = useToastController()
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import { ListItem, Sheet } from '@my/ui'
|
||||
import type { SettingsItemProps } from '@my/ui'
|
||||
import { useState } from 'react'
|
||||
import { withSettingsSheet, WithSettingsSheetProps } from './SettingsSheet'
|
||||
|
||||
const SettingsSelectComponent = (props: WithSettingsSheetProps<'select'>) => {
|
||||
const { label, icon, description, disabled, options } = props
|
||||
|
||||
// TODO 尚未完成开发
|
||||
return <></>
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user