rename "MessagesList" to "Messages" (#3826)

zio/stable
Samuel Newman 2024-05-02 21:02:45 +01:00 committed by GitHub
parent a20fe4c9a0
commit aca55cb192
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 18 additions and 15 deletions

View File

@ -48,7 +48,7 @@ import {useWebScrollRestoration} from './lib/hooks/useWebScrollRestoration'
import {attachRouteToLogEvents, logEvent} from './lib/statsig/statsig' import {attachRouteToLogEvents, logEvent} from './lib/statsig/statsig'
import {router} from './routes' import {router} from './routes'
import {MessagesConversationScreen} from './screens/Messages/Conversation' import {MessagesConversationScreen} from './screens/Messages/Conversation'
import {MessagesListScreen} from './screens/Messages/List' import {MessagesScreen} from './screens/Messages/List'
import {MessagesSettingsScreen} from './screens/Messages/Settings' import {MessagesSettingsScreen} from './screens/Messages/Settings'
import {useModalControls} from './state/modals' import {useModalControls} from './state/modals'
import {useUnreadNotifications} from './state/queries/notifications/unread' import {useUnreadNotifications} from './state/queries/notifications/unread'
@ -462,8 +462,8 @@ function MessagesTabNavigator() {
contentStyle: pal.view, contentStyle: pal.view,
}}> }}>
<MessagesTab.Screen <MessagesTab.Screen
name="MessagesList" name="Messages"
getComponent={() => MessagesListScreen} getComponent={() => MessagesScreen}
options={{requireAuth: true}} options={{requireAuth: true}}
/> />
{commonScreens(MessagesTab as typeof HomeTab)} {commonScreens(MessagesTab as typeof HomeTab)}
@ -512,8 +512,8 @@ const FlatNavigator = () => {
options={{title: title(msg`Notifications`), requireAuth: true}} options={{title: title(msg`Notifications`), requireAuth: true}}
/> />
<Flat.Screen <Flat.Screen
name="MessagesList" name="Messages"
getComponent={() => MessagesListScreen} getComponent={() => MessagesScreen}
options={{title: title(msg`Messages`), requireAuth: true}} options={{title: title(msg`Messages`), requireAuth: true}}
/> />
{commonScreens(Flat as typeof HomeTab, numUnread)} {commonScreens(Flat as typeof HomeTab, numUnread)}
@ -570,7 +570,7 @@ const LINKING = {
return buildStateObject('HomeTab', 'Home', params) return buildStateObject('HomeTab', 'Home', params)
} }
if (name === 'Messages') { if (name === 'Messages') {
return buildStateObject('MessagesTab', 'MessagesList', params) return buildStateObject('MessagesTab', 'Messages', params)
} }
// if the path is something else, like a post, profile, or even settings, we need to initialize the home tab as pre-existing state otherwise the back button will not work // if the path is something else, like a post, profile, or even settings, we need to initialize the home tab as pre-existing state otherwise the back button will not work
return buildStateObject('HomeTab', name, params, [ return buildStateObject('HomeTab', name, params, [

View File

@ -72,7 +72,7 @@ let ConvoMenu = ({
const {mutate: leaveConvo} = useLeaveConvo(convo.id, { const {mutate: leaveConvo} = useLeaveConvo(convo.id, {
onSuccess: () => { onSuccess: () => {
if (currentScreen === 'conversation') { if (currentScreen === 'conversation') {
navigation.replace('MessagesList') navigation.replace('Messages')
} }
}, },
onError: () => { onError: () => {

View File

@ -11,8 +11,9 @@ export function useNavigationTabState() {
isAtNotifications: isAtNotifications:
getTabState(state, 'Notifications') !== TabState.Outside, getTabState(state, 'Notifications') !== TabState.Outside,
isAtMyProfile: getTabState(state, 'MyProfile') !== TabState.Outside, isAtMyProfile: getTabState(state, 'MyProfile') !== TabState.Outside,
isAtMessages: getTabState(state, 'MessagesList') !== TabState.Outside, isAtMessages: getTabState(state, 'Messages') !== TabState.Outside,
} }
if ( if (
!res.isAtHome && !res.isAtHome &&
!res.isAtSearch && !res.isAtSearch &&

View File

@ -1,4 +1,5 @@
import {useNavigationState} from '@react-navigation/native' import {useNavigationState} from '@react-navigation/native'
import {getCurrentRoute} from 'lib/routes/helpers' import {getCurrentRoute} from 'lib/routes/helpers'
export function useNavigationTabState() { export function useNavigationTabState() {
@ -9,6 +10,7 @@ export function useNavigationTabState() {
isAtSearch: currentRoute === 'Search', isAtSearch: currentRoute === 'Search',
isAtNotifications: currentRoute === 'Notifications', isAtNotifications: currentRoute === 'Notifications',
isAtMyProfile: currentRoute === 'MyProfile', isAtMyProfile: currentRoute === 'MyProfile',
isAtMessages: currentRoute === 'Messages',
} }
}) })
} }

View File

@ -72,7 +72,7 @@ export type MyProfileTabNavigatorParams = CommonNavigatorParams & {
} }
export type MessagesTabNavigatorParams = CommonNavigatorParams & { export type MessagesTabNavigatorParams = CommonNavigatorParams & {
MessagesList: undefined Messages: undefined
} }
export type FlatNavigatorParams = CommonNavigatorParams & { export type FlatNavigatorParams = CommonNavigatorParams & {
@ -81,7 +81,7 @@ export type FlatNavigatorParams = CommonNavigatorParams & {
Feeds: undefined Feeds: undefined
Notifications: undefined Notifications: undefined
Hashtag: {tag: string; author?: string} Hashtag: {tag: string; author?: string}
MessagesList: undefined Messages: undefined
} }
export type AllNavigatorParams = CommonNavigatorParams & { export type AllNavigatorParams = CommonNavigatorParams & {
@ -96,7 +96,7 @@ export type AllNavigatorParams = CommonNavigatorParams & {
MyProfileTab: undefined MyProfileTab: undefined
Hashtag: {tag: string; author?: string} Hashtag: {tag: string; author?: string}
MessagesTab: undefined MessagesTab: undefined
MessagesList: undefined Messages: undefined
} }
// NOTE // NOTE

View File

@ -37,7 +37,7 @@ export const router = new Router({
CommunityGuidelines: '/support/community-guidelines', CommunityGuidelines: '/support/community-guidelines',
CopyrightPolicy: '/support/copyright', CopyrightPolicy: '/support/copyright',
Hashtag: '/hashtag/:tag', Hashtag: '/hashtag/:tag',
MessagesList: '/messages', Messages: '/messages',
MessagesSettings: '/messages/settings', MessagesSettings: '/messages/settings',
MessagesConversation: '/messages/:conversation', MessagesConversation: '/messages/:conversation',
}) })

View File

@ -82,7 +82,7 @@ let Header = ({
const onPressBack = useCallback(() => { const onPressBack = useCallback(() => {
if (isWeb) { if (isWeb) {
navigation.replace('MessagesList') navigation.replace('Messages')
} else { } else {
navigation.pop() navigation.pop()
} }

View File

@ -33,8 +33,8 @@ import {useMenuControl} from '#/components/Menu'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
import {ClipClopGate} from '../gate' import {ClipClopGate} from '../gate'
type Props = NativeStackScreenProps<MessagesTabNavigatorParams, 'MessagesList'> type Props = NativeStackScreenProps<MessagesTabNavigatorParams, 'Messages'>
export function MessagesListScreen({navigation}: Props) { export function MessagesScreen({navigation}: Props) {
const {_} = useLingui() const {_} = useLingui()
const t = useTheme() const t = useTheme()
const newChatControl = useDialogControl() const newChatControl = useDialogControl()