From 84b23f4c0b1e3d0e4659bb50eecf5665584678c5 Mon Sep 17 00:00:00 2001 From: Andrew Tran Date: Thu, 5 Oct 2023 14:51:38 +0000 Subject: [PATCH] Refactor variable --- packages/terra-clinical-header/src/Header.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/terra-clinical-header/src/Header.jsx b/packages/terra-clinical-header/src/Header.jsx index 2cf3f938e..0fa598fa1 100644 --- a/packages/terra-clinical-header/src/Header.jsx +++ b/packages/terra-clinical-header/src/Header.jsx @@ -101,15 +101,16 @@ const Header = ({ } let titleElement; - if (title || text) { - const HeaderElement = (level) ? `h${level}` : 'h1'; + const titleContent = title || text; + if (titleContent) { + const HeaderElement = level ? `h${level}` : 'h1'; titleElement = (
{onTextClick ? ( - + ) : ( - title || text + titleContent )}