Skip to content

Commit

Permalink
fix(ChartDonut): Replaced prop titleComponent if function `getSubTi…
Browse files Browse the repository at this point in the history
…tle` by `subTitleComponent`.

Previously `ChartDonut` component for building `subTitle` used prop `titleComponent`, while prop
`subTitleComponent` was unused. So in this PR `titleComponent` in `getSubtitle` was replaced by
`subTitleComponent`.

fix patternfly#2486
  • Loading branch information
bond95 committed Jul 9, 2019
1 parent 5507f06 commit 37a8688
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ export const ChartDonut: React.FunctionComponent<ChartDonutProps> = ({
if (!subTitle || subTitlePosition === ChartDonutSubTitlePosition.center) {
return null;
}
const subTitleProps = titleComponent.props ? titleComponent.props : {};
return React.cloneElement(titleComponent, {
const subTitleProps = subTitleComponent.props ? subTitleComponent.props : {};
return React.cloneElement(subTitleComponent, {
style: ChartDonutStyles.label.subTitle,
text: subTitle,
textAnchor: subTitlePosition === 'right' ? 'start' : 'middle',
Expand Down

0 comments on commit 37a8688

Please sign in to comment.