Skip to content

Commit

Permalink
Fix wide alignY
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltaranto committed Sep 9, 2024
1 parent ddf9721 commit a0dc844
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ export function resolveCollapsibleAlignmentProps({
mobile: alignMobile = 'flexStart',
tablet: alignTablet = alignMobile,
desktop: alignDesktop = alignTablet,
wide: alignWide = alignTablet,
wide: alignWide = alignDesktop,
} = normalizedAlign;

// COLLAPSED HORIZONTAL ALIGNMENT
const collapsedAlignItems = [
collapseMobile && alignMobile === 'flexStart' ? 'stretch' : alignMobile,
collapseTablet && alignTablet === 'flexStart' ? 'stretch' : alignTablet,
collapseDesktop && alignDesktop === 'flexStart' ? 'stretch' : alignDesktop,
alignYWide,
// wide doesnt collapse, no check needed here
] as const;

return {
Expand All @@ -96,7 +96,7 @@ export function resolveCollapsibleAlignmentProps({
flexDirection: optimizeResponsiveArray(flexDirection),
justifyContent: align
? optimizeResponsiveArray([
alignMobile,
alignMobile, // mobile doesnt reverse, no check needed here
reverse ? invertAlignment(alignTablet) : alignTablet,
reverse ? invertAlignment(alignDesktop) : alignDesktop,
reverse ? invertAlignment(alignWide) : alignWide,
Expand All @@ -107,7 +107,7 @@ export function resolveCollapsibleAlignmentProps({
collapseMobile ? collapsedAlignItems[0] : alignYMobile,
collapseTablet ? collapsedAlignItems[1] : alignYTablet,
collapseDesktop ? collapsedAlignItems[2] : alignYDesktop,
collapsedAlignItems[3],
alignYWide, // wide doesnt collapse, no check needed here
])
: nonCollapsedAlignItems,
},
Expand Down

0 comments on commit a0dc844

Please sign in to comment.