diff options
author | dan <dan.abramov@gmail.com> | 2024-11-21 19:20:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-21 19:20:46 +0000 |
commit | ff23ddb556be4b2a9c4029dce6f857df34fc0b6b (patch) | |
tree | e9a6c32186fa9f0cf434ccaf4f7b42f0a5fff5a2 /src/components/Link.tsx | |
parent | dff11fc076c67f03319db375dfd844026dc03046 (diff) | |
download | voidsky-ff23ddb556be4b2a9c4029dce6f857df34fc0b6b.tar.zst |
Don't underline links on native hover (#6588)
Diffstat (limited to 'src/components/Link.tsx')
-rw-r--r-- | src/components/Link.tsx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/components/Link.tsx b/src/components/Link.tsx index 054a543c1..a5203b252 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -274,11 +274,6 @@ export function InlineLinkText({ onOut: onHoverOut, } = useInteractionState() const {state: focused, onIn: onFocus, onOut: onBlur} = useInteractionState() - const { - state: pressed, - onIn: onPressIn, - onOut: onPressOut, - } = useInteractionState() const flattenedStyle = flatten(style) || {} return ( @@ -289,19 +284,20 @@ export function InlineLinkText({ {...rest} style={[ {color: t.palette.primary_500}, - (hovered || focused || pressed) && + (hovered || focused) && !disableUnderline && { - ...web({outline: 0}), - textDecorationLine: 'underline', - textDecorationColor: flattenedStyle.color ?? t.palette.primary_500, + ...web({ + outline: 0, + textDecorationLine: 'underline', + textDecorationColor: + flattenedStyle.color ?? t.palette.primary_500, + }), }, flattenedStyle, ]} role="link" onPress={download ? undefined : onPress} onLongPress={onLongPress} - onPressIn={onPressIn} - onPressOut={onPressOut} onFocus={onFocus} onBlur={onBlur} onMouseEnter={onHoverIn} |