refactor: buttons convert to ts
This commit is contained in:
parent
ce712c621b
commit
0bb728eacf
|
@ -1,12 +0,0 @@
|
|||
import { Icon } from '../Icon/Icon'
|
||||
import { ReactButton } from './ReactButton'
|
||||
|
||||
const IconButton = ({ icon, text, ...props }) => {
|
||||
return (
|
||||
<ReactButton {...props} icon={<Icon source={icon} />}>
|
||||
{text}
|
||||
</ReactButton>
|
||||
)
|
||||
}
|
||||
|
||||
export default IconButton
|
|
@ -0,0 +1,18 @@
|
|||
import Icon from './Icon'
|
||||
import ReactButton from './ReactButton'
|
||||
|
||||
type IconButtonProps = {
|
||||
icon: string
|
||||
children: string
|
||||
onClick: () => void
|
||||
}
|
||||
|
||||
const IconButton = ({ icon, children, ...props }: IconButtonProps) => {
|
||||
return (
|
||||
<ReactButton {...props} icon={<Icon source={icon} />}>
|
||||
{children}
|
||||
</ReactButton>
|
||||
)
|
||||
}
|
||||
|
||||
export default IconButton
|
|
@ -1,7 +0,0 @@
|
|||
import { Button } from 'tamagui'
|
||||
|
||||
const ReactButton = ({ children, ...props }) => {
|
||||
return <Button {...props}>{children}</Button>
|
||||
}
|
||||
|
||||
export default ReactButton
|
|
@ -0,0 +1,16 @@
|
|||
import { Button } from 'tamagui'
|
||||
import { ReactNode } from 'react'
|
||||
|
||||
type ReactButtonProps = {
|
||||
children: string
|
||||
style?: unknown
|
||||
icon?: ReactNode
|
||||
size?: string
|
||||
onClick: () => void
|
||||
}
|
||||
|
||||
const ReactButton = ({ children, ...props }: ReactButtonProps) => {
|
||||
return <Button {...props}>{children}</Button>
|
||||
}
|
||||
|
||||
export default ReactButton
|
Loading…
Reference in New Issue