Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
Refactor variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Tran authored and Andrew Tran committed Oct 5, 2023
1 parent 5c19471 commit 84b23f4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/terra-clinical-header/src/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
<div className={cx('title-container')}>
<HeaderElement id={id} className={cx('title')}>
{onTextClick ? (
<HyperlinkButton onClick={onTextClick} text={title || text} />
<HyperlinkButton onClick={onTextClick} text={titleContent} />
) : (
title || text
titleContent
)}
</HeaderElement>
</div>
Expand Down

0 comments on commit 84b23f4

Please sign in to comment.