@droppii-org/chat-mobile 0.2.70 → 0.2.72
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 +2 -2
- package/lib/module/components/ThreadCard/ThreadCard.js.map +1 -1
- package/lib/module/hooks/conversation/useGetConversationDetail.js +26 -4
- package/lib/module/hooks/conversation/useGetConversationDetail.js.map +1 -1
- package/lib/module/hooks/message/useSendMessage.js +8 -2
- package/lib/module/hooks/message/useSendMessage.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatComposer.js +19 -2
- package/lib/module/screens/chat-detail/ChatComposer.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/ChatDetailHeader.js +9 -3
- package/lib/module/screens/chat-detail/ChatDetailHeader.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatListLegend.js +16 -20
- package/lib/module/screens/chat-detail/ChatListLegend.js.map +1 -1
- package/lib/module/screens/inbox/Inbox.js.map +1 -1
- package/lib/module/screens/inbox/MessagesTab.js.map +1 -1
- package/lib/module/store/message.js +1 -1
- package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts +2 -1
- package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts.map +1 -1
- package/lib/typescript/src/hooks/conversation/useGetConversationDetail.d.ts +8 -0
- package/lib/typescript/src/hooks/conversation/useGetConversationDetail.d.ts.map +1 -1
- package/lib/typescript/src/hooks/message/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatComposer.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/ChatDetailHeader.d.ts +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/types.d.ts +1 -0
- package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -1
- package/lib/typescript/src/screens/inbox/Inbox.d.ts +2 -1
- package/lib/typescript/src/screens/inbox/Inbox.d.ts.map +1 -1
- package/lib/typescript/src/screens/inbox/MessagesTab.d.ts +2 -1
- package/lib/typescript/src/screens/inbox/MessagesTab.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/ThreadCard/ThreadCard.tsx +7 -3
- package/src/hooks/conversation/useGetConversationDetail.ts +30 -5
- package/src/hooks/message/useSendMessage.ts +16 -9
- package/src/screens/chat-detail/ChatComposer.tsx +17 -4
- package/src/screens/chat-detail/ChatDetail.tsx +1 -0
- package/src/screens/chat-detail/ChatDetailHeader.tsx +8 -2
- package/src/screens/chat-detail/ChatListLegend.tsx +25 -20
- package/src/screens/chat-detail/types.ts +1 -0
- package/src/screens/inbox/Inbox.tsx +2 -1
- package/src/screens/inbox/MessagesTab.tsx +3 -2
- package/src/store/message.ts +1 -1
|
@@ -18,12 +18,20 @@ import {
|
|
|
18
18
|
import Animated, {
|
|
19
19
|
useSharedValue,
|
|
20
20
|
useAnimatedStyle,
|
|
21
|
-
|
|
21
|
+
withTiming,
|
|
22
|
+
Easing,
|
|
22
23
|
type SharedValue,
|
|
23
24
|
} from 'react-native-reanimated';
|
|
24
25
|
import { KeyboardAwareLegendList } from '@legendapp/list/keyboard';
|
|
25
26
|
import { LegendList, type LegendListRef } from '@legendapp/list/react-native';
|
|
26
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
KContainer,
|
|
29
|
+
KColors,
|
|
30
|
+
KSpacingValue,
|
|
31
|
+
KLabel,
|
|
32
|
+
KRadiusValue,
|
|
33
|
+
KImage,
|
|
34
|
+
} from '@droppii/libs';
|
|
27
35
|
import { precomputeLegendListData } from '../../utils/legendListMessage';
|
|
28
36
|
import type { ChatListProps } from './types';
|
|
29
37
|
import { LegendChatMessage } from './legend/LegendChatMessage';
|
|
@@ -394,8 +402,9 @@ export const ChatListLegend = memo(
|
|
|
394
402
|
scrollDebounceRef.current = setTimeout(() => {
|
|
395
403
|
if (isAtBottomRef.current !== isAtBottom) {
|
|
396
404
|
isAtBottomRef.current = isAtBottom;
|
|
397
|
-
buttonOpacity.value =
|
|
398
|
-
duration:
|
|
405
|
+
buttonOpacity.value = withTiming(isAtBottom ? 0 : 1, {
|
|
406
|
+
duration: 200,
|
|
407
|
+
easing: Easing.out(Easing.ease),
|
|
399
408
|
});
|
|
400
409
|
}
|
|
401
410
|
if (isAtBottom) {
|
|
@@ -411,7 +420,10 @@ export const ChatListLegend = memo(
|
|
|
411
420
|
onLoadMoreOld?.(false);
|
|
412
421
|
} else {
|
|
413
422
|
scrollMessageToEnd({ animated: true, closeKeyboard: false });
|
|
414
|
-
buttonOpacity.value =
|
|
423
|
+
buttonOpacity.value = withTiming(0, {
|
|
424
|
+
duration: 200,
|
|
425
|
+
easing: Easing.out(Easing.ease),
|
|
426
|
+
});
|
|
415
427
|
isAtBottomRef.current = true;
|
|
416
428
|
setShowBadge(false);
|
|
417
429
|
}
|
|
@@ -543,12 +555,11 @@ export const ChatListLegend = memo(
|
|
|
543
555
|
accessibilityLabel="Scroll to latest messages"
|
|
544
556
|
accessibilityRole="button"
|
|
545
557
|
>
|
|
546
|
-
<
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
</KLabel.Text>
|
|
558
|
+
<KImage.VectorIcons
|
|
559
|
+
name="arrow-down-o"
|
|
560
|
+
size={16}
|
|
561
|
+
color={KColors.black}
|
|
562
|
+
/>
|
|
552
563
|
{showBadge && <KContainer.View style={styles.badge} />}
|
|
553
564
|
</KContainer.Touchable>
|
|
554
565
|
</Animated.View>
|
|
@@ -575,9 +586,9 @@ const styles = StyleSheet.create({
|
|
|
575
586
|
},
|
|
576
587
|
buttonInner: {
|
|
577
588
|
position: 'relative',
|
|
578
|
-
width:
|
|
579
|
-
height:
|
|
580
|
-
borderRadius:
|
|
589
|
+
width: 32,
|
|
590
|
+
height: 32,
|
|
591
|
+
borderRadius: KRadiusValue.round,
|
|
581
592
|
backgroundColor: KColors.white,
|
|
582
593
|
justifyContent: 'center',
|
|
583
594
|
alignItems: 'center',
|
|
@@ -587,11 +598,6 @@ const styles = StyleSheet.create({
|
|
|
587
598
|
shadowRadius: 8,
|
|
588
599
|
elevation: 8,
|
|
589
600
|
},
|
|
590
|
-
scrollToBottomText: {
|
|
591
|
-
fontSize: 20,
|
|
592
|
-
fontWeight: 'bold',
|
|
593
|
-
color: KColors.palette.primary.w400,
|
|
594
|
-
},
|
|
595
601
|
errorRow: {
|
|
596
602
|
padding: 16,
|
|
597
603
|
justifyContent: 'center',
|
|
@@ -606,6 +612,5 @@ const styles = StyleSheet.create({
|
|
|
606
612
|
borderRadius: 6,
|
|
607
613
|
backgroundColor: KColors.palette.primary.w400,
|
|
608
614
|
borderWidth: 2,
|
|
609
|
-
borderColor: KColors.white,
|
|
610
615
|
},
|
|
611
616
|
});
|
|
@@ -10,11 +10,12 @@ import {
|
|
|
10
10
|
KSpacingValue,
|
|
11
11
|
} from '@droppii/libs';
|
|
12
12
|
import { MessagesTab } from './MessagesTab';
|
|
13
|
+
import type { ConversationItem } from '@droppii/openim-rn-client-sdk';
|
|
13
14
|
import { trans } from '../../translation';
|
|
14
15
|
import { CommunityTab } from './CommunityTab';
|
|
15
16
|
|
|
16
17
|
interface InboxProps {
|
|
17
|
-
onPressThread?: (item
|
|
18
|
+
onPressThread?: (item?: ConversationItem) => void;
|
|
18
19
|
onPressSearch?: () => void;
|
|
19
20
|
onPressEdit?: () => void;
|
|
20
21
|
onPressContact?: () => void;
|
|
@@ -5,9 +5,10 @@ import { useConversationList } from '../../hooks/useConversationList';
|
|
|
5
5
|
import { ThreadCard } from '../../components/ThreadCard';
|
|
6
6
|
import { useConversationStore } from '../../store';
|
|
7
7
|
import { useChatContext } from '../../context';
|
|
8
|
+
import type { ConversationItem } from '@droppii/openim-rn-client-sdk';
|
|
8
9
|
|
|
9
10
|
interface MessagesTabProps {
|
|
10
|
-
onPressThread?: (item
|
|
11
|
+
onPressThread?: (item?: ConversationItem) => void;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
const Separator = () => <KDivider type="line" size="hairline" />;
|
|
@@ -23,7 +24,7 @@ export const MessagesTab = memo(({ onPressThread }: MessagesTabProps) => {
|
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
const handleThreadPress = useCallback(
|
|
26
|
-
(params: { item
|
|
27
|
+
(params: { item?: ConversationItem; event: GestureResponderEvent }) => {
|
|
27
28
|
onPressThread?.(params.item);
|
|
28
29
|
},
|
|
29
30
|
[onPressThread]
|
package/src/store/message.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
import { mergeMessages } from '../utils/message';
|
|
15
15
|
import { useConversationStore } from './conversation';
|
|
16
16
|
|
|
17
|
-
const PAGE_SIZE =
|
|
17
|
+
const PAGE_SIZE = 20;
|
|
18
18
|
|
|
19
19
|
export const useMessageStore = create<MessageStore>()((set, get) => ({
|
|
20
20
|
messages: [],
|