Skip to content

Commit

Permalink
STCOM-1384 wrap Card render output with StripesOverlayContext (#2391)
Browse files Browse the repository at this point in the history
(cherry picked from commit 46ce739)
  • Loading branch information
JohnC-80 authored and zburke committed Nov 19, 2024
1 parent 7382deb commit abd4058
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change history for stripes-components

## 12.2.6 IN PROGRESS

* Wrap `<Card>`'s render output in `<StripesOverlayContext>` to facilitate ease with overlay components. Refs STCOM-1384.

## [12.2.5](https://github.com/folio-org/stripes-components/tree/v12.2.5) (2024-11-15)
[Full Changelog](https://github.com/folio-org/stripes-components/compare/v12.2.4...v12.2.5)

Expand Down
21 changes: 12 additions & 9 deletions lib/Card/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import omitProps from '../../util/omitProps';

import css from './Card.css';
import DefaultCardHeader from './headers/DefaultCardHeader';
import StripesOverlayWrapper from '../../util/StripesOverlayWrapper';

export default class Card extends React.Component {
static propTypes = {
Expand Down Expand Up @@ -73,18 +74,20 @@ export default class Card extends React.Component {
]);

return (
<div
className={this.getCardStyle()}
{...customProps}
>
<HeaderComponent {...this.props} />
<StripesOverlayWrapper>
<div
data-test-card-body
className={`${css.body} ${bodyClass || ''}`}
className={this.getCardStyle()}
{...customProps}
>
{children}
<HeaderComponent {...this.props} />
<div
data-test-card-body
className={`${css.body} ${bodyClass || ''}`}
>
{children}
</div>
</div>
</div>
</StripesOverlayWrapper>
);
}
}

0 comments on commit abd4058

Please sign in to comment.