Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WRP-21128: Fixed components used in enact/ui/Layout/Cell which cannot have their css customized in consumer apps. #3162

Merged
merged 9 commits into from
Mar 22, 2024
6 changes: 6 additions & 0 deletions packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

The following is a curated list of changes in the Enact ui module, newest changes on the top.

## [unreleased]

### Added

- `ui/Layout.Cell` prop `componentCss` in order to pass classes to the `Cell` component
alexandrumorariu marked this conversation as resolved.
Show resolved Hide resolved

## [4.7.2] - 2023-07-14

No significant changes.
Expand Down
15 changes: 13 additions & 2 deletions packages/ui/Layout/Cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ const CellBase = kind({
*/
component: EnactPropTypes.renderable,

/**
* Css that is passed to the component used to render as the `Cell`.
alexandrumorariu marked this conversation as resolved.
Show resolved Hide resolved
*
* When using {@link ui/Layout.Cell}, the `css` prop is forwarded to this component
0x64 marked this conversation as resolved.
Show resolved Hide resolved
* as `componentCss`.
*
* @type {Object}
* @public
*/
componentCss: PropTypes.object,

/**
* Called with a reference to the root component.
*
Expand Down Expand Up @@ -162,13 +173,13 @@ const CellBase = kind({
}
},

render: ({component: Component, componentRef, ...rest}) => {
render: ({component: Component, componentCss, componentRef, ...rest}) => {
delete rest.align;
delete rest.grow;
delete rest.shrink;
delete rest.size;

return <Component ref={componentRef} {...rest} />;
return <Component css={componentCss} ref={componentRef} {...rest} />;
}
});

Expand Down