From 8a71994735112ea4698a175bec93392722ef8045 Mon Sep 17 00:00:00 2001 From: jborchardt Date: Tue, 6 Nov 2018 13:04:28 +0100 Subject: [PATCH] allow to pass a translation component with proptype node on to show more tab --- README.md | 2 +- src/components/ShowMore.js | 5 ++++- src/index.js | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index eac2a83..23bb3ea 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ render(, document.getElementById('root')); | onChange | Function | onChange callback | undefined | | selectedTabKey | Number/String | Selected tab | undefined | | showMore | Bool | Whether to show `Show more` or not | `true` | -| showMoreLabel | String | `Show more` tab name | `...` | +| showMoreLabel | String/Node | `Show more` tab name | `...` | | transform | Bool | Transform to accordion when the wrapper width is less than `transformWidth`. | `true` | | transformWidth | Number | Transform width. | 800 | | tabsWrapperClass | String | Wrapper class | undefined | diff --git a/src/components/ShowMore.js b/src/components/ShowMore.js index 1361bdf..19ce475 100644 --- a/src/components/ShowMore.js +++ b/src/components/ShowMore.js @@ -115,7 +115,10 @@ ShowMore.propTypes = { hasChildSelected: PropTypes.bool, isShown: PropTypes.bool.isRequired, onShowMoreChanged: PropTypes.func, - label: PropTypes.string + label: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.node, + ]), }; ShowMore.defaultProps = { diff --git a/src/index.js b/src/index.js index 8aa2ba0..0bdcb68 100644 --- a/src/index.js +++ b/src/index.js @@ -374,7 +374,10 @@ Tabs.propTypes = { tabClass: PropTypes.string, panelClass: PropTypes.string, // labels - showMoreLabel: PropTypes.string + showMoreLabel: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.node, + ]), }; Tabs.defaultProps = {