Skip to content

Commit

Permalink
Merge branch 'master' into feat/button-progress
Browse files Browse the repository at this point in the history
  • Loading branch information
blumendorf committed Dec 12, 2019
2 parents e1c2443 + 52e491b commit 61a861a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@
- chore: upgraded styles
- feat: added logout icon
- fix: reduce the size of the package

#v1.2.1
- fix(styles): remove transition for modal background due to slowness on 4K Monitors
- fix(styles): table header is now blue
- fix(styles): sidebar color is applied to tabs background
- fix: pass className prop to tabs
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lightelligence/react",
"version": "1.2.0",
"version": "1.2.1",
"license": "MIT",
"repository": {
"type": "git",
Expand Down Expand Up @@ -32,6 +32,7 @@
"humps": "^2.0.1",
"prop-types": "^15.6.2",
"react-circular-progressbar": "^2.0.3",
"react-is": "^16.12.0",
"tinycolor2": "^1.4.1"
},
"devDependencies": {
Expand Down
9 changes: 7 additions & 2 deletions src/content/BasicCardTable/BasicCardTableCardItem.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { Fragment, useMemo } from 'react';
import React, { useMemo } from 'react';
import * as olt from '@lightelligence/styles';
import { isForwardRef, isFragment } from 'react-is';
import { node, bool, shape, string, oneOf } from 'prop-types';
import classnames from 'classnames';
import { BasicCardTableTitle } from './BasicCardTableTitle';
Expand All @@ -9,10 +10,14 @@ const contentRequiresWrapping = (children) => {
if (Array.isArray(children)) {
return contentRequiresWrapping(children[0]);
}
if (children.type === Fragment) {
if (isFragment(children)) {
return contentRequiresWrapping(children.props.children);
}

if (isForwardRef(children)) {
return false;
}

return !children.type || children.type !== BasicCardTableContent;
};

Expand Down
14 changes: 14 additions & 0 deletions src/content/BasicCardTable/BasicCardTableCardItem.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ describe('BasicCardTableItem', () => {
).toBeTruthy();
});

test('renders forwardRef of content', async () => {
const Content = React.forwardRef((props, ref) => (
<BasicCardTableContent {...props}>Foo</BasicCardTableContent>
));

const { container } = renderCardItem({
children: <Content />,
});

expect(
container.querySelectorAll(`.${oltStyles.CardTableContent}`).length,
).toBe(1);
});

test('renders array of content children', async () => {
const { container } = renderCardItem({
children: [
Expand Down

0 comments on commit 61a861a

Please sign in to comment.