@droppii-org/chat-mobile 0.2.53 → 0.2.55
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/Avatar/Avatar.utils.js +4 -2
- package/lib/module/components/Avatar/Avatar.utils.js.map +1 -1
- package/lib/module/components/Avatar/SingleAvatar.js +2 -0
- package/lib/module/components/Avatar/SingleAvatar.js.map +1 -1
- package/lib/module/components/ThreadCard/MuteThread.js +4 -61
- package/lib/module/components/ThreadCard/MuteThread.js.map +1 -1
- package/lib/module/hooks/useMuteConversation.js +66 -1
- package/lib/module/hooks/useMuteConversation.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/screens/ChatInfo/ChatInfo.js +63 -0
- package/lib/module/screens/ChatInfo/ChatInfo.js.map +1 -0
- package/lib/module/screens/ChatInfo/ChatInfoActions.js +141 -0
- package/lib/module/screens/ChatInfo/ChatInfoActions.js.map +1 -0
- package/lib/module/screens/ChatInfo/ChatInfoMediaRow.js +58 -0
- package/lib/module/screens/ChatInfo/ChatInfoMediaRow.js.map +1 -0
- package/lib/module/screens/ChatInfo/ChatInfoProfile.js +129 -0
- package/lib/module/screens/ChatInfo/ChatInfoProfile.js.map +1 -0
- package/lib/module/screens/ChatInfo/index.js +4 -0
- package/lib/module/screens/ChatInfo/index.js.map +1 -0
- package/lib/module/screens/ChatInfo/types.js +4 -0
- package/lib/module/screens/ChatInfo/types.js.map +1 -0
- package/lib/module/screens/chat-detail/ChatDetail.js +5 -3
- package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
- package/lib/module/translation/resources/i18n.js +12 -0
- package/lib/module/translation/resources/i18n.js.map +1 -1
- package/lib/typescript/src/components/Avatar/Avatar.types.d.ts +1 -1
- package/lib/typescript/src/components/Avatar/Avatar.types.d.ts.map +1 -1
- package/lib/typescript/src/components/Avatar/Avatar.utils.d.ts +2 -0
- package/lib/typescript/src/components/Avatar/Avatar.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/Avatar/SingleAvatar.d.ts.map +1 -1
- package/lib/typescript/src/components/ThreadCard/MuteThread.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useMuteConversation.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/ChatInfo/ChatInfo.d.ts +4 -0
- package/lib/typescript/src/screens/ChatInfo/ChatInfo.d.ts.map +1 -0
- package/lib/typescript/src/screens/ChatInfo/ChatInfoActions.d.ts +11 -0
- package/lib/typescript/src/screens/ChatInfo/ChatInfoActions.d.ts.map +1 -0
- package/lib/typescript/src/screens/ChatInfo/ChatInfoMediaRow.d.ts +7 -0
- package/lib/typescript/src/screens/ChatInfo/ChatInfoMediaRow.d.ts.map +1 -0
- package/lib/typescript/src/screens/ChatInfo/ChatInfoProfile.d.ts +8 -0
- package/lib/typescript/src/screens/ChatInfo/ChatInfoProfile.d.ts.map +1 -0
- package/lib/typescript/src/screens/ChatInfo/index.d.ts +3 -0
- package/lib/typescript/src/screens/ChatInfo/index.d.ts.map +1 -0
- package/lib/typescript/src/screens/ChatInfo/types.d.ts +11 -0
- package/lib/typescript/src/screens/ChatInfo/types.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/types.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -1
- package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/build-ignore.d.ts +1 -0
- package/src/components/Avatar/Avatar.types.ts +1 -1
- package/src/components/Avatar/Avatar.utils.ts +2 -0
- package/src/components/Avatar/SingleAvatar.tsx +2 -0
- package/src/components/ThreadCard/MuteThread.tsx +4 -61
- package/src/hooks/useMuteConversation.tsx +124 -0
- package/src/index.tsx +2 -0
- package/src/screens/ChatInfo/ChatInfo.tsx +61 -0
- package/src/screens/ChatInfo/ChatInfoActions.tsx +168 -0
- package/src/screens/ChatInfo/ChatInfoMediaRow.tsx +73 -0
- package/src/screens/ChatInfo/ChatInfoProfile.tsx +145 -0
- package/src/screens/ChatInfo/index.ts +2 -0
- package/src/screens/ChatInfo/types.ts +11 -0
- package/src/screens/chat-detail/ChatDetail.tsx +6 -3
- package/src/screens/chat-detail/types.ts +1 -1
- package/src/translation/resources/i18n.ts +12 -0
- package/src/hooks/useMuteConversation.ts +0 -59
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import OpenIMSDK, {
|
|
3
|
-
MessageReceiveOptType,
|
|
4
|
-
} from '@droppii/openim-rn-client-sdk';
|
|
5
|
-
import type { ConversationItem } from '@droppii/openim-rn-client-sdk';
|
|
6
|
-
import { UIUtils } from '../utils/UIUtils';
|
|
7
|
-
import { trans } from '../translation';
|
|
8
|
-
|
|
9
|
-
export function useMuteConversation() {
|
|
10
|
-
const muteConversation = useCallback(
|
|
11
|
-
async (conversation?: ConversationItem) => {
|
|
12
|
-
if (conversation == null) return;
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
await OpenIMSDK.setConversationRecvMessageOpt({
|
|
16
|
-
conversationID: conversation.conversationID,
|
|
17
|
-
opt: MessageReceiveOptType.NotNotify,
|
|
18
|
-
});
|
|
19
|
-
UIUtils.toast.open({
|
|
20
|
-
title: trans('chat:mute_toast_success'),
|
|
21
|
-
theme: 'light',
|
|
22
|
-
});
|
|
23
|
-
} catch (error) {
|
|
24
|
-
console.error('muteConversation failed', error);
|
|
25
|
-
UIUtils.toast.open({
|
|
26
|
-
title: trans('chat:generic_error'),
|
|
27
|
-
theme: 'error',
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
[]
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
const unmuteConversation = useCallback(
|
|
35
|
-
async (conversation?: ConversationItem) => {
|
|
36
|
-
if (conversation == null) return;
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
await OpenIMSDK.setConversationRecvMessageOpt({
|
|
40
|
-
conversationID: conversation.conversationID,
|
|
41
|
-
opt: MessageReceiveOptType.Normal,
|
|
42
|
-
});
|
|
43
|
-
UIUtils.toast.open({
|
|
44
|
-
title: trans('chat:unmute_toast_success'),
|
|
45
|
-
theme: 'light',
|
|
46
|
-
});
|
|
47
|
-
} catch (error) {
|
|
48
|
-
console.error('unmuteConversation failed', error);
|
|
49
|
-
UIUtils.toast.open({
|
|
50
|
-
title: trans('chat:generic_error'),
|
|
51
|
-
theme: 'error',
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
[]
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
return { muteConversation, unmuteConversation };
|
|
59
|
-
}
|