@messenger-box/platform-mobile 10.0.3-alpha.135 → 10.0.3-alpha.138
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/CHANGELOG.md +8 -0
- package/lib/screens/inbox/DialogMessages.js +5 -3
- package/lib/screens/inbox/DialogMessages.js.map +1 -1
- package/lib/screens/inbox/components/SlackMessageContainer/PaymentMessage.js +197 -0
- package/lib/screens/inbox/components/SlackMessageContainer/PaymentMessage.js.map +1 -0
- package/lib/screens/inbox/containers/ConversationView.js +102 -6
- package/lib/screens/inbox/containers/ConversationView.js.map +1 -1
- package/package.json +4 -4
- package/src/screens/inbox/DialogMessages.tsx +2 -1
- package/src/screens/inbox/components/SlackMessageContainer/PaymentMessage.tsx +199 -0
- package/src/screens/inbox/containers/ConversationView.tsx +170 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [10.0.3-alpha.138](https://github.com/CDEBase/messenger-box/compare/v10.0.3-alpha.137...v10.0.3-alpha.138) (2025-12-05)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @messenger-box/platform-mobile
|
|
9
|
+
|
|
10
|
+
## [10.0.3-alpha.136](https://github.com/CDEBase/messenger-box/compare/v10.0.3-alpha.135...v10.0.3-alpha.136) (2025-12-02)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @messenger-box/platform-mobile
|
|
13
|
+
|
|
6
14
|
## [10.0.3-alpha.135](https://github.com/CDEBase/messenger-box/compare/v10.0.3-alpha.134...v10.0.3-alpha.135) (2025-11-28)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @messenger-box/platform-mobile
|
|
@@ -33,13 +33,15 @@ function DialogMessages(_a) {
|
|
|
33
33
|
var _b = _a, {
|
|
34
34
|
channelId,
|
|
35
35
|
role,
|
|
36
|
-
isShowThreadMessage = true
|
|
36
|
+
isShowThreadMessage = true,
|
|
37
|
+
isPaymentChatUI = false
|
|
37
38
|
} = _b, rest = __objRest(_b, [
|
|
38
39
|
"channelId",
|
|
39
40
|
"role",
|
|
40
|
-
"isShowThreadMessage"
|
|
41
|
+
"isShowThreadMessage",
|
|
42
|
+
"isPaymentChatUI"
|
|
41
43
|
]);
|
|
42
44
|
var _a2, _b2, _c;
|
|
43
45
|
const currentRoute = navigationRef.isReady() ? (_a2 = navigationRef) == null ? void 0 : _a2.getCurrentRoute() : null;
|
|
44
|
-
return /* @__PURE__ */ React.createElement(Box, { className: "bg-white flex-1" }, /* @__PURE__ */ React.createElement(ConversationView, __spreadProps(__spreadValues({}, rest), { channelId: (_c = (_b2 = currentRoute == null ? void 0 : currentRoute.params) == null ? void 0 : _b2.channelId) != null ? _c : channelId, role, isShowThreadMessage })));
|
|
46
|
+
return /* @__PURE__ */ React.createElement(Box, { className: "bg-white flex-1" }, /* @__PURE__ */ React.createElement(ConversationView, __spreadProps(__spreadValues({}, rest), { channelId: (_c = (_b2 = currentRoute == null ? void 0 : currentRoute.params) == null ? void 0 : _b2.channelId) != null ? _c : channelId, role, isShowThreadMessage, isPaymentChatUI })));
|
|
45
47
|
}export{DialogMessages,DialogMessages as default};//# sourceMappingURL=DialogMessages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogMessages.js","sources":["../../../src/screens/inbox/DialogMessages.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Box } from '@admin-layout/gluestack-ui-mobile';\nimport { ConversationView } from './containers/ConversationView';\nimport { navigationRef } from '@common-stack/client-react';\n\nexport function DialogMessages({ channelId, role, isShowThreadMessage = true, ...rest }) {\n const currentRoute = navigationRef.isReady() ? navigationRef?.getCurrentRoute() : null;\n return (\n // <Box bg={'white'} flex={1} pt={5}>\n <Box className=\"bg-white flex-1\">\n <ConversationView\n {...rest}\n channelId={currentRoute?.params?.channelId ?? channelId}\n role={role}\n isShowThreadMessage={isShowThreadMessage}\n />\n </Box>\n );\n}\n\nexport default DialogMessages;\n"],"names":["_a","_b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,eAAe,EAAA,
|
|
1
|
+
{"version":3,"file":"DialogMessages.js","sources":["../../../src/screens/inbox/DialogMessages.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Box } from '@admin-layout/gluestack-ui-mobile';\nimport { ConversationView } from './containers/ConversationView';\nimport { navigationRef } from '@common-stack/client-react';\n\nexport function DialogMessages({ channelId, role, isShowThreadMessage = true, isPaymentChatUI = false, ...rest }) {\n const currentRoute = navigationRef.isReady() ? navigationRef?.getCurrentRoute() : null;\n return (\n // <Box bg={'white'} flex={1} pt={5}>\n <Box className=\"bg-white flex-1\">\n <ConversationView\n {...rest}\n channelId={currentRoute?.params?.channelId ?? channelId}\n role={role}\n isShowThreadMessage={isShowThreadMessage}\n isPaymentChatUI={isPaymentChatUI}\n />\n </Box>\n );\n}\n\nexport default DialogMessages;\n"],"names":["_a","_b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,eAAe,EAAA,EAM5B;AAN4B,EAAA,IAAA,EAAA,GAAA,EAAA,EAC7B;AAAA,IAAA,SAAA;AAAA,IACA,IAAA;AAAA,IACA,mBAAA,GAAsB,IAAA;AAAA,IACtB,eAAA,GAAkB;AAAA,GARpB,GAI+B,EAAA,EAK1B,IAAA,GAAA,SAAA,CAL0B,EAAA,EAK1B;AAAA,IAJH,WAAA;AAAA,IACA,MAAA;AAAA,IACA,qBAAA;AAAA,IACA;AAAA,GAAA,CAAA;AARF,EAAA,IAAAA,KAAAC,GAAAA,EAAA,EAAA;AAWE,EAAA,MAAM,eAAe,aAAA,CAAc,OAAA,MAAYD,GAAAA,GAAA,aAAA,KAAA,IAAA,GAAA,MAAA,GAAAA,IAAe,eAAA,EAAA,GAAoB,IAAA;AAClF,EAAA,uBAEE,KAAA,CAAA,aAAA,CAAC,OAAI,SAAA,EAAU,iBAAA,EAAA,sCACN,gBAAA,EAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EAAqB,IAAA,CAAA,EAArB,EAA2B,SAAA,EAAA,CAAW,EAAA,GAAA,CAAAC,MAAA,YAAA,IAAA,IAAA,GAAA,MAAA,GAAA,YAAA,CAAc,MAAA,KAAd,gBAAAA,GAAAA,CAAsB,SAAA,KAAtB,YAAmC,SAAA,EAAW,IAAA,EAAY,mBAAA,EAA0C,eAAA,EAAA,CAAkC,CACjL,CAAA;AAER"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import React__default from'react';import {TouchableOpacity,StyleSheet,View}from'react-native';import {Day,utils}from'react-native-gifted-chat';import {Avatar,AvatarFallbackText,AvatarImage,Text}from'@admin-layout/gluestack-ui-mobile';import {MaterialCommunityIcons}from'@expo/vector-icons';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
var __publicField = (obj, key, value) => {
|
|
33
|
+
__defNormalProp(obj, key + "" , value);
|
|
34
|
+
return value;
|
|
35
|
+
};
|
|
36
|
+
const {
|
|
37
|
+
isSameUser,
|
|
38
|
+
isSameDay
|
|
39
|
+
} = utils;
|
|
40
|
+
class PaymentMessage extends React__default.Component {
|
|
41
|
+
getInnerComponentProps() {
|
|
42
|
+
const _a = this.props, {
|
|
43
|
+
containerStyle
|
|
44
|
+
} = _a, props = __objRest(_a, [
|
|
45
|
+
"containerStyle"
|
|
46
|
+
]);
|
|
47
|
+
return __spreadProps(__spreadValues({}, props), {
|
|
48
|
+
position: "left",
|
|
49
|
+
isSameUser,
|
|
50
|
+
isSameDay
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
renderDay() {
|
|
54
|
+
if (this.props.currentMessage.createdAt) {
|
|
55
|
+
const dayProps = this.getInnerComponentProps();
|
|
56
|
+
if (this.props.renderDay) {
|
|
57
|
+
return this.props.renderDay(dayProps);
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ React__default.createElement(Day, __spreadValues({}, dayProps));
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
renderAvatar(isRight) {
|
|
64
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
65
|
+
let isSameUserAndSameDay = false;
|
|
66
|
+
if (isSameUser(this.props.currentMessage, this.props.previousMessage) && isSameDay(this.props.currentMessage, this.props.previousMessage)) {
|
|
67
|
+
isSameUserAndSameDay = true;
|
|
68
|
+
}
|
|
69
|
+
const avatarProps = this.getInnerComponentProps();
|
|
70
|
+
return /* @__PURE__ */ React__default.createElement(Avatar, { size: "sm", className: "bg-transparent rounded-none", style: [isRight ? {
|
|
71
|
+
marginLeft: 8
|
|
72
|
+
} : {
|
|
73
|
+
marginRight: 8
|
|
74
|
+
}] }, /* @__PURE__ */ React__default.createElement(AvatarFallbackText, null, isSameUserAndSameDay ? "" : (_c = (_b = (_a = avatarProps == null ? void 0 : avatarProps.currentMessage) == null ? void 0 : _a.user) == null ? void 0 : _b.name) == null ? void 0 : _c[0]), !isSameUserAndSameDay && ((_e = (_d = avatarProps == null ? void 0 : avatarProps.currentMessage) == null ? void 0 : _d.user) == null ? void 0 : _e.avatar) && /* @__PURE__ */ React__default.createElement(AvatarImage, { alt: "image", style: {
|
|
75
|
+
height: 40,
|
|
76
|
+
width: 40,
|
|
77
|
+
borderRadius: 3,
|
|
78
|
+
marginTop: 1
|
|
79
|
+
}, source: {
|
|
80
|
+
uri: (_g = (_f = avatarProps == null ? void 0 : avatarProps.currentMessage) == null ? void 0 : _f.user) == null ? void 0 : _g.avatar
|
|
81
|
+
} }));
|
|
82
|
+
}
|
|
83
|
+
renderPaymentBubble(isRight) {
|
|
84
|
+
var _a;
|
|
85
|
+
const {
|
|
86
|
+
currentMessage
|
|
87
|
+
} = this.props;
|
|
88
|
+
const paymentDetails = ((_a = currentMessage == null ? void 0 : currentMessage.propsConfiguration) == null ? void 0 : _a.payment) || {};
|
|
89
|
+
const amount = paymentDetails.amount || (currentMessage == null ? void 0 : currentMessage.amount);
|
|
90
|
+
const currency = paymentDetails.currency || (currentMessage == null ? void 0 : currentMessage.currency) || "\u20B9";
|
|
91
|
+
const status = paymentDetails.status || (currentMessage == null ? void 0 : currentMessage.status) || "Sent Securely";
|
|
92
|
+
const paymentNote = paymentDetails.note || (currentMessage == null ? void 0 : currentMessage.text);
|
|
93
|
+
const time = (currentMessage == null ? void 0 : currentMessage.createdAt) ? new Date(currentMessage.createdAt).toLocaleTimeString([], {
|
|
94
|
+
hour: "2-digit",
|
|
95
|
+
minute: "2-digit"
|
|
96
|
+
}) : "";
|
|
97
|
+
return /* @__PURE__ */ React__default.createElement(TouchableOpacity, { activeOpacity: 0.85, style: [styles.bubble, isRight ? styles.bubbleRight : styles.bubbleLeft, {
|
|
98
|
+
alignSelf: isRight ? "flex-end" : "flex-start"
|
|
99
|
+
}] }, /* @__PURE__ */ React__default.createElement(Text, { style: styles.amount }, currency, amount), /* @__PURE__ */ React__default.createElement(View, { style: styles.secureRow }, /* @__PURE__ */ React__default.createElement(MaterialCommunityIcons, { name: "check-circle-outline", size: 20, color: "#4caf50", style: {
|
|
100
|
+
marginRight: 4
|
|
101
|
+
} }), /* @__PURE__ */ React__default.createElement(Text, { style: styles.secureText }, status), /* @__PURE__ */ React__default.createElement(MaterialCommunityIcons, { name: "chevron-right", size: 22, color: "#7c3aed", style: {
|
|
102
|
+
marginLeft: 4
|
|
103
|
+
} })), paymentNote && paymentNote !== status && /* @__PURE__ */ React__default.createElement(Text, { style: styles.note }, paymentNote), /* @__PURE__ */ React__default.createElement(Text, { style: [styles.time, {
|
|
104
|
+
textAlign: isRight ? "right" : "left"
|
|
105
|
+
}] }, time));
|
|
106
|
+
}
|
|
107
|
+
render() {
|
|
108
|
+
var _a;
|
|
109
|
+
const {
|
|
110
|
+
currentMessage,
|
|
111
|
+
user
|
|
112
|
+
} = this.props;
|
|
113
|
+
const isRight = ((_a = currentMessage == null ? void 0 : currentMessage.user) == null ? void 0 : _a._id) === (user == null ? void 0 : user._id);
|
|
114
|
+
const marginBottom = isSameUser(currentMessage, this.props.nextMessage) ? 2 : 10;
|
|
115
|
+
return /* @__PURE__ */ React__default.createElement(View, null, this.renderDay(), /* @__PURE__ */ React__default.createElement(View, { style: [styles.container, {
|
|
116
|
+
marginBottom
|
|
117
|
+
}, isRight ? styles.containerRight : styles.containerLeft] }, isRight ? null : this.renderAvatar(false), this.renderPaymentBubble(isRight), isRight ? this.renderAvatar(true) : null));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
__publicField(PaymentMessage, "defaultProps", {
|
|
121
|
+
renderAvatar: void 0,
|
|
122
|
+
renderBubble: null,
|
|
123
|
+
renderDay: null,
|
|
124
|
+
currentMessage: {},
|
|
125
|
+
nextMessage: {},
|
|
126
|
+
previousMessage: {},
|
|
127
|
+
user: {},
|
|
128
|
+
containerStyle: {},
|
|
129
|
+
isShowImageViewer: false,
|
|
130
|
+
setImageViewer: (obj, v) => null
|
|
131
|
+
});
|
|
132
|
+
const styles = StyleSheet.create({
|
|
133
|
+
container: {
|
|
134
|
+
flexDirection: "row",
|
|
135
|
+
alignItems: "flex-end",
|
|
136
|
+
width: "100%"
|
|
137
|
+
},
|
|
138
|
+
containerLeft: {
|
|
139
|
+
justifyContent: "flex-start"
|
|
140
|
+
},
|
|
141
|
+
containerRight: {
|
|
142
|
+
flexDirection: "row-reverse",
|
|
143
|
+
justifyContent: "flex-end"
|
|
144
|
+
},
|
|
145
|
+
bubble: {
|
|
146
|
+
backgroundColor: "#f3e8ff",
|
|
147
|
+
borderRadius: 16,
|
|
148
|
+
paddingVertical: 16,
|
|
149
|
+
paddingHorizontal: 20,
|
|
150
|
+
minWidth: 160,
|
|
151
|
+
maxWidth: 320,
|
|
152
|
+
shadowColor: "#000",
|
|
153
|
+
shadowOffset: {
|
|
154
|
+
width: 0,
|
|
155
|
+
height: 1
|
|
156
|
+
},
|
|
157
|
+
shadowOpacity: 0.08,
|
|
158
|
+
shadowRadius: 4,
|
|
159
|
+
elevation: 2,
|
|
160
|
+
marginBottom: 2
|
|
161
|
+
},
|
|
162
|
+
bubbleLeft: {
|
|
163
|
+
marginLeft: 0,
|
|
164
|
+
marginRight: 32
|
|
165
|
+
},
|
|
166
|
+
bubbleRight: {
|
|
167
|
+
marginRight: 0,
|
|
168
|
+
marginLeft: 32
|
|
169
|
+
},
|
|
170
|
+
amount: {
|
|
171
|
+
fontSize: 26,
|
|
172
|
+
fontWeight: "bold",
|
|
173
|
+
color: "#18181b",
|
|
174
|
+
marginBottom: 8
|
|
175
|
+
},
|
|
176
|
+
secureRow: {
|
|
177
|
+
flexDirection: "row",
|
|
178
|
+
alignItems: "center",
|
|
179
|
+
marginBottom: 4
|
|
180
|
+
},
|
|
181
|
+
secureText: {
|
|
182
|
+
fontSize: 16,
|
|
183
|
+
color: "#18181b",
|
|
184
|
+
fontWeight: "500"
|
|
185
|
+
},
|
|
186
|
+
note: {
|
|
187
|
+
fontSize: 14,
|
|
188
|
+
color: "#6b7280",
|
|
189
|
+
marginTop: 2,
|
|
190
|
+
marginBottom: 2
|
|
191
|
+
},
|
|
192
|
+
time: {
|
|
193
|
+
fontSize: 12,
|
|
194
|
+
color: "#a1a1aa",
|
|
195
|
+
marginTop: 6
|
|
196
|
+
}
|
|
197
|
+
});export{PaymentMessage as default};//# sourceMappingURL=PaymentMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaymentMessage.js","sources":["../../../../../src/screens/inbox/components/SlackMessageContainer/PaymentMessage.tsx"],"sourcesContent":["import React from 'react';\nimport { View, StyleSheet, TouchableOpacity } from 'react-native';\nimport { Day, utils } from 'react-native-gifted-chat';\nimport { Avatar, AvatarFallbackText, AvatarImage, Text } from '@admin-layout/gluestack-ui-mobile';\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\n\nconst { isSameUser, isSameDay } = utils;\n\nexport default class PaymentMessage extends React.Component<any> {\n static defaultProps = {\n renderAvatar: undefined,\n renderBubble: null,\n renderDay: null,\n currentMessage: {},\n nextMessage: {},\n previousMessage: {},\n user: {},\n containerStyle: {},\n isShowImageViewer: false,\n setImageViewer: (obj: any, v: boolean) => null,\n };\n\n getInnerComponentProps() {\n const { containerStyle, ...props } = this.props;\n return {\n ...props,\n position: 'left',\n isSameUser,\n isSameDay,\n };\n }\n\n renderDay() {\n if (this.props.currentMessage.createdAt) {\n const dayProps = this.getInnerComponentProps();\n if (this.props.renderDay) {\n return this.props.renderDay(dayProps);\n }\n return <Day {...dayProps} />;\n }\n return null;\n }\n\n renderAvatar(isRight: boolean) {\n let extraStyle: any;\n let isSameUserAndSameDay: boolean = false;\n if (\n isSameUser(this.props.currentMessage, this.props.previousMessage) &&\n isSameDay(this.props.currentMessage, this.props.previousMessage)\n ) {\n extraStyle = { height: 0 };\n isSameUserAndSameDay = true;\n }\n const avatarProps: any = this.getInnerComponentProps();\n return (\n <Avatar\n size={'sm'}\n className=\"bg-transparent rounded-none\"\n style={[isRight ? { marginLeft: 8 } : { marginRight: 8 }]}\n >\n <AvatarFallbackText>\n {isSameUserAndSameDay ? '' : avatarProps?.currentMessage?.user?.name?.[0]}\n </AvatarFallbackText>\n {!isSameUserAndSameDay && avatarProps?.currentMessage?.user?.avatar && (\n <AvatarImage\n alt=\"image\"\n style={{ height: 40, width: 40, borderRadius: 3, marginTop: 1 }}\n source={{\n uri: avatarProps?.currentMessage?.user?.avatar,\n }}\n />\n )}\n </Avatar>\n );\n }\n\n renderPaymentBubble(isRight: boolean) {\n const { currentMessage } = this.props;\n // Extract payment details\n const paymentDetails = currentMessage?.propsConfiguration?.payment || {};\n const amount = paymentDetails.amount || currentMessage?.amount;\n const currency = paymentDetails.currency || currentMessage?.currency || '₹';\n const status = paymentDetails.status || currentMessage?.status || 'Sent Securely';\n const paymentNote = paymentDetails.note || currentMessage?.text;\n const time = currentMessage?.createdAt\n ? new Date(currentMessage.createdAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })\n : '';\n\n return (\n <TouchableOpacity\n activeOpacity={0.85}\n style={[\n styles.bubble,\n isRight ? styles.bubbleRight : styles.bubbleLeft,\n { alignSelf: isRight ? 'flex-end' : 'flex-start' },\n ]}\n >\n <Text style={styles.amount}>\n {currency}\n {amount}\n </Text>\n <View style={styles.secureRow}>\n <MaterialCommunityIcons\n name=\"check-circle-outline\"\n size={20}\n color=\"#4caf50\"\n style={{ marginRight: 4 }}\n />\n <Text style={styles.secureText}>{status}</Text>\n <MaterialCommunityIcons name=\"chevron-right\" size={22} color=\"#7c3aed\" style={{ marginLeft: 4 }} />\n </View>\n {paymentNote && paymentNote !== status && <Text style={styles.note}>{paymentNote}</Text>}\n <Text style={[styles.time, { textAlign: isRight ? 'right' : 'left' }]}>{time}</Text>\n </TouchableOpacity>\n );\n }\n\n render() {\n const { currentMessage, user } = this.props;\n const isRight = currentMessage?.user?._id === user?._id;\n const marginBottom = isSameUser(currentMessage, this.props.nextMessage) ? 2 : 10;\n return (\n <View>\n {this.renderDay()}\n <View\n style={[styles.container, { marginBottom }, isRight ? styles.containerRight : styles.containerLeft]}\n >\n {isRight ? null : this.renderAvatar(false)}\n {this.renderPaymentBubble(isRight)}\n {isRight ? this.renderAvatar(true) : null}\n </View>\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: 'row',\n alignItems: 'flex-end',\n width: '100%',\n },\n containerLeft: {\n justifyContent: 'flex-start',\n },\n containerRight: {\n flexDirection: 'row-reverse',\n justifyContent: 'flex-end',\n },\n bubble: {\n backgroundColor: '#f3e8ff',\n borderRadius: 16,\n paddingVertical: 16,\n paddingHorizontal: 20,\n minWidth: 160,\n maxWidth: 320,\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 1 },\n shadowOpacity: 0.08,\n shadowRadius: 4,\n elevation: 2,\n marginBottom: 2,\n },\n bubbleLeft: {\n marginLeft: 0,\n marginRight: 32,\n },\n bubbleRight: {\n marginRight: 0,\n marginLeft: 32,\n },\n amount: {\n fontSize: 26,\n fontWeight: 'bold',\n color: '#18181b',\n marginBottom: 8,\n },\n secureRow: {\n flexDirection: 'row',\n alignItems: 'center',\n marginBottom: 4,\n },\n secureText: {\n fontSize: 16,\n color: '#18181b',\n fontWeight: '500',\n },\n note: {\n fontSize: 14,\n color: '#6b7280',\n marginTop: 2,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IACV,KAAA,EAAO,SAAA;AAAA,IACP,SAAA,EAAW,CAAA;AAAA,IACX,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,QAAA,EAAU,EAAA;AAAA,IACV,KAAA,EAAO,SAAA;AAAA,IACP,SAAA,EAAW;AAAA;AAEf,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default,{useState,useRef,useMemo,useEffect,useCallback}from'react';import {useToast,Box,Button,ButtonText,HStack,Avatar,AvatarFallbackText,AvatarImage,Text,ScrollView,Image,Spinner}from'@admin-layout/gluestack-ui-mobile';import {Platform,View,TouchableHighlight,TouchableOpacity,TextInput,KeyboardAvoidingView,Animated}from'react-native';import {useRoute,useNavigation,useIsFocused,useFocusEffect}from'@react-navigation/native';import {navigationRef}from'@common-stack/client-react';import {useSelector,shallowEqual}from'react-redux';import {uniqBy,orderBy,startCase}from'lodash-es';import*as ImagePicker from'expo-image-picker';import {MaterialCommunityIcons,Ionicons,MaterialIcons}from'@expo/vector-icons';import {Send,MessageText}from'react-native-gifted-chat';import {PostTypeEnum,FileRefType,RoomType,PreDefinedRole}from'common';import {useAddDirectChannel,useSendChannelMessage,useSendExpoNotification,MESSAGES_DOCUMENT,CHAT_MESSAGE_ADDED,useChannelMessagesQuery}from'../../../queries/inboxQueries.js';import {useUploadFilesNative}from'@messenger-box/platform-client';import {objectId}from'@messenger-box/core';import {userSelector}from'@adminide-stack/user-auth0-client';import {isToday,isYesterday,format}from'date-fns';import Message from'../components/SlackMessageContainer/SlackMessage.js';import ImageViewerModal from'../components/SlackMessageContainer/ImageViewerModal.js';import CachedImage from'../components/CachedImage/index.js';import {config}from'../config/config.js';import colors from'tailwindcss/colors';import {SubscriptionHandler}from'../components/SubscriptionHandler.js';import {useInboxMessages}from'../hooks/useInboxMessages.js';import'react-native-reanimated';import'expo-constants';import {GiftedChatInboxComponent}from'../components/GiftedChatInboxComponent.js';var __defProp = Object.defineProperty;
|
|
1
|
+
import React__default,{useState,useRef,useMemo,useEffect,useCallback}from'react';import {useToast,Box,Button,ButtonText,HStack,Avatar,AvatarFallbackText,AvatarImage,Text,ScrollView,Image,VStack,Spinner}from'@admin-layout/gluestack-ui-mobile';import {Platform,View,TouchableHighlight,TouchableOpacity,TextInput,KeyboardAvoidingView,Animated}from'react-native';import {useRoute,useNavigation,useIsFocused,useFocusEffect}from'@react-navigation/native';import {navigationRef}from'@common-stack/client-react';import {useSelector,shallowEqual}from'react-redux';import {uniqBy,orderBy,startCase}from'lodash-es';import*as ImagePicker from'expo-image-picker';import {MaterialCommunityIcons,Ionicons,MaterialIcons}from'@expo/vector-icons';import {Send,MessageText}from'react-native-gifted-chat';import {PostTypeEnum,FileRefType,RoomType,PreDefinedRole}from'common';import {useAddDirectChannel,useSendChannelMessage,useSendExpoNotification,MESSAGES_DOCUMENT,CHAT_MESSAGE_ADDED,useChannelMessagesQuery}from'../../../queries/inboxQueries.js';import {useUploadFilesNative}from'@messenger-box/platform-client';import {objectId}from'@messenger-box/core';import {userSelector}from'@adminide-stack/user-auth0-client';import {isToday,isYesterday,format}from'date-fns';import Message from'../components/SlackMessageContainer/SlackMessage.js';import ImageViewerModal from'../components/SlackMessageContainer/ImageViewerModal.js';import CachedImage from'../components/CachedImage/index.js';import {config}from'../config/config.js';import colors from'tailwindcss/colors';import {SubscriptionHandler}from'../components/SubscriptionHandler.js';import {useInboxMessages}from'../hooks/useInboxMessages.js';import'react-native-reanimated';import'expo-constants';import {GiftedChatInboxComponent}from'../components/GiftedChatInboxComponent.js';import PaymentMessage from'../components/SlackMessageContainer/PaymentMessage.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -100,11 +100,13 @@ const ConversationViewComponent = (_a) => {
|
|
|
100
100
|
var _b = _a, {
|
|
101
101
|
channelId: initialChannelId,
|
|
102
102
|
role,
|
|
103
|
-
isShowThreadMessage
|
|
103
|
+
isShowThreadMessage,
|
|
104
|
+
isPaymentChatUI
|
|
104
105
|
} = _b, rest = __objRest(_b, [
|
|
105
106
|
"channelId",
|
|
106
107
|
"role",
|
|
107
|
-
"isShowThreadMessage"
|
|
108
|
+
"isShowThreadMessage",
|
|
109
|
+
"isPaymentChatUI"
|
|
108
110
|
]);
|
|
109
111
|
var _a2, _b2, _c, _d;
|
|
110
112
|
const {
|
|
@@ -1161,6 +1163,100 @@ const ConversationViewComponent = (_a) => {
|
|
|
1161
1163
|
const renderMessage = useCallback((props) => {
|
|
1162
1164
|
return /* @__PURE__ */ React__default.createElement(Message, __spreadProps(__spreadValues({}, props), { isShowImageViewer, setImageViewer: setImageViewerObject }));
|
|
1163
1165
|
}, [isShowImageViewer]);
|
|
1166
|
+
const renderPaymentMessageText = useCallback((props) => {
|
|
1167
|
+
var _a3, _b3, _c2, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
1168
|
+
const {
|
|
1169
|
+
currentMessage
|
|
1170
|
+
} = props;
|
|
1171
|
+
const lastReply = ((_b3 = (_a3 = currentMessage == null ? void 0 : currentMessage.replies) == null ? void 0 : _a3.data) == null ? void 0 : _b3.length) > 0 ? (_d2 = (_c2 = currentMessage == null ? void 0 : currentMessage.replies) == null ? void 0 : _c2.data) == null ? void 0 : _d2[0] : null;
|
|
1172
|
+
if (!(currentMessage == null ? void 0 : currentMessage.text) || currentMessage.text.trim() === "") {
|
|
1173
|
+
return null;
|
|
1174
|
+
}
|
|
1175
|
+
if (currentMessage.type === "PAYMENT") {
|
|
1176
|
+
const paymentDetails = ((_e = currentMessage == null ? void 0 : currentMessage.propsConfiguration) == null ? void 0 : _e.payment) || {};
|
|
1177
|
+
const amount = paymentDetails.amount || (currentMessage == null ? void 0 : currentMessage.amount);
|
|
1178
|
+
const currency = paymentDetails.currency || (currentMessage == null ? void 0 : currentMessage.currency) || "$";
|
|
1179
|
+
const status = paymentDetails.status || (currentMessage == null ? void 0 : currentMessage.status) || "Completed";
|
|
1180
|
+
const paymentNote = paymentDetails.note || (currentMessage == null ? void 0 : currentMessage.text);
|
|
1181
|
+
return /* @__PURE__ */ React__default.createElement(TouchableHighlight, { underlayColor: "#e0f7fa", style: {
|
|
1182
|
+
width: "100%"
|
|
1183
|
+
}, onPress: () => {
|
|
1184
|
+
if (currentMessage == null ? void 0 : currentMessage.isShowThreadMessage)
|
|
1185
|
+
navigation.navigate(config.THREAD_MESSEGE_PATH, {
|
|
1186
|
+
channelId,
|
|
1187
|
+
title: "Message",
|
|
1188
|
+
postParentId: currentMessage == null ? void 0 : currentMessage._id,
|
|
1189
|
+
isPostParentIdThread: true
|
|
1190
|
+
});
|
|
1191
|
+
} }, /* @__PURE__ */ React__default.createElement(Box, { style: {
|
|
1192
|
+
backgroundColor: "#e0f7fa",
|
|
1193
|
+
borderRadius: 16,
|
|
1194
|
+
padding: 12,
|
|
1195
|
+
marginVertical: 2,
|
|
1196
|
+
borderWidth: 1,
|
|
1197
|
+
borderColor: "#26c6da",
|
|
1198
|
+
flexDirection: "row",
|
|
1199
|
+
alignItems: "center"
|
|
1200
|
+
} }, /* @__PURE__ */ React__default.createElement(MaterialCommunityIcons, { name: "credit-card-check", size: 28, color: "#00838f", style: {
|
|
1201
|
+
marginRight: 10
|
|
1202
|
+
} }), /* @__PURE__ */ React__default.createElement(VStack, { style: {
|
|
1203
|
+
flex: 1
|
|
1204
|
+
} }, /* @__PURE__ */ React__default.createElement(Text, { style: {
|
|
1205
|
+
fontWeight: "bold",
|
|
1206
|
+
color: "#00838f",
|
|
1207
|
+
fontSize: 16
|
|
1208
|
+
} }, amount ? `${currency}${amount}` : "Payment"), /* @__PURE__ */ React__default.createElement(Text, { style: {
|
|
1209
|
+
color: "#00838f",
|
|
1210
|
+
fontSize: 13,
|
|
1211
|
+
marginTop: 2
|
|
1212
|
+
} }, status), paymentNote && /* @__PURE__ */ React__default.createElement(Text, { style: {
|
|
1213
|
+
color: "#444",
|
|
1214
|
+
fontSize: 13,
|
|
1215
|
+
marginTop: 4
|
|
1216
|
+
} }, paymentNote))));
|
|
1217
|
+
} else {
|
|
1218
|
+
return /* @__PURE__ */ React__default.createElement(TouchableHighlight, { underlayColor: "#c0c0c0", style: {
|
|
1219
|
+
width: "100%"
|
|
1220
|
+
}, onPress: () => {
|
|
1221
|
+
if (currentMessage == null ? void 0 : currentMessage.isShowThreadMessage)
|
|
1222
|
+
navigation.navigate(config.THREAD_MESSEGE_PATH, {
|
|
1223
|
+
channelId,
|
|
1224
|
+
title: "Message",
|
|
1225
|
+
postParentId: currentMessage == null ? void 0 : currentMessage._id,
|
|
1226
|
+
isPostParentIdThread: true
|
|
1227
|
+
});
|
|
1228
|
+
} }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(MessageText, __spreadProps(__spreadValues({}, props), { textStyle: {
|
|
1229
|
+
left: {
|
|
1230
|
+
marginLeft: 5
|
|
1231
|
+
}
|
|
1232
|
+
} })), ((_g = (_f = currentMessage == null ? void 0 : currentMessage.replies) == null ? void 0 : _f.data) == null ? void 0 : _g.length) > 0 && /* @__PURE__ */ React__default.createElement(HStack, { space: "sm", className: "px-1 items-center" }, /* @__PURE__ */ React__default.createElement(HStack, null, (_l = (_k = (_j = (_i = (_h = currentMessage == null ? void 0 : currentMessage.replies) == null ? void 0 : _h.data) == null ? void 0 : _i.filter((v, i, a) => a.findIndex((t) => {
|
|
1233
|
+
var _a4, _b4;
|
|
1234
|
+
return ((_a4 = t == null ? void 0 : t.author) == null ? void 0 : _a4.id) === ((_b4 = v == null ? void 0 : v.author) == null ? void 0 : _b4.id);
|
|
1235
|
+
}) === i)) == null ? void 0 : _j.slice(0, 2)) == null ? void 0 : _k.reverse()) == null ? void 0 : _l.map((p, i) => {
|
|
1236
|
+
var _a4, _b4, _c3;
|
|
1237
|
+
return /* @__PURE__ */ React__default.createElement(Avatar, { key: "conversation-replies-key-" + i, className: "bg-transparent", size: "sm" }, /* @__PURE__ */ React__default.createElement(AvatarFallbackText, null, startCase((_b4 = (_a4 = p == null ? void 0 : p.author) == null ? void 0 : _a4.username) == null ? void 0 : _b4.charAt(0))), /* @__PURE__ */ React__default.createElement(AvatarImage, { alt: "user image", style: {
|
|
1238
|
+
borderRadius: 6,
|
|
1239
|
+
borderWidth: 2,
|
|
1240
|
+
borderColor: "#fff"
|
|
1241
|
+
}, source: {
|
|
1242
|
+
uri: (_c3 = p == null ? void 0 : p.author) == null ? void 0 : _c3.picture
|
|
1243
|
+
} }));
|
|
1244
|
+
})), /* @__PURE__ */ React__default.createElement(Text, { style: {
|
|
1245
|
+
fontSize: 12
|
|
1246
|
+
}, className: "font-bold color-blue-800" }, (_m = currentMessage == null ? void 0 : currentMessage.replies) == null ? void 0 : _m.totalCount, " ", ((_n = currentMessage == null ? void 0 : currentMessage.replies) == null ? void 0 : _n.totalCount) == 1 ? "reply" : "replies"), /* @__PURE__ */ React__default.createElement(Text, { style: {
|
|
1247
|
+
fontSize: 12
|
|
1248
|
+
}, className: "font-bold color-gray-500" }, lastReply ? createdAtText(lastReply == null ? void 0 : lastReply.createdAt) : ""))));
|
|
1249
|
+
}
|
|
1250
|
+
}, [navigation, channelId, role]);
|
|
1251
|
+
const renderPaymentMessage = useCallback((props) => {
|
|
1252
|
+
const {
|
|
1253
|
+
currentMessage
|
|
1254
|
+
} = props;
|
|
1255
|
+
if ((currentMessage == null ? void 0 : currentMessage.type) === "PAYMENT") {
|
|
1256
|
+
return /* @__PURE__ */ React__default.createElement(PaymentMessage, __spreadProps(__spreadValues({}, props), { navigation, channelId, config }));
|
|
1257
|
+
}
|
|
1258
|
+
return /* @__PURE__ */ React__default.createElement(Message, __spreadProps(__spreadValues({}, props), { isShowImageViewer, setImageViewer: setImageViewerObject }));
|
|
1259
|
+
}, [isShowImageViewer, channelId, navigation]);
|
|
1164
1260
|
let onScroll = false;
|
|
1165
1261
|
const onMomentumScrollBegin = async ({
|
|
1166
1262
|
nativeEvent
|
|
@@ -1333,8 +1429,8 @@ const ConversationViewComponent = (_a) => {
|
|
|
1333
1429
|
_id: (auth == null ? void 0 : auth.id) || ""
|
|
1334
1430
|
},
|
|
1335
1431
|
renderSend,
|
|
1336
|
-
renderMessageText,
|
|
1337
|
-
renderMessage,
|
|
1432
|
+
renderMessageText: isPaymentChatUI ? renderPaymentMessageText : renderMessageText,
|
|
1433
|
+
renderMessage: isPaymentChatUI ? renderPaymentMessage : renderMessage,
|
|
1338
1434
|
renderChatFooter,
|
|
1339
1435
|
renderLoadEarlier,
|
|
1340
1436
|
loadEarlier: totalCount > channelMessages.length,
|
|
@@ -1345,5 +1441,5 @@ const ConversationViewComponent = (_a) => {
|
|
|
1345
1441
|
)));
|
|
1346
1442
|
};
|
|
1347
1443
|
const ConversationView = React__default.memo(ConversationViewComponent, (prevProps, nextProps) => {
|
|
1348
|
-
return prevProps.channelId === nextProps.channelId && prevProps.role === nextProps.role && prevProps.isShowThreadMessage === nextProps.isShowThreadMessage;
|
|
1444
|
+
return prevProps.channelId === nextProps.channelId && prevProps.role === nextProps.role && prevProps.isShowThreadMessage === nextProps.isShowThreadMessage && prevProps.isPaymentChatUI === nextProps.isPaymentChatUI;
|
|
1349
1445
|
});export{ConversationView};//# sourceMappingURL=ConversationView.js.map
|