Skip to content

Commit

Permalink
Add ref to visit link
Browse files Browse the repository at this point in the history
  • Loading branch information
mac authored and mac committed Sep 11, 2023
1 parent 2cacc72 commit 157bbf3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/tool/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ export default async function Page({ params: { slug } }: { params: { slug: strin
<h1 className="mt-3 text-slate-100 font-medium">{product?.name}</h1>
<Title className="mt-1">{product?.slogan}</Title>
<div className="text-sm mt-3 flex items-center gap-x-3">
<LinkShiny href={addHttpsToUrl(product?.demo_url as string)} target="_blank" className="flex items-center gap-x-2">
<LinkShiny
href={`${addHttpsToUrl(product?.demo_url as string)}?ref=devhunt`}
target="_blank"
className="flex items-center gap-x-2"
>
Live preview
<IconArrowTopRight />
</LinkShiny>
Expand Down
2 changes: 1 addition & 1 deletion components/ui/TabsLink/TabLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const TabLink = ({
{children}
</Link>
) : (
<a {...props} href={`${window.location.pathname}${hash}`} className={customClassName}>
<a {...props} href={`${window && window.location.pathname}${hash}`} className={customClassName}>
{children}
</a>
)
Expand Down
6 changes: 5 additions & 1 deletion components/ui/ToolViewModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ export default ({ href, tool, close }: { href: string; tool: ProductType; close:
<h1 className="mt-3 text-slate-100 font-medium">{tool?.name}</h1>
<Title className="mt-1">{tool?.slogan}</Title>
<div className="text-sm mt-3 flex items-center gap-x-3">
<LinkShiny href={addHttpsToUrl(tool?.demo_url as string)} target="_blank" className="flex items-center gap-x-2">
<LinkShiny
href={`${addHttpsToUrl(tool?.demo_url as string)}?ref=devhunt`}
target="_blank"
className="flex items-center gap-x-2"
>
Live preview
<IconArrowTopRight />
</LinkShiny>
Expand Down

0 comments on commit 157bbf3

Please sign in to comment.