Skip to content

Commit

Permalink
Add stories for responsive props in Flex and Grid (#2014)
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Snow <rsnow@adobe.com>
  • Loading branch information
devongovett and snowystinger committed Jul 14, 2021
1 parent 64e41c5 commit 74040b7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/@react-spectrum/layout/stories/Flex.stories.tsx
Expand Up @@ -159,4 +159,14 @@ storiesOf('Flex', module)
<View backgroundColor="magenta-600" order={1} width="size-800" height="size-800" />
</Flex>
)
)
.add(
'responsive',
() => (
<Flex direction={{base: 'column', L: 'row'}} gap={{base: 'size-100', M: 'size-250', L: 'size-350'}}>
<View backgroundColor="celery-600" width="size-800" height="size-800" />
<View backgroundColor="blue-600" width="size-800" height="size-800" />
<View backgroundColor="magenta-600" width="size-800" height="size-800" />
</Flex>
)
);
15 changes: 15 additions & 0 deletions packages/@react-spectrum/layout/stories/Grid.stories.tsx
Expand Up @@ -59,6 +59,21 @@ storiesOf('Grid', module)
)}
</Grid>
)
)
.add(
'responsive',
() => (
<Grid
columns={{base: repeat('auto-fit', 'size-800'), M: repeat('auto-fit', 'size-1200'), L: repeat('auto-fit', 'size-2000')}}
autoRows={{base: 'size-800', M: 'size-1200', L: 'size-2000'}}
justifyContent="center"
width="80%"
gap={{base: 'size-100', M: 'size-250', L: 'size-350'}}>
{colors.map(color =>
<View key={color} backgroundColor={color} />
)}
</Grid>
)
);

// function render(props: GridProps) {
Expand Down

0 comments on commit 74040b7

Please sign in to comment.