react-native-srschat 0.1.46 → 0.1.48

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.
Files changed (69) hide show
  1. package/README.md +14 -3
  2. package/lib/commonjs/components/LoadingTips.js +2 -2
  3. package/lib/commonjs/components/LoadingTips.js.map +1 -1
  4. package/lib/commonjs/components/email.js +6 -3
  5. package/lib/commonjs/components/email.js.map +1 -1
  6. package/lib/commonjs/components/input.js +2 -3
  7. package/lib/commonjs/components/input.js.map +1 -1
  8. package/lib/commonjs/components/productCard.js +125 -32
  9. package/lib/commonjs/components/productCard.js.map +1 -1
  10. package/lib/commonjs/components/progressCircle.js +1 -1
  11. package/lib/commonjs/components/progressCircle.js.map +1 -1
  12. package/lib/commonjs/contexts/AppContext.js +12 -6
  13. package/lib/commonjs/contexts/AppContext.js.map +1 -1
  14. package/lib/commonjs/hooks/Stream.js +2 -1
  15. package/lib/commonjs/hooks/Stream.js.map +1 -1
  16. package/lib/commonjs/layout/ex.js +252 -270
  17. package/lib/commonjs/layout/ex.js.map +1 -1
  18. package/lib/commonjs/layout/icon.js +2 -1
  19. package/lib/commonjs/layout/icon.js.map +1 -1
  20. package/lib/commonjs/layout/welcome.js +6 -5
  21. package/lib/commonjs/layout/welcome.js.map +1 -1
  22. package/lib/commonjs/layout/window.js +38 -10
  23. package/lib/commonjs/layout/window.js.map +1 -1
  24. package/lib/commonjs/utils/storage.js +1 -1
  25. package/lib/module/components/LoadingTips.js +2 -2
  26. package/lib/module/components/LoadingTips.js.map +1 -1
  27. package/lib/module/components/email.js +7 -4
  28. package/lib/module/components/email.js.map +1 -1
  29. package/lib/module/components/input.js +2 -3
  30. package/lib/module/components/input.js.map +1 -1
  31. package/lib/module/components/productCard.js +125 -32
  32. package/lib/module/components/productCard.js.map +1 -1
  33. package/lib/module/components/progressCircle.js +1 -1
  34. package/lib/module/components/progressCircle.js.map +1 -1
  35. package/lib/module/contexts/AppContext.js +12 -6
  36. package/lib/module/contexts/AppContext.js.map +1 -1
  37. package/lib/module/hooks/Stream.js +2 -1
  38. package/lib/module/hooks/Stream.js.map +1 -1
  39. package/lib/module/layout/ex.js +252 -261
  40. package/lib/module/layout/ex.js.map +1 -1
  41. package/lib/module/layout/icon.js +2 -1
  42. package/lib/module/layout/icon.js.map +1 -1
  43. package/lib/module/layout/welcome.js +6 -5
  44. package/lib/module/layout/welcome.js.map +1 -1
  45. package/lib/module/layout/window.js +38 -10
  46. package/lib/module/layout/window.js.map +1 -1
  47. package/lib/module/utils/storage.js +1 -1
  48. package/lib/typescript/components/email.d.ts.map +1 -1
  49. package/lib/typescript/components/productCard.d.ts +2 -1
  50. package/lib/typescript/components/productCard.d.ts.map +1 -1
  51. package/lib/typescript/contexts/AppContext.d.ts.map +1 -1
  52. package/lib/typescript/hooks/Stream.d.ts.map +1 -1
  53. package/lib/typescript/layout/ex.d.ts +0 -2
  54. package/lib/typescript/layout/ex.d.ts.map +1 -1
  55. package/lib/typescript/layout/icon.d.ts.map +1 -1
  56. package/lib/typescript/layout/window.d.ts.map +1 -1
  57. package/package.json +1 -1
  58. package/src/components/LoadingTips.js +2 -2
  59. package/src/components/email.js +7 -4
  60. package/src/components/input.js +1 -2
  61. package/src/components/productCard.js +132 -33
  62. package/src/components/progressCircle.js +1 -1
  63. package/src/contexts/AppContext.js +13 -6
  64. package/src/hooks/Stream.js +1 -0
  65. package/src/layout/ex.js +250 -249
  66. package/src/layout/icon.js +2 -1
  67. package/src/layout/welcome.js +5 -5
  68. package/src/layout/window.js +33 -6
  69. package/src/utils/storage.ts +1 -1
@@ -29,10 +29,10 @@ export const AppProvider = ({ data, onProductCardClick, onAddToCartClick, uiConf
29
29
 
30
30
  // Default Messages
31
31
  const defaultMessage = [
32
- {type: "ai", text: "Hi there 👋 Im Poseidon, your Heritage Pool+ AI Agent. I can help you during your online visit with Product and Account information. How can I help you today?"}
32
+ {type: "ai", text: "Hi there 👋 I'm your Heritage Pool+ AI Assistant. I'm here to help you with Product and Account information during your online visit. I'm still learning and growing - the more we interact and the more feedback you share, the better I can assist you. How can I help you today?"}
33
33
  ]
34
34
  const maintenanceMessage = [
35
- { type: "ai", text: "Hi there 👋 I'm Poseidon, your Heritage Pool+ AI Agent. I'm currently undergoing maintenance to improve my services. Thank you for your patience and understanding!",},
35
+ { type: "ai", text: "Hi there 👋 I'm your Heritage Pool+ AI Agent. I'm currently undergoing maintenance to improve my services. Thank you for your patience and understanding!",},
36
36
  ];
37
37
 
38
38
 
@@ -78,7 +78,12 @@ export const AppProvider = ({ data, onProductCardClick, onAddToCartClick, uiConf
78
78
  if (uiConfig.toggleChat === false){
79
79
  setShowModal("Icon");
80
80
  }else{
81
- setShowModal("ChatWindow");
81
+ if (uiConfig.showWelcome === true || cachedState.showWelcome === true){
82
+ // console.log("showWelcome", uiConfig.showWelcome, cachedState.showWelcome)
83
+ setShowModal("Welcome");
84
+ }else{
85
+ setShowModal("ChatWindow");
86
+ }
82
87
  }
83
88
 
84
89
 
@@ -88,7 +93,7 @@ export const AppProvider = ({ data, onProductCardClick, onAddToCartClick, uiConf
88
93
  };
89
94
 
90
95
  init();
91
- }, [customerToken, uiConfig.toggleChat]);
96
+ }, [customerToken, uiConfig.toggleChat, uiConfig.showWelcome]);
92
97
 
93
98
  // Persist state changes
94
99
  useEffect(() => {
@@ -103,7 +108,8 @@ export const AppProvider = ({ data, onProductCardClick, onAddToCartClick, uiConf
103
108
  disclaimer,
104
109
  startStreaming,
105
110
  messages,
106
- showModal
111
+ showModal,
112
+ showWelcome: uiConfig.showWelcome
107
113
  };
108
114
 
109
115
  await updateChat(customerToken, currentState);
@@ -119,7 +125,8 @@ export const AppProvider = ({ data, onProductCardClick, onAddToCartClick, uiConf
119
125
  disclaimer,
120
126
  startStreaming,
121
127
  messages,
122
- showModal
128
+ showModal,
129
+ uiConfig.showWelcome
123
130
  ]);
124
131
 
125
132
  useEffect(() => {
@@ -163,6 +163,7 @@ export function useWebSocketMessage() {
163
163
  is_on_sale: value.is_on_sale ?? false,
164
164
  quantity_available: value.quantity_available ?? 0,
165
165
  discounts: value.discounts ?? null,
166
+ min_pack_qty: value.min_pack_qty ?? 0,
166
167
  };
167
168
  return acc;
168
169
  }, {})
package/src/layout/ex.js CHANGED
@@ -1,251 +1,252 @@
1
- import React, { useState, useEffect, useContext, useRef } from 'react';
2
- import { Text, StyleSheet, View, TextInput, TouchableOpacity, Platform, KeyboardAvoidingView,
3
- Keyboard, Animated, PanResponder, Pressable } from 'react-native';
4
- import { Header } from '../components/header';
5
- import { AppContext } from '../contexts/AppContext';
6
- import Ionicons from 'react-native-vector-icons/Ionicons';
7
- import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
8
- import { Testing } from '../components/testing';
9
- import { ChatInput } from '../components/input';
10
- import { useWebSocketMessage } from '../hooks/Stream';
11
- import { ProductCard } from '../components/productCard'
12
- import Markdown from 'react-native-markdown-display';
13
-
14
- export const ChatWindow = () => {
15
- const { handleSend, messages, input, setInput, ghostMessage, handleButtonClick, setShowModal } = useContext(AppContext);
16
-
17
- const scrollViewRef = useRef(null);
18
- const fadeAnim = useRef(new Animated.Value(0.6)).current;
19
- const panY = useRef(new Animated.Value(0)).current;
20
- const isDragging = useRef(false);
21
-
22
- useEffect(() => {
23
- if (scrollViewRef.current) {
24
- setTimeout(() => {
25
- scrollViewRef.current.scrollToEnd({ animated: false });
26
- }, 100);
27
- }
28
- }, []);
29
-
30
- useEffect(() => {
31
- if (ghostMessage) {
32
- Animated.loop(
33
- Animated.sequence([
34
- Animated.timing(fadeAnim, { toValue: 1, duration: 500, useNativeDriver: false }),
35
- Animated.timing(fadeAnim, { toValue: 0.6, duration: 500, useNativeDriver: false }),
36
- ])
37
- ).start();
38
- }
39
- }, [ghostMessage]);
40
-
41
- useWebSocketMessage()
42
-
43
- const headerPanResponder = PanResponder.create({
44
- onStartShouldSetPanResponder: () => true,
45
- onMoveShouldSetPanResponder: () => true,
46
- onPanResponderGrant: () => {
47
- isDragging.current = true;
48
- },
49
- onPanResponderMove: (evt, gestureState) => {
50
- if (isDragging.current && gestureState.dy > 0) { // Downward swipe
51
- panY.setValue(gestureState.dy);
52
- }
53
- },
54
- onPanResponderRelease: (evt, gestureState) => {
55
- if (gestureState.dy > 100) { // Swiped down enough
56
- handleClick()
57
- } else {
58
- Animated.spring(panY, { toValue: 0, useNativeDriver: false }).start();
59
- }
60
- isDragging.current = false;
61
- },
62
- });
63
-
64
- const handleClick = () => {
65
- if ((uiConfig.showIcon ?? true) !== true) {
66
- setShowModal("Off");
67
- } else {
68
- setShowModal("Icon");
69
- }
70
- };
1
+ // import React, { useState, useEffect, useContext, useRef } from 'react';
2
+ // import { Text, StyleSheet, View, TextInput, TouchableOpacity, Platform, KeyboardAvoidingView,
3
+ // Keyboard, Animated, PanResponder, Pressable } from 'react-native';
4
+ // import { Header } from '../components/header';
5
+ // import { AppContext } from '../contexts/AppContext';
6
+ // import Ionicons from 'react-native-vector-icons/Ionicons';
7
+ // import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
8
+ // import { Testing } from '../components/testing';
9
+ // import { ChatInput } from '../components/input';
10
+ // import { useWebSocketMessage } from '../hooks/Stream';
11
+ // import { ProductCard } from '../components/productCard'
12
+ // import Markdown from 'react-native-markdown-display';
13
+
14
+ // export const ChatWindow = () => {
15
+ // const { handleSend, messages, input, setInput, ghostMessage, handleButtonClick, setShowModal } = useContext(AppContext);
16
+
17
+ // const scrollViewRef = useRef(null);
18
+ // const fadeAnim = useRef(new Animated.Value(0.6)).current;
19
+ // const panY = useRef(new Animated.Value(0)).current;
20
+ // const isDragging = useRef(false);
21
+
22
+ // useEffect(() => {
23
+ // if (scrollViewRef.current) {
24
+ // setTimeout(() => {
25
+ // scrollViewRef.current.scrollToEnd({ animated: false });
26
+ // }, 100);
27
+ // }
28
+ // }, []);
29
+
30
+ // useEffect(() => {
31
+ // if (ghostMessage) {
32
+ // Animated.loop(
33
+ // Animated.sequence([
34
+ // Animated.timing(fadeAnim, { toValue: 1, duration: 500, useNativeDriver: false }),
35
+ // Animated.timing(fadeAnim, { toValue: 0.6, duration: 500, useNativeDriver: false }),
36
+ // ])
37
+ // ).start();
38
+ // }
39
+ // }, [ghostMessage]);
40
+
41
+ // useWebSocketMessage()
42
+
43
+ // const headerPanResponder = PanResponder.create({
44
+ // onStartShouldSetPanResponder: () => true,
45
+ // onMoveShouldSetPanResponder: () => true,
46
+ // onPanResponderGrant: () => {
47
+ // isDragging.current = true;
48
+ // },
49
+ // onPanResponderMove: (evt, gestureState) => {
50
+ // if (isDragging.current && gestureState.dy > 0) { // Downward swipe
51
+ // panY.setValue(gestureState.dy);
52
+ // }
53
+ // },
54
+ // onPanResponderRelease: (evt, gestureState) => {
55
+ // if (gestureState.dy > 100) { // Swiped down enough
56
+ // handleClick()
57
+ // } else {
58
+ // Animated.spring(panY, { toValue: 0, useNativeDriver: false }).start();
59
+ // }
60
+ // isDragging.current = false;
61
+ // },
62
+ // });
63
+
64
+ // const handleClick = () => {
65
+ // if ((uiConfig.showIcon ?? true) !== true) {
66
+ // setShowModal("Off");
67
+ // } else {
68
+ // setShowModal("Icon");
69
+ // }
70
+ // };
71
71
 
72
- return (
73
- <View style={styles.overlay}>
74
- {/* Click outside chat to close */}
75
- <Pressable style={styles.outsideTouchable} onPress={() => handleClick()} />
76
-
77
- <Animated.View style={[styles.container, { transform: [{ translateY: panY }] }]}>
78
- {/* Header - Only this section triggers drag-to-close */}
79
- <View style={styles.headerContainer} {...headerPanResponder.panHandlers}>
80
- <Header />
81
- </View>
82
-
83
- {/* Messages area */}
84
- <KeyboardAwareScrollView
85
- ref={scrollViewRef}
86
- contentContainerStyle={styles.messagesContent}
87
- enableOnAndroid
88
- contentInsetAdjustmentBehavior="never"
89
- automaticallyAdjustContentInsets={false}
90
- contentInset={{ bottom: 0 }}
91
- keyboardShouldPersistTaps="always"
92
- showsVerticalScrollIndicator={false}
93
- extraScrollHeight={0}
94
- onContentSizeChange={() => {
95
- scrollViewRef.current?.scrollToEnd({ animated: true });
96
- }}
97
- >
98
- {messages.map((msg, i) => (
72
+ // return (
73
+ // <View style={styles.overlay}>
74
+ // {/* Click outside chat to close */}
75
+ // <Pressable style={styles.outsideTouchable} onPress={() => handleClick()} />
76
+
77
+ // <Animated.View style={[styles.container, { transform: [{ translateY: panY }] }]}>
78
+ // {/* Header - Only this section triggers drag-to-close */}
79
+ // <View style={styles.headerContainer} {...headerPanResponder.panHandlers}>
80
+ // <Header />
81
+ // </View>
82
+
83
+ // {/* Messages area */}
84
+ // <KeyboardAwareScrollView
85
+ // ref={scrollViewRef}
86
+ // contentContainerStyle={styles.messagesContent}
87
+ // enableOnAndroid
88
+ // contentInsetAdjustmentBehavior="never"
89
+ // automaticallyAdjustContentInsets={false}
90
+ // contentInset={{ bottom: 0 }}
91
+ // keyboardShouldPersistTaps="always"
92
+ // showsVerticalScrollIndicator={false}
93
+ // extraScrollHeight={0}
94
+ // onContentSizeChange={() => {
95
+ // scrollViewRef.current?.scrollToEnd({ animated: true });
96
+ // }}
97
+ // >
98
+ // {messages.map((msg, i) => (
99
99
 
100
- <View key={i} style={styles.messageWrapper}>
101
- {msg.type !== "middle" && (
102
- <View style={[ styles.messageBubble, msg.type === "user" ? styles.userMessage : styles.aiMessage,]}>
103
- <Markdown style={{ body: { color: msg.type === "user" ? "#ffffff" : "#161616",fontSize: 16, lineHeight: 22 }}}>
104
- {msg.text}
105
- </Markdown>
106
- </View>
107
- )}
108
-
109
- {msg.products && msg.products.length > 0 &&
110
- msg.products.map((prod, index) => (
111
- <View key={index} style={styles.productCardWrapper}>
112
- <ProductCard prod={prod} />
113
- </View>
114
- ))}
115
-
116
- {msg.suggested_questions && Array.isArray(msg.questions) && msg.questions.map((question, index) => (
117
- <TouchableOpacity key={index} style={styles.suggestedQuestionButton}
118
- onPress={() => handleButtonClick(question)}>
119
- <Text style={styles.suggestedQuestionText}>{question}</Text>
120
- </TouchableOpacity>
121
- ))}
122
-
123
- {ghostMessage && i === messages.length - 1 && (
124
- <View style={styles.ghostMessageContainer}>
125
- <Animated.View style={[styles.ghostBar, styles.ghostBarShort, { opacity: fadeAnim }]} />
126
- <Animated.View style={[styles.ghostBar, styles.ghostBarLong, { opacity: fadeAnim }]} />
127
- <Animated.View style={[styles.ghostBar, styles.ghostBarMedium, { opacity: fadeAnim }]} />
128
- </View>
129
- )}
130
- </View>
131
- ))}
132
- </KeyboardAwareScrollView>
133
-
134
- <KeyboardAvoidingView
135
- behavior={Platform.OS === 'ios' ? 'padding' : undefined}
136
- keyboardVerticalOffset={Platform.OS === 'ios' ? 120 : 60}
137
- >
138
- <ChatInput/>
139
- </KeyboardAvoidingView>
140
- </Animated.View>
141
- </View>
142
- );
143
- };
144
-
145
- const styles = StyleSheet.create({
146
- overlay: {
147
- flex: 1,
148
- position: 'absolute',
149
- left: 0,
150
- right: 0,
151
- top: 0,
152
- bottom: 0,
153
- backgroundColor: 'rgba(0, 0, 0, 0.3)',
154
- justifyContent: 'flex-end',
155
- },
156
- outsideTouchable: {
157
- flex: 1, // Takes up the space above the chat, allows clicking to close
158
- },
159
- container: {
160
- flex: 1,
161
- backgroundColor: '#f6f6f6',
162
- position: 'absolute',
163
- zIndex: 1000,
164
- left: 0,
165
- right: 0,
166
- bottom: 0,
167
- top: 140,
168
- pointerEvents: 'box-none',
169
- borderTopWidth: 1,
170
- borderTopColor: '#DDD',
171
- borderTopLeftRadius: 16,
172
- borderTopRightRadius: 16,
173
- overflow: 'hidden',
174
- },
175
- headerContainer: {
176
- alignItems: "center",
177
- backgroundColor: "#f6f6f6",
178
- borderTopLeftRadius: 16,
179
- borderTopRightRadius: 16,
180
- },
181
- messagesContent: {
182
- padding: 16,
183
- justifyContent: 'flex-end',
184
- },
185
- messageWrapper: {
186
- marginBottom: 0,
187
- },
188
- messageBubble: {
189
- padding: 6,
190
- paddingHorizontal: 16,
191
- borderRadius: 12,
192
- marginBottom: 5
193
- },
194
- userMessage: {
195
- alignSelf: 'flex-end',
196
- backgroundColor: "#003764",
197
- color: "#ffffff"
198
- },
199
- aiMessage: {
200
- alignSelf: 'flex-start',
201
- backgroundColor: '#FFFFFF',
202
- width: '100%',
203
- },
204
- productCardWrapper: {
205
- marginTop: 5,
206
- },
207
- suggestedQuestionButton: {
208
- backgroundColor: "white",
209
- borderWidth: 1,
210
- borderColor: "#004687",
211
- borderRadius: 18,
212
- paddingVertical: 10,
213
- paddingHorizontal: 16,
214
- marginBottom: 7,
215
- alignSelf: "flex-start",
216
- },
217
- suggestedQuestionText: {
218
- color: "#004687",
219
- fontSize: 13,
220
- textAlign: "left",
221
- },
222
- ghostMessageContainer: {
223
- alignSelf: 'flex-start',
224
- width: '100%',
225
- backgroundColor: "#FFFFFF",
226
- borderRadius: 10,
227
- borderTopLeftRadius: 0,
228
- padding: 14,
229
- marginVertical: 5,
230
- },
231
- ghostBar: {
232
- height: 20,
233
- borderRadius: 10,
234
- backgroundColor: "#ebebeb",
235
- marginVertical: 3,
236
- },
237
- ghostBarShort: {
238
- width: "50%",
239
- },
240
- ghostBarMedium: {
241
- width: "75%",
242
- },
243
- ghostBarLong: {
244
- width: "100%",
245
- },
246
- });
247
-
248
- {/* <Testing
249
- onProductCardClick={onProductCardClick}
250
- onAddToCartClick={onAddToCartClick}
251
- /> */}
100
+ // <View key={i} style={styles.messageWrapper}>
101
+ // {msg.type !== "middle" && (
102
+ // <View style={[ styles.messageBubble, msg.type === "user" ? styles.userMessage : styles.aiMessage,]}>
103
+ // <Markdown style={{ body: { color: msg.type === "user" ? "#ffffff" : "#161616",fontSize: 16, lineHeight: 22 }}}>
104
+ // {msg.text}
105
+ // </Markdown>
106
+ // </View>
107
+ // )}
108
+
109
+ // {msg.products && msg.products.length > 0 &&
110
+ // msg.products.map((prod, index) => (
111
+ // <View key={index} style={styles.productCardWrapper}>
112
+ // <ProductCard prod={prod} />
113
+ // </View>
114
+ // ))}
115
+
116
+ // {msg.suggested_questions && Array.isArray(msg.questions) && msg.questions.map((question, index) => (
117
+ // <TouchableOpacity key={index} style={styles.suggestedQuestionButton}
118
+ // onPress={() => handleButtonClick(question)}>
119
+ // <Text style={styles.suggestedQuestionText}>{question}</Text>
120
+ // </TouchableOpacity>
121
+ // ))}
122
+
123
+ // {ghostMessage && i === messages.length - 1 && (
124
+ // <View style={styles.ghostMessageContainer}>
125
+ // <Animated.View style={[styles.ghostBar, styles.ghostBarShort, { opacity: fadeAnim }]} />
126
+ // <Animated.View style={[styles.ghostBar, styles.ghostBarLong, { opacity: fadeAnim }]} />
127
+ // <Animated.View style={[styles.ghostBar, styles.ghostBarMedium, { opacity: fadeAnim }]} />
128
+ // </View>
129
+ // )}
130
+ // </View>
131
+ // ))}
132
+
133
+ // <KeyboardAvoidingView
134
+ // behavior={Platform.OS === 'ios' ? 'padding' : undefined}
135
+ // keyboardVerticalOffset={Platform.OS === 'ios' ? 120 : 60}
136
+ // >
137
+ // <ChatInput/>
138
+ // </KeyboardAvoidingView>
139
+ // </KeyboardAwareScrollView>
140
+
141
+ // </Animated.View>
142
+ // </View>
143
+ // );
144
+ // };
145
+
146
+ // const styles = StyleSheet.create({
147
+ // overlay: {
148
+ // flex: 1,
149
+ // position: 'absolute',
150
+ // left: 0,
151
+ // right: 0,
152
+ // top: 0,
153
+ // bottom: 0,
154
+ // backgroundColor: 'rgba(0, 0, 0, 0.3)',
155
+ // justifyContent: 'flex-end',
156
+ // },
157
+ // outsideTouchable: {
158
+ // flex: 1, // Takes up the space above the chat, allows clicking to close
159
+ // },
160
+ // container: {
161
+ // flex: 1,
162
+ // backgroundColor: '#f6f6f6',
163
+ // position: 'absolute',
164
+ // zIndex: 1000,
165
+ // left: 0,
166
+ // right: 0,
167
+ // bottom: 0,
168
+ // top: 140,
169
+ // pointerEvents: 'box-none',
170
+ // borderTopWidth: 1,
171
+ // borderTopColor: '#DDD',
172
+ // borderTopLeftRadius: 16,
173
+ // borderTopRightRadius: 16,
174
+ // overflow: 'hidden',
175
+ // },
176
+ // headerContainer: {
177
+ // alignItems: "center",
178
+ // backgroundColor: "#f6f6f6",
179
+ // borderTopLeftRadius: 16,
180
+ // borderTopRightRadius: 16,
181
+ // },
182
+ // messagesContent: {
183
+ // padding: 16,
184
+ // justifyContent: 'flex-end',
185
+ // },
186
+ // messageWrapper: {
187
+ // marginBottom: 0,
188
+ // },
189
+ // messageBubble: {
190
+ // padding: 6,
191
+ // paddingHorizontal: 16,
192
+ // borderRadius: 12,
193
+ // marginBottom: 5
194
+ // },
195
+ // userMessage: {
196
+ // alignSelf: 'flex-end',
197
+ // backgroundColor: "#003764",
198
+ // color: "#ffffff"
199
+ // },
200
+ // aiMessage: {
201
+ // alignSelf: 'flex-start',
202
+ // backgroundColor: '#FFFFFF',
203
+ // width: '100%',
204
+ // },
205
+ // productCardWrapper: {
206
+ // marginTop: 5,
207
+ // },
208
+ // suggestedQuestionButton: {
209
+ // backgroundColor: "white",
210
+ // borderWidth: 1,
211
+ // borderColor: "#004687",
212
+ // borderRadius: 18,
213
+ // paddingVertical: 10,
214
+ // paddingHorizontal: 16,
215
+ // marginBottom: 7,
216
+ // alignSelf: "flex-start",
217
+ // },
218
+ // suggestedQuestionText: {
219
+ // color: "#004687",
220
+ // fontSize: 13,
221
+ // textAlign: "left",
222
+ // },
223
+ // ghostMessageContainer: {
224
+ // alignSelf: 'flex-start',
225
+ // width: '100%',
226
+ // backgroundColor: "#FFFFFF",
227
+ // borderRadius: 10,
228
+ // borderTopLeftRadius: 0,
229
+ // padding: 14,
230
+ // marginVertical: 5,
231
+ // },
232
+ // ghostBar: {
233
+ // height: 20,
234
+ // borderRadius: 10,
235
+ // backgroundColor: "#ebebeb",
236
+ // marginVertical: 3,
237
+ // },
238
+ // ghostBarShort: {
239
+ // width: "50%",
240
+ // },
241
+ // ghostBarMedium: {
242
+ // width: "75%",
243
+ // },
244
+ // ghostBarLong: {
245
+ // width: "100%",
246
+ // },
247
+ // });
248
+
249
+ // {/* <Testing
250
+ // onProductCardClick={onProductCardClick}
251
+ // onAddToCartClick={onAddToCartClick}
252
+ // /> */}
@@ -20,7 +20,8 @@ export const ChatIcon = () => {
20
20
  if (!disclaimer) {
21
21
  setShowModal("Form");
22
22
  } else {
23
- if (messages.length > 1 || maintenance) {
23
+ if ((messages.length > 1 || maintenance) && !uiConfig.showWelcome) {
24
+ // console.log("UI Config", uiConfig.showWelcome)
24
25
  setShowModal("ChatWindow");
25
26
  } else {
26
27
  setShowModal("Welcome");
@@ -8,7 +8,7 @@ import ButtonComponent from '../components/welcomeButton';
8
8
  import CloudinaryImage from '../utils/cloudinary';
9
9
 
10
10
  export const Welcome = ({ panHandlers }) => {
11
- const { setShowModal, uiConfig, onProductCardClick, onAddToCartClick } = useContext(AppContext);
11
+ const { setShowModal, uiConfig, onProductCardClick, onAddToCartClick, data } = useContext(AppContext);
12
12
 
13
13
  const handleClick = () => {
14
14
  if ((uiConfig.showIcon ?? true) !== true) {
@@ -41,18 +41,18 @@ export const Welcome = ({ panHandlers }) => {
41
41
  </View>
42
42
 
43
43
  <View style={styles.blueContainer}>
44
- <Text style={styles.welcomeHeader}>Hi 👋</Text>
44
+ <Text style={styles.welcomeHeader}>Hi {data?.customer_name || ""} 👋</Text>
45
45
  <Text style={styles.welcomeBody2}>
46
- I'm Poseidon, your Heritage Pool+ AI Agent. I can help you during your online visit with Product and Account information.
46
+ Im your Heritage Pool+ AI Agent. I can help you during your online visit with Product and Account information.
47
47
  </Text>
48
48
  <WelcomeInput />
49
- <Text style={styles.textBeta}>Beta version. Poseidon is learning!</Text>
49
+ <Text style={styles.textBeta}>Beta version. AI Assistant is still learning!</Text>
50
50
  </View>
51
51
  </View>
52
52
 
53
53
  {/* Bottom section */}
54
54
  <ScrollView style={styles.bottomContainer}>
55
- <Text style={styles.welcomeBody}>Suggested Capabilities...</Text>
55
+ <Text style={styles.welcomeBody}>Suggested Questions...</Text>
56
56
  <ButtonComponent />
57
57
  </ScrollView>
58
58
  </View>