Skip to content

Commit 01a88a3

Browse files
committed
Add classname to the grid wrapper
1 parent ea38266 commit 01a88a3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@domparty/fe",
3-
"version": "0.0.73",
3+
"version": "0.0.75",
44
"description": "Our white-label front-end component library. Filled with functional components to help you kick-start your project 🚀",
55
"main": "components/index.js",
66
"scripts": {

src/components/grid/Grid.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface GridProps {
99
fullHeight?: boolean;
1010
style?: {};
1111
slices?: any;
12+
className?: string | null;
1213
}
1314

1415
export default function Grid({
@@ -18,6 +19,7 @@ export default function Grid({
1819
gap = 0,
1920
fullHeight = false,
2021
style: innerStyle = {},
22+
className = null,
2123
}: GridProps) {
2224
if (typeof children === 'undefined') return null;
2325
const childs = Array.isArray(children) === false ? [children] : children;
@@ -70,15 +72,17 @@ export default function Grid({
7072
.join('')}
7173
`;
7274

73-
console.log('externalClassname', externalClassname);
74-
7575
return cloneElement(c, {
7676
className: `${className}${externalClassname ? ` ${externalClassname}` : ''}`,
7777
});
7878
}
7979

80+
const wrapperProps = {
81+
...(className ? { className, style: wrapperStyle } : { style: wrapperStyle }),
82+
};
83+
8084
return (
8185
// @ts-ignore
82-
<div style={wrapperStyle}>{childs.map(renderChild)}</div>
86+
<div {...wrapperProps}>{childs.map(renderChild)}</div>
8387
);
8488
}

0 commit comments

Comments
 (0)