Skip to content

Commit

Permalink
Update default prop logic for heading
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos committed May 5, 2022
1 parent f209dd4 commit 8cde1f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src-docs/src/views/call_out/call_out_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const CallOutExample = {
title: 'Info',
source: [
{
type: GuideSectionTypes.JS,
type: GuideSectionTypes.TSX,
code: infoSource,
},
],
Expand All @@ -107,7 +107,7 @@ export const CallOutExample = {
title: 'Success',
source: [
{
type: GuideSectionTypes.JS,
type: GuideSectionTypes.TSX,
code: successSource,
},
],
Expand All @@ -125,7 +125,7 @@ export const CallOutExample = {
title: 'Warning',
source: [
{
type: GuideSectionTypes.JS,
type: GuideSectionTypes.TSX,
code: warningSource,
},
],
Expand All @@ -141,7 +141,7 @@ export const CallOutExample = {
title: 'Danger',
source: [
{
type: GuideSectionTypes.JS,
type: GuideSectionTypes.TSX,
code: dangerSource,
},
],
Expand Down
6 changes: 3 additions & 3 deletions src/components/call_out/call_out.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const EuiCallOut = forwardRef<HTMLDivElement, EuiCallOutProps>(
iconType,
children,
className,
heading,
heading = 'p',
...rest
},
ref: Ref<HTMLDivElement>
Expand Down Expand Up @@ -102,10 +102,9 @@ export const EuiCallOut = forwardRef<HTMLDivElement, EuiCallOutProps>(
);
}

const H: any = heading ? `${heading}` : 'p';
let header;

if (title) {
const H: Heading = heading;
header = (
<EuiTitle size={size === 's' ? 'xxs' : 'xs'} css={cssHeaderStyles}>
<H className="euiCallOutHeader__title">
Expand All @@ -115,6 +114,7 @@ export const EuiCallOut = forwardRef<HTMLDivElement, EuiCallOutProps>(
</EuiTitle>
);
}

return (
<EuiPanel
borderRadius="none"
Expand Down

0 comments on commit 8cde1f1

Please sign in to comment.