diff --git a/app/components/chat-message/chat-message.tsx b/app/components/chat-message/chat-message.tsx
index ad9e198b0..f2ed8df34 100644
--- a/app/components/chat-message/chat-message.tsx
+++ b/app/components/chat-message/chat-message.tsx
@@ -4,11 +4,10 @@ import "react-native-get-random-values"
import React, { useEffect, useRef } from "react"
import { View, Text } from "react-native"
import { makeStyles } from "@rneui/themed"
-import { MessageType } from "@flyerhq/react-native-chat-ui"
type Props = {
recipientId: `npub1${string}`
- message: MessageType.Text
+ message: { id: string; author: { id: string }; text: string }
nextMessage: number
prevMessage: boolean
}
diff --git a/app/navigation/root-navigator.tsx b/app/navigation/root-navigator.tsx
index 27fd4238f..7f395624b 100644
--- a/app/navigation/root-navigator.tsx
+++ b/app/navigation/root-navigator.tsx
@@ -1,5 +1,6 @@
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"
import { CardStyleInterpolators, createStackNavigator } from "@react-navigation/stack"
+import { getFocusedRouteNameFromRoute } from "@react-navigation/native"
import * as React from "react"
import {
@@ -596,7 +597,7 @@ export const RootStack = () => {
)
@@ -720,16 +721,20 @@ export const PrimaryNavigator = () => {
({
headerShown: false,
title: LL.ChatScreen.title(),
+ tabBarStyle:
+ getFocusedRouteNameFromRoute(route) === "messages"
+ ? { display: "none" }
+ : styles.bottomNavigatorStyle,
tabBarIcon: ({ color }) => (
),
- }}
+ })}
/>
) : null}
- /**
- * Send a plain text message to the group
- */
- sendMessage: (text: string) => Promise
- /**
- * Request to join the group (NIP-29 join event)
- */
+ sendMessage: (text: string, replyToId?: string) => Promise
requestJoin: () => Promise
+ removeMessage: (messageId: string) => Promise
+ removeMember: (pubkey: string) => Promise
}
const NostrGroupChatContext = createContext(undefined)
// ===== Helpers =====
-const makeSystemText = (text: string): MessageType.Text => ({
+const makeSystemMessage = (text: string): GroupMessage => ({
id: `sys-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
- author: { id: "system" },
+ authorId: "system",
createdAt: Date.now(),
- type: "text",
text,
+ isSystem: true,
})
export const NostrGroupChatProvider: React.FC = ({
@@ -60,24 +63,25 @@ export const NostrGroupChatProvider: React.FC = ({
}) => {
const { userPublicKey } = useChatContext()
- // Internal message map ensures dedupe by id
- const [messagesMap, setMessagesMap] = useState