diff options
author | Ollie H <renahlee@outlook.com> | 2023-05-04 22:25:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-05 00:25:52 -0500 |
commit | 8d78e8581c7d24e2c3f4d96c5217914297542b7b (patch) | |
tree | 5bdf254114ca4bfa15496b1ea987a32befe94153 /src | |
parent | d3e8bd3e9a1f71b1177c0493634515379b0d1de8 (diff) | |
download | voidsky-8d78e8581c7d24e2c3f4d96c5217914297542b7b.tar.zst |
Move href back to link (#590)
* Move href back to link * Fix cmd/ctrl click on left nav --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/view/shell/desktop/LeftNav.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index 621c7926c..ca6330304 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -99,6 +99,9 @@ const NavItem = observer( const {onPress} = useLinkProps({to: href}) const onPressWrapped = React.useCallback( (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => { + if (e.ctrlKey || e.metaKey || e.altKey) { + return + } e.preventDefault() if (isCurrent) { store.emitScreenSoftReset() @@ -114,6 +117,9 @@ const NavItem = observer( style={styles.navItemWrapper} hoverStyle={pal.viewLight} onPress={onPressWrapped} + // @ts-ignore web only -prf + href={href} + dataSet={{noUnderline: 1}} accessibilityRole="tab" accessibilityLabel={label} accessibilityHint=""> @@ -125,11 +131,7 @@ const NavItem = observer( </Text> ) : null} </View> - <Text - type="title" - style={[isCurrent ? s.bold : s.normal, pal.text]} - href={href} - dataSet={{noUnderline: 1}}> + <Text type="title" style={[isCurrent ? s.bold : s.normal, pal.text]}> {label} </Text> </PressableWithHover> |