Changeset View
Changeset View
Standalone View
Standalone View
native/chat/message-result.react.js
// @flow | // @flow | ||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { Text, View } from 'react-native'; | import { Text, View } from 'react-native'; | ||||
import { ScrollView } from 'react-native-gesture-handler'; | import { ScrollView } from 'react-native-gesture-handler'; | ||||
import { type ThreadInfo } from 'lib/types/thread-types.js'; | import { type ThreadInfo } from 'lib/types/thread-types.js'; | ||||
import { longAbsoluteDate } from 'lib/utils/date-utils.js'; | import { longAbsoluteDate } from 'lib/utils/date-utils.js'; | ||||
import type { ChatNavigationProp } from './chat.react'; | import { type ChatNavigationProp } from './chat.react.js'; | ||||
import { MessageListContextProvider } from './message-list-types.js'; | import { MessageListContextProvider } from './message-list-types.js'; | ||||
import { Message } from './message.react.js'; | import { Message } from './message.react.js'; | ||||
import { modifyItemForResultScreen } from './utils.js'; | import { modifyItemForResultScreen } from './utils.js'; | ||||
import type { AppNavigationProp } from '../navigation/app-navigator.react'; | import type { AppNavigationProp } from '../navigation/app-navigator.react'; | ||||
import type { NavigationRoute } from '../navigation/route-names'; | import type { NavigationRoute } from '../navigation/route-names'; | ||||
import { useStyles } from '../themes/colors.js'; | import { useStyles } from '../themes/colors.js'; | ||||
import type { ChatMessageInfoItemWithHeight } from '../types/chat-types.js'; | import type { ChatMessageInfoItemWithHeight } from '../types/chat-types.js'; | ||||
import type { VerticalBounds } from '../types/layout-types.js'; | import type { VerticalBounds } from '../types/layout-types.js'; | ||||
type MessageResultProps = { | type MessageResultProps = { | ||||
+item: ChatMessageInfoItemWithHeight, | +item: ChatMessageInfoItemWithHeight, | ||||
+threadInfo: ThreadInfo, | +threadInfo: ThreadInfo, | ||||
+navigation: | +navigation: | ||||
| AppNavigationProp<'TogglePinModal'> | | AppNavigationProp<'TogglePinModal'> | ||||
| ChatNavigationProp<'MessageResultsScreen'>, | | ChatNavigationProp<'MessageResultsScreen'> | ||||
| ChatNavigationProp<'MessageSearch'>, | |||||
+route: | +route: | ||||
| NavigationRoute<'TogglePinModal'> | | NavigationRoute<'TogglePinModal'> | ||||
| NavigationRoute<'MessageResultsScreen'>, | | NavigationRoute<'MessageResultsScreen'> | ||||
| NavigationRoute<'MessageSearch'>, | |||||
+messageVerticalBounds: ?VerticalBounds, | +messageVerticalBounds: ?VerticalBounds, | ||||
}; | }; | ||||
function MessageResult(props: MessageResultProps): React.Node { | function MessageResult(props: MessageResultProps): React.Node { | ||||
const styles = useStyles(unboundStyles); | const styles = useStyles(unboundStyles); | ||||
const onToggleFocus = React.useCallback(() => {}, []); | const onToggleFocus = React.useCallback(() => {}, []); | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |