mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-09 18:13:39 +00:00
feat: create responsive stack component
This commit is contained in:
parent
5fe3bb1b54
commit
e219707d2e
19
src/components/General/ResponsiveStack.tsx
Normal file
19
src/components/General/ResponsiveStack.tsx
Normal 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
|
Loading…
x
Reference in New Issue
Block a user