Skip to content

Commit 9a0f313

Browse files
committed
feat: adding customization parameter
1 parent 47f44f6 commit 9a0f313

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

packages/module/src/WidgetLayout/GridTile.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ const GridTile = ({
178178

179179
return (
180180
<Card
181+
{...widgetConfig.config?.wrapperProps}
181182
ouiaId={`${widgetType}-widget`}
182-
className={clsx('grid-tile', {
183+
className={clsx('grid-tile', widgetConfig.config?.wrapperProps?.className, {
183184
static: widgetConfig.static,
184185
})}
185186
>
@@ -222,7 +223,7 @@ const GridTile = ({
222223
</Flex>
223224
</CardHeader>
224225
<Divider />
225-
<CardBody className="pf-v6-u-p-0">{children}</CardBody>
226+
<CardBody {...widgetConfig.config?.cardBodyProps} className={clsx('pf-v6-u-p-0', widgetConfig.config?.cardBodyProps?.className)}>{children}</CardBody>
226227
</Card>
227228
);
228229
};

packages/module/src/WidgetLayout/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Layout } from 'react-grid-layout';
2+
import { CardProps, CardBodyProps } from '@patternfly/react-core';
23

34
export const widgetIdSeparator = '#';
45

@@ -43,6 +44,8 @@ export interface WidgetConfiguration {
4344
icon?: React.ReactNode;
4445
headerLink?: WidgetHeaderLink;
4546
title?: string;
47+
wrapperProps?: Omit<CardProps, 'children'>;
48+
cardBodyProps?: Omit<CardBodyProps, 'children'>;
4649
}
4750

4851
/**

0 commit comments

Comments
 (0)