Skip to content

Commit

Permalink
modifiying logic for prop 'basis' according what was requested by mai…
Browse files Browse the repository at this point in the history
…ntainers

Signed-off-by: Samuel Valdes Gutierrez <valdesgutierrez@gmail.com>
  • Loading branch information
BigSamu committed Nov 21, 2023
1 parent c58f11a commit 66c8e9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/flex/flex_item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ export const OuiFlexItem: FunctionComponent<
> = ({
children,
className,
grow = true, // true -> use default behaviour 'flex-grow: 1'
shrink = true, // true -> use default behaviour 'flex-shrink: 1'
basis = true, // true -> use default behaviour 'flex-basis: 0%'
grow = true, // use default behaviour 'flex-grow: 1'
shrink = true, // use default behaviour 'flex-shrink: 1'
basis = undefined, // Preserve basis prop coming from parent or grow prop unless specified
component: Component = 'div',
...rest
}) => {
Expand All @@ -114,7 +114,7 @@ export const OuiFlexItem: FunctionComponent<
// use flex-shrink: 0 and flex-basis: auto
'ouiFlexItem--flexShrinkZero': !shrink,
// use flex-basis: auto
'ouiFlexItem--flexBasisAuto': !basis,
'ouiFlexItem--flexBasisAuto': basis === false,
// use flex-grow: {grow} and flex-basis: auto
[`ouiFlexItem--flexGrow${grow}`]:
typeof grow === 'number' ? GROW_SIZES.indexOf(grow) >= 0 : undefined,
Expand Down

0 comments on commit 66c8e9e

Please sign in to comment.