feat: create responsive stack component

This commit is contained in:
RadoslavDimchev 2024-01-11 11:09:30 +02:00
parent 5fe3bb1b54
commit e219707d2e

View File

@ -0,0 +1,19 @@
import { CSSProperties, ReactNode } from 'react'
import { XStack, YStack } from 'tamagui'
type ResponsiveStackProps = {
isVerticalAligned?: boolean
children: ReactNode
space?: string
style?: CSSProperties
}
const ResponsiveStack = ({ isVerticalAligned, children, space, style }: ResponsiveStackProps) => {
if (isVerticalAligned) {
return <YStack space={space} style={style}>{children}</YStack>
}
return <XStack space={space} style={style}>{children}</XStack>
}
export default ResponsiveStack