Skip to content

Commit 5d19377

Browse files
committed
feat(LayoutContent): add support for additional modifiers in props
1 parent 717151f commit 5d19377

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/components/content/Layout/LayoutContent.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,21 @@ export interface CubeLayoutContentProps extends BaseProps, ContainerStyleProps {
8989
/** Scrollbar style: 'default' | 'thin' | 'tiny' | 'none' */
9090
scrollbar?: ScrollbarType;
9191
children?: ReactNode;
92+
/** Additional modifiers to apply */
93+
mods?: Record<string, boolean | undefined>;
9294
}
9395

9496
function LayoutContent(
9597
props: CubeLayoutContentProps,
9698
ref: ForwardedRef<HTMLDivElement>,
9799
) {
98-
const { children, scrollbar = 'thin', styles, ...otherProps } = props;
100+
const {
101+
children,
102+
scrollbar = 'thin',
103+
styles,
104+
mods: externalMods,
105+
...otherProps
106+
} = props;
99107
const outerStyles = extractStyles(otherProps, OUTER_STYLES);
100108
const innerStyles = extractStyles(otherProps, INNER_STYLES);
101109
const innerRef = useRef<HTMLDivElement>(null);
@@ -117,10 +125,11 @@ function LayoutContent(
117125

118126
const mods = useMemo(
119127
() => ({
128+
...externalMods,
120129
scrollbar,
121130
hovered: isHovered,
122131
}),
123-
[scrollbar, isHovered],
132+
[externalMods, scrollbar, isHovered],
124133
);
125134

126135
// Merge styles: outer styles to root, inner styles to Inner element

0 commit comments

Comments
 (0)