From e052f5e198603246cb031e00d9cadc2ae4bb140d Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 10 Dec 2024 14:52:30 -0600 Subject: Refactor sidebar (#6971) * Refactor RightNav (cherry picked from commit 96bb02acfd2d7452df18a0e7410e6a7169a583ed) * Better gutter handling * Clean up styles * Memoize breakpoints * Format * Comment * Loosen spacing, handle overflow, smaller text to match prod * Fix circular imports on native * Return 0 instead of undefined for easier calculations * Re-assign * Fix * Port over fix from subs/base * Space out right nav feeds, widen sidebar to match prod * Fix lost padding on home header * Fix perf by not actually linking to new URL * Remove underline on focus * Foramt --------- Co-authored-by: Dan Abramov --- src/components/Link.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/components/Link.tsx') diff --git a/src/components/Link.tsx b/src/components/Link.tsx index a5203b252..3cd593a10 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -237,7 +237,9 @@ export function Link({ } export type InlineLinkProps = React.PropsWithChildren< - BaseLinkProps & TextStyleProp & Pick + BaseLinkProps & + TextStyleProp & + Pick > & Pick & { disableUnderline?: boolean @@ -273,7 +275,6 @@ export function InlineLinkText({ onIn: onHoverIn, onOut: onHoverOut, } = useInteractionState() - const {state: focused, onIn: onFocus, onOut: onBlur} = useInteractionState() const flattenedStyle = flatten(style) || {} return ( @@ -284,7 +285,7 @@ export function InlineLinkText({ {...rest} style={[ {color: t.palette.primary_500}, - (hovered || focused) && + hovered && !disableUnderline && { ...web({ outline: 0, @@ -298,8 +299,6 @@ export function InlineLinkText({ role="link" onPress={download ? undefined : onPress} onLongPress={onLongPress} - onFocus={onFocus} - onBlur={onBlur} onMouseEnter={onHoverIn} onMouseLeave={onHoverOut} accessibilityRole="link" -- cgit 1.4.1