connect-x-reactnative-livechat-sdk 0.2.0 → 1.2.0
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/README.md +117 -15
- package/android/build.gradle +6 -6
- package/android/src/main/AndroidManifest.xml +1 -0
- package/lib/module/ChatScreen.js +276 -118
- package/lib/module/ChatScreen.js.map +1 -1
- package/lib/module/api.js +2 -1
- package/lib/module/api.js.map +1 -1
- package/lib/module/assets/send.js +40 -0
- package/lib/module/assets/send.js.map +1 -0
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/ChatScreen.d.ts +4 -1
- package/lib/typescript/src/ChatScreen.d.ts.map +1 -1
- package/lib/typescript/src/api.d.ts +1 -1
- package/lib/typescript/src/api.d.ts.map +1 -1
- package/lib/typescript/src/assets/send.d.ts +7 -0
- package/lib/typescript/src/assets/send.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/ChatScreen.tsx +327 -116
- package/src/api.ts +2 -2
- package/src/assets/send.tsx +28 -0
- package/src/index.tsx +9 -1
package/src/api.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export const BASE_URL_LIVE_CHAT =
|
|
2
|
-
|
|
1
|
+
export const BASE_URL_LIVE_CHAT = 'https://live-chat.connect-x.tech';
|
|
2
|
+
//'https://2ab8-2405-9800-b860-ae9a-952e-2b0-91fa-fc25.ngrok-free.app'; // 'http://34.171.125.219'; //'https://live-chat.connect-x.tech';
|
|
3
3
|
const BASE_URL_TRACKING = 'https://tracking.connect-x.tech';
|
|
4
4
|
export const apiGet = async (path: string, token: string) => {
|
|
5
5
|
console.log(`GET ${BASE_URL_LIVE_CHAT}/connectx/api/${path}`);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Svg, { ClipPath, Defs, G, Path, Rect } from 'react-native-svg';
|
|
2
|
+
const SendIcon = ({
|
|
3
|
+
size,
|
|
4
|
+
backgroundColor,
|
|
5
|
+
iconColor,
|
|
6
|
+
}: {
|
|
7
|
+
size: number;
|
|
8
|
+
backgroundColor: string;
|
|
9
|
+
iconColor: string;
|
|
10
|
+
}) => (
|
|
11
|
+
<Svg width={size} height={size} viewBox="0 0 32 32" fill="none">
|
|
12
|
+
<Rect width={32} height={32} rx={16} fill={backgroundColor} />
|
|
13
|
+
<Defs>
|
|
14
|
+
<ClipPath id="clip0_4087_14448">
|
|
15
|
+
<Rect width={20} height={20} fill="white" transform="translate(6 6)" />
|
|
16
|
+
</ClipPath>
|
|
17
|
+
</Defs>
|
|
18
|
+
<G clipPath="url(#clip0_4087_14448)">
|
|
19
|
+
<Path
|
|
20
|
+
fillRule="evenodd"
|
|
21
|
+
clipRule="evenodd"
|
|
22
|
+
d="M20.9918 11.0084L10.4985 14.8026L13.9943 16.826L17.0768 13.7426C17.2332 13.5864 17.4452 13.4986 17.6663 13.4987C17.8874 13.4988 18.0993 13.5867 18.2556 13.743C18.4118 13.8994 18.4996 14.1114 18.4995 14.3325C18.4994 14.5536 18.4115 14.7655 18.2552 14.9218L15.1718 18.0051L17.1968 21.5001L20.9918 11.0084ZM21.261 9.13845C22.2568 8.77762 23.2218 9.74262 22.861 10.7384L18.4593 22.9093C18.0977 23.9076 16.7343 24.0293 16.2018 23.1101L13.521 18.4784L8.88934 15.7976C7.97018 15.2651 8.09184 13.9018 9.09018 13.5401L21.261 9.13845Z"
|
|
23
|
+
fill={iconColor}
|
|
24
|
+
/>
|
|
25
|
+
</G>
|
|
26
|
+
</Svg>
|
|
27
|
+
);
|
|
28
|
+
export default SendIcon;
|
package/src/index.tsx
CHANGED
|
@@ -8,7 +8,13 @@ export function multiply(a: number, b: number): number {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
type EventType = 'show' | 'hide';
|
|
11
|
-
type ShowPayload = {
|
|
11
|
+
type ShowPayload = {
|
|
12
|
+
token: string;
|
|
13
|
+
orgId: string;
|
|
14
|
+
channelId: string;
|
|
15
|
+
externalValue: string;
|
|
16
|
+
customHeader?: React.ReactNode;
|
|
17
|
+
};
|
|
12
18
|
|
|
13
19
|
// Event Emitter ที่รองรับการส่งข้อมูล
|
|
14
20
|
const chatEventEmitter = {
|
|
@@ -68,6 +74,8 @@ export const ChatProvider = ({ children }: { children: ReactNode }) => {
|
|
|
68
74
|
token={configRef.current.token}
|
|
69
75
|
orgId={configRef.current.orgId}
|
|
70
76
|
channelId={configRef.current.channelId}
|
|
77
|
+
externalValue={configRef.current.externalValue}
|
|
78
|
+
customHeader={configRef.current.customHeader}
|
|
71
79
|
/>
|
|
72
80
|
)}
|
|
73
81
|
</Modal>
|