my fork of the bluesky client

Don't underline links on native hover (#6588)

authored by danabra.mov and committed by

GitHub ff23ddb5 dff11fc0

+13 -23
+7 -11
src/components/Link.tsx
··· 274 274 onOut: onHoverOut, 275 275 } = useInteractionState() 276 276 const {state: focused, onIn: onFocus, onOut: onBlur} = useInteractionState() 277 - const { 278 - state: pressed, 279 - onIn: onPressIn, 280 - onOut: onPressOut, 281 - } = useInteractionState() 282 277 const flattenedStyle = flatten(style) || {} 283 278 284 279 return ( ··· 289 284 {...rest} 290 285 style={[ 291 286 {color: t.palette.primary_500}, 292 - (hovered || focused || pressed) && 287 + (hovered || focused) && 293 288 !disableUnderline && { 294 - ...web({outline: 0}), 295 - textDecorationLine: 'underline', 296 - textDecorationColor: flattenedStyle.color ?? t.palette.primary_500, 289 + ...web({ 290 + outline: 0, 291 + textDecorationLine: 'underline', 292 + textDecorationColor: 293 + flattenedStyle.color ?? t.palette.primary_500, 294 + }), 297 295 }, 298 296 flattenedStyle, 299 297 ]} 300 298 role="link" 301 299 onPress={download ? undefined : onPress} 302 300 onLongPress={onLongPress} 303 - onPressIn={onPressIn} 304 - onPressOut={onPressOut} 305 301 onFocus={onFocus} 306 302 onBlur={onBlur} 307 303 onMouseEnter={onHoverIn}
+6 -12
src/components/RichText.tsx
··· 53 53 const plainStyles = [a.leading_snug, flattenedStyle] 54 54 const interactiveStyles = [ 55 55 a.leading_snug, 56 - a.pointer_events_auto, 57 56 flatten(interactiveStyle), 58 57 flattenedStyle, 59 58 ] ··· 194 193 onOut: onHoverOut, 195 194 } = useInteractionState() 196 195 const {state: focused, onIn: onFocus, onOut: onBlur} = useInteractionState() 197 - const { 198 - state: pressed, 199 - onIn: onPressIn, 200 - onOut: onPressOut, 201 - } = useInteractionState() 202 196 const navigation = useNavigation<NavigationProp>() 203 197 204 198 const navigateToPage = React.useCallback(() => { ··· 228 222 accessibilityRole: isNative ? 'button' : undefined, 229 223 onPress: navigateToPage, 230 224 onLongPress: openDialog, 231 - onPressIn: onPressIn, 232 - onPressOut: onPressOut, 233 225 })} 234 226 {...web({ 235 227 onMouseEnter: onHoverIn, ··· 243 235 cursor: 'pointer', 244 236 }), 245 237 {color: t.palette.primary_500}, 246 - (hovered || focused || pressed) && { 247 - ...web({outline: 0}), 248 - textDecorationLine: 'underline', 249 - textDecorationColor: t.palette.primary_500, 238 + (hovered || focused) && { 239 + ...web({ 240 + outline: 0, 241 + textDecorationLine: 'underline', 242 + textDecorationColor: t.palette.primary_500, 243 + }), 250 244 }, 251 245 style, 252 246 ]}>