Ungate mobile web notification badge (#4459)

zio/stable
dan 2024-06-10 18:17:26 +02:00 committed by GitHub
parent b688da8d58
commit 620ab88713
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 19 deletions

View File

@ -3,4 +3,3 @@ export type Gate =
| 'request_notifications_permission_after_onboarding_v2' | 'request_notifications_permission_after_onboarding_v2'
| 'show_avi_follow_button' | 'show_avi_follow_button'
| 'show_follow_back_label_v2' | 'show_follow_back_label_v2'
| 'show_notification_badge_mobile_web'

View File

@ -16,7 +16,6 @@ import {s} from '#/lib/styles'
import {useSession} from '#/state/session' import {useSession} from '#/state/session'
import {useLoggedOutViewControls} from '#/state/shell/logged-out' import {useLoggedOutViewControls} from '#/state/shell/logged-out'
import {useCloseAllActiveElements} from '#/state/util' import {useCloseAllActiveElements} from '#/state/util'
import {useGate} from 'lib/statsig/statsig'
import {useUnreadMessageCount} from 'state/queries/messages/list-converations' import {useUnreadMessageCount} from 'state/queries/messages/list-converations'
import {useUnreadNotifications} from 'state/queries/notifications/unread' import {useUnreadNotifications} from 'state/queries/notifications/unread'
import {Button} from '#/view/com/util/forms/Button' import {Button} from '#/view/com/util/forms/Button'
@ -49,7 +48,6 @@ export function BottomBarWeb() {
const {hasSession, currentAccount} = useSession() const {hasSession, currentAccount} = useSession()
const pal = usePalette('default') const pal = usePalette('default')
const safeAreaInsets = useSafeAreaInsets() const safeAreaInsets = useSafeAreaInsets()
const gate = useGate()
const footerMinimalShellTransform = useMinimalShellFooterTransform() const footerMinimalShellTransform = useMinimalShellFooterTransform()
const {requestSwitchToAccount} = useLoggedOutViewControls() const {requestSwitchToAccount} = useLoggedOutViewControls()
const closeAllActiveElements = useCloseAllActiveElements() const closeAllActiveElements = useCloseAllActiveElements()
@ -115,14 +113,13 @@ export function BottomBarWeb() {
width={iconWidth - 1} width={iconWidth - 1}
style={[styles.ctrlIcon, pal.text, styles.messagesIcon]} style={[styles.ctrlIcon, pal.text, styles.messagesIcon]}
/> />
{unreadMessageCount.count > 0 && {unreadMessageCount.count > 0 && (
gate('show_notification_badge_mobile_web') && ( <View style={styles.notificationCount}>
<View style={styles.notificationCount}> <Text style={styles.notificationCountLabel}>
<Text style={styles.notificationCountLabel}> {unreadMessageCount.numUnread}
{unreadMessageCount.numUnread} </Text>
</Text> </View>
</View> )}
)}
</> </>
) )
}} }}
@ -136,14 +133,13 @@ export function BottomBarWeb() {
width={iconWidth} width={iconWidth}
style={[styles.ctrlIcon, pal.text, styles.bellIcon]} style={[styles.ctrlIcon, pal.text, styles.bellIcon]}
/> />
{notificationCountStr !== '' && {notificationCountStr !== '' && (
gate('show_notification_badge_mobile_web') && ( <View style={styles.notificationCount}>
<View style={styles.notificationCount}> <Text style={styles.notificationCountLabel}>
<Text style={styles.notificationCountLabel}> {notificationCountStr}
{notificationCountStr} </Text>
</Text> </View>
</View> )}
)}
</> </>
) )
}} }}