remove DMs gate (#4112)
This commit is contained in:
parent
a7b0242cc8
commit
4a7436886d
9 changed files with 41 additions and 152 deletions
|
@ -15,7 +15,6 @@ import {useNavigationTabState} from '#/lib/hooks/useNavigationTabState'
|
|||
import {usePalette} from '#/lib/hooks/usePalette'
|
||||
import {clamp} from '#/lib/numbers'
|
||||
import {getTabState, TabState} from '#/lib/routes/helpers'
|
||||
import {useGate} from '#/lib/statsig/statsig'
|
||||
import {s} from '#/lib/styles'
|
||||
import {emitSoftReset} from '#/state/events'
|
||||
import {useUnreadMessageCount} from '#/state/queries/messages/list-converations'
|
||||
|
@ -36,10 +35,6 @@ import {
|
|||
Bell_Filled_Corner0_Rounded as BellFilled,
|
||||
Bell_Stroke2_Corner0_Rounded as Bell,
|
||||
} from '#/components/icons/Bell'
|
||||
import {
|
||||
Hashtag_Filled_Corner0_Rounded as HashtagFilled,
|
||||
Hashtag_Stroke2_Corner0_Rounded as Hashtag,
|
||||
} from '#/components/icons/Hashtag'
|
||||
import {
|
||||
HomeOpen_Filled_Corner0_Rounded as HomeFilled,
|
||||
HomeOpen_Stoke2_Corner0_Rounded as Home,
|
||||
|
@ -67,14 +62,8 @@ export function BottomBar({navigation}: BottomTabBarProps) {
|
|||
const safeAreaInsets = useSafeAreaInsets()
|
||||
const {track} = useAnalytics()
|
||||
const {footerHeight} = useShellLayout()
|
||||
const {
|
||||
isAtHome,
|
||||
isAtSearch,
|
||||
isAtFeeds,
|
||||
isAtNotifications,
|
||||
isAtMyProfile,
|
||||
isAtMessages,
|
||||
} = useNavigationTabState()
|
||||
const {isAtHome, isAtSearch, isAtNotifications, isAtMyProfile, isAtMessages} =
|
||||
useNavigationTabState()
|
||||
const numUnreadNotifications = useUnreadNotifications()
|
||||
const numUnreadMessages = useUnreadMessageCount()
|
||||
const {footerMinimalShellTransform} = useMinimalShellMode()
|
||||
|
@ -84,7 +73,6 @@ export function BottomBar({navigation}: BottomTabBarProps) {
|
|||
const dedupe = useDedupe()
|
||||
const accountSwitchControl = useDialogControl()
|
||||
const playHaptic = useHaptics()
|
||||
const gate = useGate()
|
||||
const iconWidth = 28
|
||||
|
||||
const showSignIn = React.useCallback(() => {
|
||||
|
@ -118,10 +106,6 @@ export function BottomBar({navigation}: BottomTabBarProps) {
|
|||
() => onPressTab('Search'),
|
||||
[onPressTab],
|
||||
)
|
||||
const onPressFeeds = React.useCallback(
|
||||
() => onPressTab('Feeds'),
|
||||
[onPressTab],
|
||||
)
|
||||
const onPressNotifications = React.useCallback(
|
||||
() => onPressTab('Notifications'),
|
||||
[onPressTab],
|
||||
|
@ -129,7 +113,6 @@ export function BottomBar({navigation}: BottomTabBarProps) {
|
|||
const onPressProfile = React.useCallback(() => {
|
||||
onPressTab('MyProfile')
|
||||
}, [onPressTab])
|
||||
|
||||
const onPressMessages = React.useCallback(() => {
|
||||
onPressTab('Messages')
|
||||
}, [onPressTab])
|
||||
|
@ -196,56 +179,32 @@ export function BottomBar({navigation}: BottomTabBarProps) {
|
|||
accessibilityLabel={_(msg`Search`)}
|
||||
accessibilityHint=""
|
||||
/>
|
||||
{gate('dms') ? (
|
||||
<Btn
|
||||
testID="bottomBarMessagesBtn"
|
||||
icon={
|
||||
isAtMessages ? (
|
||||
<MessageFilled
|
||||
width={iconWidth - 1}
|
||||
style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
||||
/>
|
||||
) : (
|
||||
<Message
|
||||
width={iconWidth - 1}
|
||||
style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
||||
/>
|
||||
)
|
||||
}
|
||||
onPress={onPressMessages}
|
||||
notificationCount={numUnreadMessages.numUnread}
|
||||
accessible={true}
|
||||
accessibilityRole="tab"
|
||||
accessibilityLabel={_(msg`Chat`)}
|
||||
accessibilityHint={
|
||||
numUnreadMessages.count > 0
|
||||
? `${numUnreadMessages.numUnread} unread`
|
||||
: ''
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<Btn
|
||||
testID="bottomBarFeedsBtn"
|
||||
icon={
|
||||
isAtFeeds ? (
|
||||
<HashtagFilled
|
||||
width={iconWidth + 1}
|
||||
style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
||||
/>
|
||||
) : (
|
||||
<Hashtag
|
||||
width={iconWidth + 1}
|
||||
style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
||||
/>
|
||||
)
|
||||
}
|
||||
onPress={onPressFeeds}
|
||||
accessible={true}
|
||||
accessibilityRole="tab"
|
||||
accessibilityLabel={_(msg`Feeds`)}
|
||||
accessibilityHint=""
|
||||
/>
|
||||
)}
|
||||
<Btn
|
||||
testID="bottomBarMessagesBtn"
|
||||
icon={
|
||||
isAtMessages ? (
|
||||
<MessageFilled
|
||||
width={iconWidth - 1}
|
||||
style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
||||
/>
|
||||
) : (
|
||||
<Message
|
||||
width={iconWidth - 1}
|
||||
style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
||||
/>
|
||||
)
|
||||
}
|
||||
onPress={onPressMessages}
|
||||
notificationCount={numUnreadMessages.numUnread}
|
||||
accessible={true}
|
||||
accessibilityRole="tab"
|
||||
accessibilityLabel={_(msg`Chat`)}
|
||||
accessibilityHint={
|
||||
numUnreadMessages.count > 0
|
||||
? `${numUnreadMessages.numUnread} unread`
|
||||
: ''
|
||||
}
|
||||
/>
|
||||
<Btn
|
||||
testID="bottomBarNotificationsBtn"
|
||||
icon={
|
||||
|
|
|
@ -12,7 +12,6 @@ import {clamp} from '#/lib/numbers'
|
|||
import {getCurrentRoute, isTab} from '#/lib/routes/helpers'
|
||||
import {makeProfileLink} from '#/lib/routes/links'
|
||||
import {CommonNavigatorParams} from '#/lib/routes/types'
|
||||
import {useGate} from '#/lib/statsig/statsig'
|
||||
import {s} from '#/lib/styles'
|
||||
import {useSession} from '#/state/session'
|
||||
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
||||
|
@ -26,10 +25,6 @@ import {
|
|||
Bell_Filled_Corner0_Rounded as BellFilled,
|
||||
Bell_Stroke2_Corner0_Rounded as Bell,
|
||||
} from '#/components/icons/Bell'
|
||||
import {
|
||||
Hashtag_Filled_Corner0_Rounded as HashtagFilled,
|
||||
Hashtag_Stroke2_Corner0_Rounded as Hashtag,
|
||||
} from '#/components/icons/Hashtag'
|
||||
import {
|
||||
HomeOpen_Filled_Corner0_Rounded as HomeFilled,
|
||||
HomeOpen_Stoke2_Corner0_Rounded as Home,
|
||||
|
@ -54,7 +49,6 @@ export function BottomBarWeb() {
|
|||
const {footerMinimalShellTransform} = useMinimalShellMode()
|
||||
const {requestSwitchToAccount} = useLoggedOutViewControls()
|
||||
const closeAllActiveElements = useCloseAllActiveElements()
|
||||
const gate = useGate()
|
||||
const iconWidth = 26
|
||||
|
||||
const showSignIn = React.useCallback(() => {
|
||||
|
@ -105,31 +99,17 @@ export function BottomBarWeb() {
|
|||
|
||||
{hasSession && (
|
||||
<>
|
||||
{gate('dms') ? (
|
||||
<NavItem routeName="Messages" href="/messages">
|
||||
{({isActive}) => {
|
||||
const Icon = isActive ? MessageFilled : Message
|
||||
return (
|
||||
<Icon
|
||||
width={iconWidth - 1}
|
||||
style={[styles.ctrlIcon, pal.text, styles.messagesIcon]}
|
||||
/>
|
||||
)
|
||||
}}
|
||||
</NavItem>
|
||||
) : (
|
||||
<NavItem routeName="Feeds" href="/feeds">
|
||||
{({isActive}) => {
|
||||
const Icon = isActive ? HashtagFilled : Hashtag
|
||||
return (
|
||||
<Icon
|
||||
width={iconWidth + 1}
|
||||
style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
||||
/>
|
||||
)
|
||||
}}
|
||||
</NavItem>
|
||||
)}
|
||||
<NavItem routeName="Messages" href="/messages">
|
||||
{({isActive}) => {
|
||||
const Icon = isActive ? MessageFilled : Message
|
||||
return (
|
||||
<Icon
|
||||
width={iconWidth - 1}
|
||||
style={[styles.ctrlIcon, pal.text, styles.messagesIcon]}
|
||||
/>
|
||||
)
|
||||
}}
|
||||
</NavItem>
|
||||
<NavItem routeName="Notifications" href="/notifications">
|
||||
{({isActive}) => {
|
||||
const Icon = isActive ? BellFilled : Bell
|
||||
|
|
|
@ -12,7 +12,6 @@ import {
|
|||
useNavigationState,
|
||||
} from '@react-navigation/native'
|
||||
|
||||
import {useGate} from '#/lib/statsig/statsig'
|
||||
import {isInvalidHandle} from '#/lib/strings/handles'
|
||||
import {emitSoftReset} from '#/state/events'
|
||||
import {useFetchHandle} from '#/state/queries/handle'
|
||||
|
@ -304,7 +303,6 @@ export function DesktopLeftNav() {
|
|||
const {_} = useLingui()
|
||||
const {isDesktop, isTablet} = useWebMediaQueries()
|
||||
const numUnreadNotifications = useUnreadNotifications()
|
||||
const gate = useGate()
|
||||
|
||||
if (!hasSession && !isDesktop) {
|
||||
return null
|
||||
|
@ -351,7 +349,7 @@ export function DesktopLeftNav() {
|
|||
iconFilled={<BellFilled width={NAV_ICON_WIDTH} style={pal.text} />}
|
||||
label={_(msg`Notifications`)}
|
||||
/>
|
||||
{gate('dms') && <ChatNavItem />}
|
||||
<ChatNavItem />
|
||||
<NavItem
|
||||
href="/feeds"
|
||||
icon={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue