mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-20 15:18:33 +00:00
refactor: rest icon components to tsx
This commit is contained in:
parent
0bb728eacf
commit
67898225d1
@ -1,9 +1,10 @@
|
|||||||
import { Image } from 'tamagui'
|
import { Image } from 'tamagui'
|
||||||
|
|
||||||
type IconProps = {
|
export type IconProps = {
|
||||||
source: string
|
source: string
|
||||||
width?: number
|
width?: number
|
||||||
height?: number
|
height?: number
|
||||||
|
style?: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
const Icon = ({ source, width = 16, height = 16, ...props }: IconProps) => {
|
const Icon = ({ source, width = 16, height = 16, ...props }: IconProps) => {
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
import { Paragraph, XStack } from 'tamagui'
|
import { Paragraph, XStack } from 'tamagui'
|
||||||
import { Icon } from '../Icon/Icon'
|
import Icon from './Icon'
|
||||||
|
|
||||||
const IconText = ({ icon, text, ...props }) => {
|
type IconTextProps = {
|
||||||
|
icon: string
|
||||||
|
children: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const IconText = ({ icon, children, ...props }: IconTextProps) => {
|
||||||
return (
|
return (
|
||||||
<XStack
|
<XStack
|
||||||
style={{
|
style={{
|
||||||
@ -11,7 +16,7 @@ const IconText = ({ icon, text, ...props }) => {
|
|||||||
>
|
>
|
||||||
<Icon source={icon} width={16} height={16} />
|
<Icon source={icon} width={16} height={16} />
|
||||||
<Paragraph {...props} color={'#000000'}>
|
<Paragraph {...props} color={'#000000'}>
|
||||||
{text}
|
{children}
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
</XStack>
|
</XStack>
|
||||||
)
|
)
|
Loading…
x
Reference in New Issue
Block a user