From ca5c4c3d16a3fe20cd4a470fe7ea6da4df6956fb Mon Sep 17 00:00:00 2001 From: Titani Date: Mon, 30 Jan 2023 10:48:06 -0500 Subject: [PATCH] fix(Code block): Fixed to only render the header when actions are defined --- .../react-core/src/components/CodeBlock/CodeBlock.tsx | 8 +++++--- .../__tests__/__snapshots__/CodeBlock.test.tsx.snap | 7 ------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/react-core/src/components/CodeBlock/CodeBlock.tsx b/packages/react-core/src/components/CodeBlock/CodeBlock.tsx index a4174ea1fa2..f125a9c123c 100644 --- a/packages/react-core/src/components/CodeBlock/CodeBlock.tsx +++ b/packages/react-core/src/components/CodeBlock/CodeBlock.tsx @@ -18,9 +18,11 @@ export const CodeBlock: React.FunctionComponent = ({ ...props }: CodeBlockProps) => (
-
-
{actions && actions}
-
+ {actions && ( +
+
{actions}
+
+ )}
{children}
); diff --git a/packages/react-core/src/components/CodeBlock/__tests__/__snapshots__/CodeBlock.test.tsx.snap b/packages/react-core/src/components/CodeBlock/__tests__/__snapshots__/CodeBlock.test.tsx.snap index 5b52e37d67e..669e48ee33b 100644 --- a/packages/react-core/src/components/CodeBlock/__tests__/__snapshots__/CodeBlock.test.tsx.snap +++ b/packages/react-core/src/components/CodeBlock/__tests__/__snapshots__/CodeBlock.test.tsx.snap @@ -5,13 +5,6 @@ exports[`CodeBlock renders successfully 1`] = `
-
-
-