Skip to content

Commit

Permalink
fix(MobileLogo): fix href prop (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunory authored Jun 24, 2024
1 parent 8211a88 commit 0a81446
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/components/MobileLogo/MobileLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,8 @@ export const MobileLogo: React.FC<MobileLogoProps> = ({
onClick,
className,
}) => {
const hasClickHandler = typeof onClick === 'function';
const hasWrapper = typeof wrapper === 'function';

const linkProps = hasClickHandler
? {}
: {
target,
ref: target === '_self' ? undefined : 'noreferrer',
href,
};

let logoIcon;

if (iconSrc) {
Expand Down Expand Up @@ -78,7 +69,13 @@ export const MobileLogo: React.FC<MobileLogoProps> = ({
{wrapper(logo, compact)}
</div>
) : (
<a {...linkProps} className={b(null, className)} onClick={onClick}>
<a
href={href}
target={target}
ref={target === '_self' ? undefined : 'noreferrer'}
className={b(null, className)}
onClick={onClick}
>
{logo}
</a>
);
Expand Down

0 comments on commit 0a81446

Please sign in to comment.