diff --git a/packages/app-mobile/package.json b/packages/app-mobile/package.json index 9c305d356..3de698bb2 100644 --- a/packages/app-mobile/package.json +++ b/packages/app-mobile/package.json @@ -41,7 +41,7 @@ "big-integer": "^1.6.51", "buffer": "^6.0.3", "ethers": "^5.7.2", - "expo": "^48.0.4", + "expo": "^48.0.9", "expo-av": "~13.2.1", "expo-blur": "~12.2.1", "expo-checkbox": "~2.3.1", diff --git a/packages/app-mobile/patches/expo+48.0.4.patch b/packages/app-mobile/patches/expo+48.0.10.patch similarity index 100% rename from packages/app-mobile/patches/expo+48.0.4.patch rename to packages/app-mobile/patches/expo+48.0.10.patch diff --git a/packages/app-mobile/patches/react-native-gifted-chat+2.0.1.patch b/packages/app-mobile/patches/react-native-gifted-chat+2.0.1.patch new file mode 100644 index 000000000..4528e8522 --- /dev/null +++ b/packages/app-mobile/patches/react-native-gifted-chat+2.0.1.patch @@ -0,0 +1,67 @@ +diff --git a/node_modules/react-native-gifted-chat/lib/GiftedChat.js b/node_modules/react-native-gifted-chat/lib/GiftedChat.js +index a91d004..54fd541 100644 +--- a/node_modules/react-native-gifted-chat/lib/GiftedChat.js ++++ b/node_modules/react-native-gifted-chat/lib/GiftedChat.js +@@ -44,6 +44,7 @@ class GiftedChat extends React.Component { + typingDisabled: false, + text: undefined, + messages: undefined, ++ contextValues: {} + }; + this.getLocale = () => this._locale; + this.onKeyboardWillShow = (e) => { +@@ -193,6 +194,11 @@ class GiftedChat extends React.Component { + this.initLocale(); + this.setMessages(messages || []); + this.setTextFromProp(text); ++ this.setState({contextValues: { ++ actionSheet: this.props.actionSheet || ++ (() => { var _a; return (_a = this._actionSheetRef.current) === null || _a === void 0 ? void 0 : _a.getContext(); }), ++ getLocale: this.getLocale, ++ }}); + } + componentWillUnmount() { + this.setIsMounted(false); +@@ -416,13 +422,7 @@ class GiftedChat extends React.Component { + } + render() { + if (this.state.isInitialized === true) { +- const actionSheet = this.props.actionSheet || +- (() => { var _a; return (_a = this._actionSheetRef.current) === null || _a === void 0 ? void 0 : _a.getContext(); }); +- const { getLocale } = this; +- return ( ++ return ( + + + +diff --git a/node_modules/react-native-gifted-chat/lib/MessageContainer.js b/node_modules/react-native-gifted-chat/lib/MessageContainer.js +index 6bdf6da..7256f5a 100644 +--- a/node_modules/react-native-gifted-chat/lib/MessageContainer.js ++++ b/node_modules/react-native-gifted-chat/lib/MessageContainer.js +@@ -54,6 +54,7 @@ export default class MessageContainer extends React.PureComponent { + showScrollBottom: false, + hasScrolled: false, + }; ++ this._extraData = [undefined, undefined] + this.renderTypingIndicator = () => { + if (Platform.OS === 'web') { + return null; +@@ -191,8 +192,14 @@ export default class MessageContainer extends React.PureComponent { + } + render() { + const { inverted } = this.props; ++ if ( ++ this._extraData[0] !== this.props.extraData || ++ this._extraData[1] !== this.props.isTyping ++ ) { ++ this._extraData = [this.props.extraData, this.props.isTyping] ++ } + return ( +- ++ + {this.state.showScrollBottom && this.props.scrollToBottom + ? this.renderScrollToBottomWrapper() + : null} diff --git a/packages/app-mobile/src/screens/Unlocked/Chat/ChatDetailScreen.tsx b/packages/app-mobile/src/screens/Unlocked/Chat/ChatDetailScreen.tsx index 7482b4bd5..0f79982df 100644 --- a/packages/app-mobile/src/screens/Unlocked/Chat/ChatDetailScreen.tsx +++ b/packages/app-mobile/src/screens/Unlocked/Chat/ChatDetailScreen.tsx @@ -1,9 +1,10 @@ import type { StackScreenProps } from "@react-navigation/stack"; -import { useState, useEffect, useCallback, useRef } from "react"; -import { Platform, Button, View, Text } from "react-native"; +import { useState, useCallback, useMemo } from "react"; -import { Video, ResizeMode, AVPlaybackStatus } from "expo-av"; +import * as Crypto from "expo-crypto"; + +// import { Video, ResizeMode, AVPlaybackStatus } from "expo-av"; import { CHAT_MESSAGES } from "@coral-xyz/common"; import { createEmptyFriendship } from "@coral-xyz/db"; @@ -13,40 +14,45 @@ import { SignalingManager, useChatsWithMetadata, } from "@coral-xyz/tamagui"; -import { GiftedChat, MessageVideoProps } from "react-native-gifted-chat"; +import { GiftedChat, Send } from "react-native-gifted-chat"; import { v4 as uuidv4 } from "uuid"; +import { UserAvatar } from "~components/UserAvatar"; import { ChatStackNavigatorParamList } from "~screens/Unlocked/Chat/ChatHelpers"; -function VideoMessage() { - const video = useRef(null); - const [status, setStatus] = useState({}); - return ( - -