Skip to content

Commit

Permalink
Also accept false as value for sxx
Browse files Browse the repository at this point in the history
  • Loading branch information
paales committed Jan 3, 2025
1 parent f5fe848 commit b076b2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/heavy-squids-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/next-ui': patch
---

Also accept false as value for sxx
4 changes: 2 additions & 2 deletions packages/next-ui/utils/sxx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import type { SxProps, Theme } from '@mui/material'
* sxx({ position: 'absolute', right: 0, top: 0 }, props.sx)
* ```
*/
export const sxx = (...sxPropsArray: (SxProps<Theme> | undefined)[]): SxProps<Theme> =>
export const sxx = (...sxPropsArray: (SxProps<Theme> | undefined | false)[]): SxProps<Theme> =>
sxPropsArray
.filter((v) => v !== undefined)
.filter((v) => !!v)
.map((sx) => (Array.isArray(sx) ? sx : [sx]))
.flat(1)

0 comments on commit b076b2a

Please sign in to comment.