Skip to content

Commit

Permalink
Fix offer target for external links
Browse files Browse the repository at this point in the history
  • Loading branch information
vallieres13 committed Jan 22, 2024
1 parent f3f1014 commit 17ed76b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Offer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ const Offer = ({

if(!promo) background = '#F6F6F6';

console.log(buttonUrl!);
console.log(window.location.hostname);

return (
<>
{offer &&
Expand All @@ -117,7 +120,7 @@ const Offer = ({
<span className="splash">{splash ?? offer.splash}</span>
<span>{subtitle ?? offer.subtitle}</span>
<small>{small ?? offer.small}</small>
<a href={buttonUrl ?? offer.buttonUrl} className="button">{button ?? offer.button}</a>
<a href={buttonUrl ?? offer.buttonUrl} className="button" type={buttonUrl!.includes(window.location.hostname) ? '' : '_blank'}>{button ?? offer.button}</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 17ed76b

Please sign in to comment.