mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-05-23 22:37:41 +08:00
30 lines
774 B
TypeScript
30 lines
774 B
TypeScript
import { memo } from 'react'
|
|
|
|
import Button, { type BtnProps } from '@/components/common/Button'
|
|
import Text from '@/components/common/Text'
|
|
import { useTheme } from '@/store/theme/hook'
|
|
import { createStyle } from '@/utils/tools'
|
|
|
|
export type ButtonProps = BtnProps
|
|
|
|
export default memo(({ disabled, onPress, children }: ButtonProps) => {
|
|
const theme = useTheme()
|
|
|
|
return (
|
|
<Button style={{ ...styles.button, backgroundColor: theme['c-button-background'] }} onPress={onPress} disabled={disabled}>
|
|
<Text size={14} color={theme['c-button-font']}>{children}</Text>
|
|
</Button>
|
|
)
|
|
})
|
|
|
|
const styles = createStyle({
|
|
button: {
|
|
paddingLeft: 10,
|
|
paddingRight: 10,
|
|
paddingTop: 5,
|
|
paddingBottom: 5,
|
|
borderRadius: 4,
|
|
marginRight: 10,
|
|
},
|
|
})
|