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
parent
d3e8bd3e9a
commit
8d78e8581c
|
@ -99,6 +99,9 @@ const NavItem = observer(
|
||||||
const {onPress} = useLinkProps({to: href})
|
const {onPress} = useLinkProps({to: href})
|
||||||
const onPressWrapped = React.useCallback(
|
const onPressWrapped = React.useCallback(
|
||||||
(e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
|
(e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
|
||||||
|
if (e.ctrlKey || e.metaKey || e.altKey) {
|
||||||
|
return
|
||||||
|
}
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
if (isCurrent) {
|
if (isCurrent) {
|
||||||
store.emitScreenSoftReset()
|
store.emitScreenSoftReset()
|
||||||
|
@ -114,6 +117,9 @@ const NavItem = observer(
|
||||||
style={styles.navItemWrapper}
|
style={styles.navItemWrapper}
|
||||||
hoverStyle={pal.viewLight}
|
hoverStyle={pal.viewLight}
|
||||||
onPress={onPressWrapped}
|
onPress={onPressWrapped}
|
||||||
|
// @ts-ignore web only -prf
|
||||||
|
href={href}
|
||||||
|
dataSet={{noUnderline: 1}}
|
||||||
accessibilityRole="tab"
|
accessibilityRole="tab"
|
||||||
accessibilityLabel={label}
|
accessibilityLabel={label}
|
||||||
accessibilityHint="">
|
accessibilityHint="">
|
||||||
|
@ -125,11 +131,7 @@ const NavItem = observer(
|
||||||
</Text>
|
</Text>
|
||||||
) : null}
|
) : null}
|
||||||
</View>
|
</View>
|
||||||
<Text
|
<Text type="title" style={[isCurrent ? s.bold : s.normal, pal.text]}>
|
||||||
type="title"
|
|
||||||
style={[isCurrent ? s.bold : s.normal, pal.text]}
|
|
||||||
href={href}
|
|
||||||
dataSet={{noUnderline: 1}}>
|
|
||||||
{label}
|
{label}
|
||||||
</Text>
|
</Text>
|
||||||
</PressableWithHover>
|
</PressableWithHover>
|
||||||
|
|
Loading…
Reference in New Issue