Changeset View
Changeset View
Standalone View
Standalone View
native/chat/chat.react.js
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | import { | ||||
MessageResultsScreenRouteName, | MessageResultsScreenRouteName, | ||||
MessageListRouteName, | MessageListRouteName, | ||||
ChatThreadListRouteName, | ChatThreadListRouteName, | ||||
HomeChatThreadListRouteName, | HomeChatThreadListRouteName, | ||||
BackgroundChatThreadListRouteName, | BackgroundChatThreadListRouteName, | ||||
type ScreenParamList, | type ScreenParamList, | ||||
type ChatParamList, | type ChatParamList, | ||||
type ChatTopTabsParamList, | type ChatTopTabsParamList, | ||||
MessageSearchRouteName, | |||||
} from '../navigation/route-names.js'; | } from '../navigation/route-names.js'; | ||||
import MessageSearch from '../search/message-search.react.js'; | |||||
import SearchHeader from '../search/search-header.react.js'; | |||||
import { useColors, useStyles } from '../themes/colors.js'; | import { useColors, useStyles } from '../themes/colors.js'; | ||||
const unboundStyles = { | const unboundStyles = { | ||||
keyboardAvoidingView: { | keyboardAvoidingView: { | ||||
flex: 1, | flex: 1, | ||||
}, | }, | ||||
view: { | view: { | ||||
flex: 1, | flex: 1, | ||||
▲ Show 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | |||||
const fullScreenThreadMediaGalleryOptions = { | const fullScreenThreadMediaGalleryOptions = { | ||||
headerTitle: 'All Media', | headerTitle: 'All Media', | ||||
headerBackTitleVisible: false, | headerBackTitleVisible: false, | ||||
}; | }; | ||||
const deleteThreadOptions = { | const deleteThreadOptions = { | ||||
headerTitle: 'Delete chat', | headerTitle: 'Delete chat', | ||||
headerBackTitleVisible: false, | headerBackTitleVisible: false, | ||||
}; | }; | ||||
const messageSearchOptions = { | |||||
// eslint-disable-next-line react/display-name | |||||
headerTitle: () => <SearchHeader />, | |||||
headerBackTitleVisible: false, | |||||
headerTitleContainerStyle: { | |||||
width: '100%', | |||||
}, | |||||
}; | |||||
const messageResultsScreenOptions = { | const messageResultsScreenOptions = { | ||||
headerTitle: 'Pinned Messages', | headerTitle: 'Pinned Messages', | ||||
headerBackTitleVisible: false, | headerBackTitleVisible: false, | ||||
}; | }; | ||||
export type ChatNavigationProp< | export type ChatNavigationProp< | ||||
RouteName: $Keys<ChatParamList> = $Keys<ChatParamList>, | RouteName: $Keys<ChatParamList> = $Keys<ChatParamList>, | ||||
> = { | > = { | ||||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | <View style={styles.view}> | ||||
component={DeleteThread} | component={DeleteThread} | ||||
options={deleteThreadOptions} | options={deleteThreadOptions} | ||||
/> | /> | ||||
<Chat.Screen | <Chat.Screen | ||||
name={MessageResultsScreenRouteName} | name={MessageResultsScreenRouteName} | ||||
component={MessageResultsScreen} | component={MessageResultsScreen} | ||||
options={messageResultsScreenOptions} | options={messageResultsScreenOptions} | ||||
/> | /> | ||||
<Chat.Screen | |||||
name={MessageSearchRouteName} | |||||
component={MessageSearch} | |||||
options={messageSearchOptions} | |||||
/> | |||||
</Chat.Navigator> | </Chat.Navigator> | ||||
<MessageStorePruner /> | <MessageStorePruner /> | ||||
<ThreadScreenPruner /> | <ThreadScreenPruner /> | ||||
{draftUpdater} | {draftUpdater} | ||||
</KeyboardAvoidingView> | </KeyboardAvoidingView> | ||||
</View> | </View> | ||||
); | ); | ||||
} | } |