Skip to content

Commit

Permalink
[FX-5954] Add pointer cursor to Link when onClick is provided (#4565)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasSlama authored Sep 19, 2024
1 parent 1de0649 commit 78656d5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .changeset/red-wasps-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@toptal/picasso-link': patch
'@toptal/picasso': patch
---

- add pointer cursor to Link when only onClick is provided
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ exports[`AccountSelect renders 1`] = `
class="flex items-center"
>
<a
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline !no-underline flex-1"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline !no-underline cursor-pointer flex-1"
>
<div
class="p-6 items-center justify-between flex"
Expand Down Expand Up @@ -103,7 +103,7 @@ exports[`AccountSelect renders 1`] = `
class="flex items-center"
>
<a
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline !no-underline flex-1"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline !no-underline cursor-pointer flex-1"
href="#"
>
<div
Expand Down Expand Up @@ -181,7 +181,7 @@ exports[`AccountSelect renders 1`] = `
class="flex items-center"
>
<a
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline !no-underline flex-1"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline !no-underline cursor-pointer flex-1"
href="#"
>
<div
Expand Down
1 change: 1 addition & 0 deletions packages/base/Link/src/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export const Link: OverridableComponent<Props> = forwardRef<
? 'visited text-purple-500'
: 'visited text-gray-500'
: '',
onClick || href ? 'cursor-pointer' : '',
className
)}
style={style}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/Link/src/Link/__snapshots__/test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exports[`Link renders disabled link 1`] = `
>
<a
aria-disabled="true"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-gray underline cursor-not"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-gray underline cursor-pointer"
download="filename"
rel="noopener"
>
Expand All @@ -54,7 +54,7 @@ exports[`Link renders native attributes 1`] = `
class="Picasso-root"
>
<a
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline cursor-pointer"
download="filename"
href="https://toptal.com/filename.txt"
rel="noopener"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ exports[`Page.TopBar render with link 1`] = `
</div>
</div>
<a
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline"
class="m-0 font-inherit font-inherit focus:outline-none hover:underline leading-[inherit] text-blue visited:text-purple no-underline cursor-pointer"
href="https://www.toptal.com"
>
<svg
Expand Down

0 comments on commit 78656d5

Please sign in to comment.