Skip to content

Commit

Permalink
feat(FlexLayout): adds flexWrap prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Firsov committed Mar 26, 2019
1 parent 107ff83 commit 30edec7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/FlexLayout/FlexLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type FlexLayoutCommonProps = {
justifyContent?: PropLayoutStretch,
alignContent?: PropLayout,
alignItems?: PropLayoutStretch,
flexWrap?: 'wrap' | 'nowrap' | 'wrap-reverse',
gap?: PropSizes,
offsetX?: PropSizes,
offsetY?: PropSizes,
Expand Down Expand Up @@ -53,6 +54,7 @@ FlexLayout.defaultProps = {
justifyContent: 'start',
alignContent: 'start',
alignItems: 'start',
flexWrap: 'nowrap',
offestX: 'none',
offestY: 'none',
cursor: 'inherit',
Expand Down
2 changes: 1 addition & 1 deletion src/components/FlexLayout/FlexLayout.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const alignItemsStyles = {
stretch: 'stretch',
};


const getGapStyle = (direction: 'row' | 'column', gapProp: $Keys<typeof gapSizes>) =>
direction === 'row'
? {
Expand Down Expand Up @@ -72,6 +71,7 @@ const [FlexLayoutTag, theme] = createThemeTag(name, {
justifyContent: justifyContentStyles[props.justifyContent],
alignContent: alignContentStyles[props.alignContent],
alignItems: alignItemsStyles[props.alignItems],
flexWrap: props.flexWrap,

paddingLeft: paddingSizes[props.offsetX] || paddingSizes[props.offsetLeft],
paddingRight: paddingSizes[props.offsetX] || paddingSizes[props.offsetRight],
Expand Down
3 changes: 3 additions & 0 deletions src/components/Form/__snapshots__/Form.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exports[`<Form /> should shallow form 1`] = `
alignItems="stretch"
cursor="inherit"
direction="column"
flexWrap="nowrap"
gap="md"
grow={false}
growChildren={false}
Expand Down Expand Up @@ -84,6 +85,7 @@ exports[`<Form /> should shallow form section 1`] = `
alignItems="start"
cursor="inherit"
direction="column"
flexWrap="nowrap"
gap="sm"
grow={false}
growChildren={false}
Expand All @@ -103,6 +105,7 @@ exports[`<Form /> should shallow form section body 1`] = `
alignItems="stretch"
cursor="inherit"
direction="column"
flexWrap="nowrap"
gap="md"
grow={false}
growChildren={false}
Expand Down

0 comments on commit 30edec7

Please sign in to comment.