@droppii-org/chat-mobile 0.2.87 → 0.2.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/components/ThreadCard/ThreadCard.js +0 -1
- package/lib/module/components/ThreadCard/ThreadCard.js.map +1 -1
- package/lib/module/components/messages/LinkifiedText.js +34 -0
- package/lib/module/components/messages/LinkifiedText.js.map +1 -0
- package/lib/module/components/messages/quotedMessage/index.js +14 -2
- package/lib/module/components/messages/quotedMessage/index.js.map +1 -1
- package/lib/module/components/messages/textMessage/index.js +15 -22
- package/lib/module/components/messages/textMessage/index.js.map +1 -1
- package/lib/module/core/useChatListener.js +2 -2
- package/lib/module/core/useChatListener.js.map +1 -1
- package/lib/module/hooks/contacts/useSearchContacts.js +3 -2
- package/lib/module/hooks/contacts/useSearchContacts.js.map +1 -1
- package/lib/module/hooks/groups/useFetchPublicGroup.js +3 -2
- package/lib/module/hooks/groups/useFetchPublicGroup.js.map +1 -1
- package/lib/module/hooks/message/useMessages.js +6 -0
- package/lib/module/hooks/message/useMessages.js.map +1 -1
- package/lib/module/hooks/message/useSearchMessage.js +3 -2
- package/lib/module/hooks/message/useSearchMessage.js.map +1 -1
- package/lib/module/hooks/message/useSendMessage.js +10 -3
- package/lib/module/hooks/message/useSendMessage.js.map +1 -1
- package/lib/module/screens/ResourceCenter/ResourceCenterTabScene.js.map +1 -1
- package/lib/module/screens/SearchConversation/SearchAllResult.js +29 -22
- package/lib/module/screens/SearchConversation/SearchAllResult.js.map +1 -1
- package/lib/module/screens/SearchConversation/SearchCommunityResult.js +3 -2
- package/lib/module/screens/SearchConversation/SearchCommunityResult.js.map +1 -1
- package/lib/module/screens/SearchConversation/SearchContactsResult.js +4 -2
- package/lib/module/screens/SearchConversation/SearchContactsResult.js.map +1 -1
- package/lib/module/screens/SearchConversation/SearchMessagesResult.js +4 -2
- package/lib/module/screens/SearchConversation/SearchMessagesResult.js.map +1 -1
- package/lib/module/screens/SearchConversation/TabResult.js +10 -5
- package/lib/module/screens/SearchConversation/TabResult.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatDetail.js +2 -1
- package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatListLegend.js +259 -117
- package/lib/module/screens/chat-detail/ChatListLegend.js.map +1 -1
- package/lib/module/screens/chat-detail/legend/LegendChatMessage.js +6 -5
- package/lib/module/screens/chat-detail/legend/LegendChatMessage.js.map +1 -1
- package/lib/module/screens/chat-detail/messageToolbox/MessageToolboxOverlay.js +36 -4
- package/lib/module/screens/chat-detail/messageToolbox/MessageToolboxOverlay.js.map +1 -1
- package/lib/module/services/resourceCenter.js +45 -22
- package/lib/module/services/resourceCenter.js.map +1 -1
- package/lib/module/store/message.js +8 -1
- package/lib/module/store/message.js.map +1 -1
- package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/LinkifiedText.d.ts +11 -0
- package/lib/typescript/src/components/messages/LinkifiedText.d.ts.map +1 -0
- package/lib/typescript/src/components/messages/quotedMessage/index.d.ts +1 -0
- package/lib/typescript/src/components/messages/quotedMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/textMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/contacts/useSearchContacts.d.ts +2 -1
- package/lib/typescript/src/hooks/contacts/useSearchContacts.d.ts.map +1 -1
- package/lib/typescript/src/hooks/groups/useFetchPublicGroup.d.ts +1 -1
- package/lib/typescript/src/hooks/groups/useFetchPublicGroup.d.ts.map +1 -1
- package/lib/typescript/src/hooks/message/useMessages.d.ts.map +1 -1
- package/lib/typescript/src/hooks/message/useSearchMessage.d.ts +2 -1
- package/lib/typescript/src/hooks/message/useSearchMessage.d.ts.map +1 -1
- package/lib/typescript/src/hooks/message/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/src/screens/ResourceCenter/ResourceCenterTabScene.d.ts.map +1 -1
- package/lib/typescript/src/screens/SearchConversation/SearchAllResult.d.ts +2 -1
- package/lib/typescript/src/screens/SearchConversation/SearchAllResult.d.ts.map +1 -1
- package/lib/typescript/src/screens/SearchConversation/SearchCommunityResult.d.ts +2 -1
- package/lib/typescript/src/screens/SearchConversation/SearchCommunityResult.d.ts.map +1 -1
- package/lib/typescript/src/screens/SearchConversation/SearchContactsResult.d.ts +2 -1
- package/lib/typescript/src/screens/SearchConversation/SearchContactsResult.d.ts.map +1 -1
- package/lib/typescript/src/screens/SearchConversation/SearchMessagesResult.d.ts +2 -1
- package/lib/typescript/src/screens/SearchConversation/SearchMessagesResult.d.ts.map +1 -1
- package/lib/typescript/src/screens/SearchConversation/TabResult.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/legend/LegendChatMessage.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/messageToolbox/MessageToolboxOverlay.d.ts +2 -0
- package/lib/typescript/src/screens/chat-detail/messageToolbox/MessageToolboxOverlay.d.ts.map +1 -1
- package/lib/typescript/src/services/resourceCenter.d.ts.map +1 -1
- package/lib/typescript/src/store/message.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/ThreadCard/ThreadCard.tsx +0 -2
- package/src/components/messages/LinkifiedText.tsx +37 -0
- package/src/components/messages/quotedMessage/index.tsx +18 -2
- package/src/components/messages/textMessage/index.tsx +18 -27
- package/src/core/useChatListener.ts +2 -2
- package/src/hooks/contacts/useSearchContacts.ts +3 -1
- package/src/hooks/groups/useFetchPublicGroup.ts +2 -1
- package/src/hooks/message/useMessages.ts +6 -0
- package/src/hooks/message/useSearchMessage.ts +3 -1
- package/src/hooks/message/useSendMessage.ts +7 -0
- package/src/screens/ResourceCenter/ResourceCenterTabScene.tsx +0 -1
- package/src/screens/SearchConversation/SearchAllResult.tsx +25 -15
- package/src/screens/SearchConversation/SearchCommunityResult.tsx +7 -2
- package/src/screens/SearchConversation/SearchContactsResult.tsx +7 -1
- package/src/screens/SearchConversation/SearchMessagesResult.tsx +7 -1
- package/src/screens/SearchConversation/TabResult.tsx +7 -0
- package/src/screens/chat-detail/ChatDetail.tsx +1 -0
- package/src/screens/chat-detail/ChatListLegend.tsx +292 -130
- package/src/screens/chat-detail/legend/LegendChatMessage.tsx +7 -5
- package/src/screens/chat-detail/messageToolbox/MessageToolboxOverlay.tsx +46 -2
- package/src/services/resourceCenter.ts +77 -36
- package/src/store/message.ts +7 -1
|
@@ -11,12 +11,17 @@ import { SearchConversationTabResultType } from './types';
|
|
|
11
11
|
interface ISearchCommunityResultProps {
|
|
12
12
|
searchTerm: string;
|
|
13
13
|
onPressGroup?: (groupId: string) => void;
|
|
14
|
+
isActive?: boolean;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const keyExtractor = (item: SearchPublicGroupInfo) => item.groupID;
|
|
17
18
|
|
|
18
19
|
const SearchCommunityResult = memo(
|
|
19
|
-
({
|
|
20
|
+
({
|
|
21
|
+
searchTerm,
|
|
22
|
+
onPressGroup,
|
|
23
|
+
isActive = true,
|
|
24
|
+
}: ISearchCommunityResultProps) => {
|
|
20
25
|
const hasKeyword = !isEmpty(searchTerm?.trim());
|
|
21
26
|
|
|
22
27
|
const {
|
|
@@ -27,7 +32,7 @@ const SearchCommunityResult = memo(
|
|
|
27
32
|
isFetching,
|
|
28
33
|
isRefetching,
|
|
29
34
|
refetch,
|
|
30
|
-
} = useFetchPublicGroup(searchTerm);
|
|
35
|
+
} = useFetchPublicGroup(searchTerm, isActive);
|
|
31
36
|
|
|
32
37
|
const data = useMemo(
|
|
33
38
|
() => (hasKeyword ? dataFlatten : []),
|
|
@@ -18,6 +18,7 @@ import { SearchConversationTabResultType } from './types';
|
|
|
18
18
|
interface ISearchContactsResultProps {
|
|
19
19
|
searchTerm: string;
|
|
20
20
|
onPressSearchContact?: (item: IContactSearchItem) => void;
|
|
21
|
+
isActive?: boolean;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
const FILTER_ITEMS: KTagsChoiceSlideBarItemProps[] = [
|
|
@@ -44,7 +45,11 @@ const FILTER_ITEMS: KTagsChoiceSlideBarItemProps[] = [
|
|
|
44
45
|
];
|
|
45
46
|
|
|
46
47
|
const SearchContactsResult = memo(
|
|
47
|
-
({
|
|
48
|
+
({
|
|
49
|
+
searchTerm,
|
|
50
|
+
onPressSearchContact,
|
|
51
|
+
isActive = true,
|
|
52
|
+
}: ISearchContactsResultProps) => {
|
|
48
53
|
const { applicationType } = useChatContext();
|
|
49
54
|
const [contactType, setContactType] = useState<
|
|
50
55
|
ContactCategory | undefined
|
|
@@ -62,6 +67,7 @@ const SearchContactsResult = memo(
|
|
|
62
67
|
query: searchTerm,
|
|
63
68
|
applicationType,
|
|
64
69
|
type: contactType,
|
|
70
|
+
enabled: isActive,
|
|
65
71
|
});
|
|
66
72
|
|
|
67
73
|
const onFilterChanged = useCallback(
|
|
@@ -11,9 +11,14 @@ import { SearchEmpty } from './SearchEmpty';
|
|
|
11
11
|
interface ISearchMessagesResultProps {
|
|
12
12
|
searchTerm: string;
|
|
13
13
|
onPressItem?: (item: ISearchMessageItem) => void;
|
|
14
|
+
isActive?: boolean;
|
|
14
15
|
}
|
|
15
16
|
const SearchMessagesResult = memo(
|
|
16
|
-
({
|
|
17
|
+
({
|
|
18
|
+
searchTerm,
|
|
19
|
+
onPressItem,
|
|
20
|
+
isActive = true,
|
|
21
|
+
}: ISearchMessagesResultProps) => {
|
|
17
22
|
const { applicationType } = useChatContext();
|
|
18
23
|
const {
|
|
19
24
|
dataFlatten,
|
|
@@ -26,6 +31,7 @@ const SearchMessagesResult = memo(
|
|
|
26
31
|
} = useSearchMessage({
|
|
27
32
|
query: searchTerm,
|
|
28
33
|
applicationType,
|
|
34
|
+
enabled: isActive,
|
|
29
35
|
});
|
|
30
36
|
|
|
31
37
|
const renderItem = useCallback(
|
|
@@ -87,6 +87,7 @@ const SearchConversationTabResult = memo(
|
|
|
87
87
|
|
|
88
88
|
const renderScene = useCallback(
|
|
89
89
|
({ route }: { route: TabRoute }) => {
|
|
90
|
+
const isActive = route.key === routes[index]?.key;
|
|
90
91
|
switch (route.key) {
|
|
91
92
|
case SearchConversationTabResultType.All:
|
|
92
93
|
return (
|
|
@@ -95,6 +96,7 @@ const SearchConversationTabResult = memo(
|
|
|
95
96
|
handleChangeTab={handleChangeTab}
|
|
96
97
|
onPressItem={onPressItem}
|
|
97
98
|
onPressSearchContact={onPressSearchContact}
|
|
99
|
+
isActive={isActive}
|
|
98
100
|
/>
|
|
99
101
|
);
|
|
100
102
|
case SearchConversationTabResultType.Conversations:
|
|
@@ -102,6 +104,7 @@ const SearchConversationTabResult = memo(
|
|
|
102
104
|
<SearchContactsResult
|
|
103
105
|
searchTerm={searchTerm}
|
|
104
106
|
onPressSearchContact={onPressSearchContact}
|
|
107
|
+
isActive={isActive}
|
|
105
108
|
/>
|
|
106
109
|
);
|
|
107
110
|
case SearchConversationTabResultType.Messages:
|
|
@@ -109,6 +112,7 @@ const SearchConversationTabResult = memo(
|
|
|
109
112
|
<SearchMessagesResult
|
|
110
113
|
searchTerm={searchTerm}
|
|
111
114
|
onPressItem={onPressItem}
|
|
115
|
+
isActive={isActive}
|
|
112
116
|
/>
|
|
113
117
|
);
|
|
114
118
|
case SearchConversationTabResultType.Community:
|
|
@@ -116,6 +120,7 @@ const SearchConversationTabResult = memo(
|
|
|
116
120
|
<SearchCommunityResult
|
|
117
121
|
searchTerm={searchTerm}
|
|
118
122
|
onPressGroup={onPressGroup}
|
|
123
|
+
isActive={isActive}
|
|
119
124
|
/>
|
|
120
125
|
);
|
|
121
126
|
default:
|
|
@@ -128,6 +133,8 @@ const SearchConversationTabResult = memo(
|
|
|
128
133
|
onPressItem,
|
|
129
134
|
onPressSearchContact,
|
|
130
135
|
onPressGroup,
|
|
136
|
+
index,
|
|
137
|
+
routes,
|
|
131
138
|
]
|
|
132
139
|
);
|
|
133
140
|
|