Skip to content

Commit 4baf006

Browse files
committed
fix: Flex container should be column by default
1 parent dcdc9c6 commit 4baf006

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/components/containers.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ describe('Containers', () => {
3636
expect(element.tagName).toEqual('DIV')
3737
const style = getComputedStyle(element)
3838
expect(style.display).toEqual('flex')
39+
expect(style.flexDirection).toEqual('column')
3940
expect(style.maxWidth).toEqual('36rem')
4041
expect(style.marginLeft).toEqual('auto')
4142
expect(style.marginRight).toEqual('auto')
@@ -51,6 +52,7 @@ describe('Containers', () => {
5152
expect(element.tagName).toEqual('DIV')
5253
const style = getComputedStyle(element)
5354
expect(style.display).toEqual('flex')
55+
expect(style.flexDirection).toEqual('column')
5456
expect(style.maxWidth).toEqual('48rem')
5557
expect(style.marginLeft).toEqual('auto')
5658
expect(style.marginRight).toEqual('auto')
@@ -64,6 +66,7 @@ describe('Containers', () => {
6466
expect(element.tagName).toEqual('DIV')
6567
const style = getComputedStyle(element)
6668
expect(style.display).toEqual('flex')
69+
expect(style.flexDirection).toEqual('column')
6770
expect(style.maxWidth).toEqual('36rem')
6871
expect(style.marginLeft).toEqual('auto')
6972
expect(style.marginRight).toEqual('auto')
@@ -79,6 +82,7 @@ describe('Containers', () => {
7982
expect(element.tagName).toEqual('DIV')
8083
const style = getComputedStyle(element)
8184
expect(style.display).toEqual('flex')
85+
expect(style.flexDirection).toEqual('column')
8286
expect(style.maxWidth).toEqual('48rem')
8387
expect(style.marginLeft).toEqual('auto')
8488
expect(style.marginRight).toEqual('auto')

src/components/containers.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,15 @@ export const FlexContainer: React.FC<FlexContainerProps> = ({
3333
wide = false,
3434
...props
3535
}) => {
36-
return <Flex maxW={wide ? '3xl' : 'xl'} mx="auto" px={2} {...props} />
36+
return (
37+
<Flex
38+
direction="column"
39+
maxW={wide ? '3xl' : 'xl'}
40+
mx="auto"
41+
px={2}
42+
{...props}
43+
/>
44+
)
3745
}
3846

3947
// --

0 commit comments

Comments
 (0)