Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clickable external link icon for referral urls #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion app/components/TableCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
className={`group [&_td]:last:rounded-b-md ${gridCols}`}
width={barChartPercentages[index]}
>
<TableCell className="font-medium min-w-48 break-all">
<TableCell className="font-medium min-w-48 whitespace-normal relative">
{onClick ? (
<button
onClick={() => onClick(key as string)}
Expand All @@ -84,6 +84,18 @@
) : (
label
)}

{/^https?:\/\//.test(label) ? (
<a
href={label}
target={"_blank"}
rel="noreferrer"
aria-hidden="true"
className="inline whitespace-nowrap before:content-[url(/img/external.svg)] before:absolute before:top-3.5 before:ml-1"
>
{" "}
</a>

Check warning on line 97 in app/components/TableCard.tsx

View check run for this annotation

Codecov / codecov/patch

app/components/TableCard.tsx#L89-L97

Added lines #L89 - L97 were not covered by tests
) : null}
</TableCell>

<TableCell className="text-right min-w-16">
Expand Down
14 changes: 14 additions & 0 deletions public/img/external.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading