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>
zio/stable
Ollie H 2023-05-04 22:25:52 -07:00 committed by GitHub
parent d3e8bd3e9a
commit 8d78e8581c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -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>