1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
Zhiyuan Zheng
2021-01-12 00:12:44 +01:00
parent 284d6e46e0
commit 2df172d026
23 changed files with 311 additions and 227 deletions

View File

@ -242,13 +242,6 @@ const Index: React.FC<Props> = ({ localCorrupt }) => {
}),
[localActiveIndex]
)
const tabScreenNotificationsOptions = useMemo(
() => ({
tabBarBadge: prevNotification && prevNotification.unread ? '' : undefined
}),
[theme, prevNotification]
)
return (
<>
<StatusBar barStyle={barStyle[mode]} />
@ -280,13 +273,22 @@ const Index: React.FC<Props> = ({ localCorrupt }) => {
name='Screen-Notifications'
component={ScreenNotifications}
listeners={tabScreenNotificationsListeners}
options={{
tabBarBadgeStyle: {
transform: [{ scale: 0.5 }],
backgroundColor: theme.red
},
...tabScreenNotificationsOptions
}}
options={
prevNotification && prevNotification.unread
? {
tabBarBadge: '',
tabBarBadgeStyle: {
transform: [{ scale: 0.5 }],
backgroundColor: theme.red
}
}
: {
tabBarBadgeStyle: {
transform: [{ scale: 0.5 }],
backgroundColor: theme.red
}
}
}
/>
<Tab.Screen name='Screen-Me' component={ScreenMe} />
</Tab.Navigator>