Skip to content

Commit 99a752e

Browse files
authored
fix(tables-headers): fix positioning of sorting icons
2 parents f5b2829 + f5260f6 commit 99a752e

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

src/theme/theme.tsx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,14 @@ import { PALETTE } from "@/theme/palette"
3232
import { TYPOGRAPHY } from "@/theme/typography"
3333
import { lh, pxToRem } from "@/theme/units"
3434

35-
type GridSortIconProps = React.ComponentProps<typeof SvgIcon> & {
36-
sortingOrder?: unknown
37-
}
38-
3935
const createGridSortIcon = (
40-
IconComponent: React.ComponentType<React.SVGProps<SVGElement>>,
36+
IconComponent: React.FC<React.SVGProps<SVGElement>>,
4137
displayName: string,
4238
) => {
43-
const GridSortIcon = React.forwardRef<SVGSVGElement, GridSortIconProps>(
44-
(props, ref) => {
45-
const iconProps = { ...props }
46-
delete iconProps.sortingOrder
47-
48-
return (
49-
<SvgIcon ref={ref} inheritViewBox {...iconProps}>
50-
<IconComponent />
51-
</SvgIcon>
52-
)
53-
},
54-
)
39+
const GridSortIcon = React.forwardRef<
40+
SVGElement,
41+
React.SVGProps<SVGElement> & { sortingOrder?: unknown }
42+
>(({ sortingOrder, ...props }, ref) => <IconComponent ref={ref} {...props} />)
5543

5644
GridSortIcon.displayName = displayName
5745

0 commit comments

Comments
 (0)