Skip to content

Commit

Permalink
Restored missing show behaviour for back link
Browse files Browse the repository at this point in the history
  • Loading branch information
atomworks committed Dec 10, 2024
1 parent 5486956 commit a853821
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ui-lib/src/Layouts/molecules/UtilityHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const backDefaults : IUtilityHeaderLink = {
};


const UtilityHeader : React.FC<IUtilityHeader> = ({ showBreadcrumbs = true, breadcrumbs = [], showHomeIcon = true, back, share, $iconInGutter = true }) => {
const UtilityHeader : React.FC<IUtilityHeader> = ({ showBreadcrumbs = true, breadcrumbs = [], showHomeIcon = true, back = {}, share = {}, $iconInGutter = true }) => {

// Set defaults and override from props.
back = Object.assign(backDefaults, back);
Expand All @@ -208,14 +208,14 @@ const UtilityHeader : React.FC<IUtilityHeader> = ({ showBreadcrumbs = true, brea

const clickHandlerShareLink = useCallback(() => {
copyToClipboard( share.link ? share.link : window.location.href);
setCopyActionText(share.copiedLabel || '');
setCopyActionText(share.copiedLabel);
setTimeout(() => setCopyActionText("Share"), 2000);
}, [share.link, share.copiedLabel, copyToClipboard]);

return (
<Container>
<LeftArea>
{back.link ?
{back.show && back.link ?
<BackLink to={back.link} $showDivider={hasBreadcrumbs} {...{$iconInGutter}}>
<BackLinkIcon>
<Icon icon="Back" size={16} color="grey-10" />
Expand Down

0 comments on commit a853821

Please sign in to comment.