1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Long press to switch account

This commit is contained in:
Zhiyuan Zheng
2022-02-02 22:47:30 +01:00
parent bc0c07e785
commit 4ea4e39759
3 changed files with 21 additions and 3 deletions

View File

@ -102,6 +102,19 @@ const ScreenTabs = React.memo(
)
const composeComponent = useCallback(() => null, [])
const meListeners = useMemo(
() => ({
tabLongPress: () => {
haptics('Light')
//@ts-ignore
navigation.navigate('Tab-Me', { screen: 'Tab-Me-Root' })
//@ts-ignore
navigation.navigate('Tab-Me', { screen: 'Tab-Me-Switch' })
}
}),
[]
)
const previousTab = useSelector(getPreviousTab, () => true)
const versionUpdate = useSelector(getVersionUpdate)
@ -128,7 +141,12 @@ const ScreenTabs = React.memo(
listeners={composeListeners}
/>
<Tab.Screen name='Tab-Notifications' component={TabNotifications} />
<Tab.Screen name='Tab-Me' component={TabMe} options={tabMeOptions} />
<Tab.Screen
name='Tab-Me'
component={TabMe}
options={tabMeOptions}
listeners={meListeners}
/>
</Tab.Navigator>
)
},