@developer_tribe/react-native-comnyx 0.3.6 → 0.3.8

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 (111) hide show
  1. package/lib/commonjs/assets/arrow-right.png +0 -0
  2. package/lib/commonjs/assets/down.png +0 -0
  3. package/lib/commonjs/assets/info-circle.png +0 -0
  4. package/lib/commonjs/components/ChatList.js +129 -38
  5. package/lib/commonjs/components/ChatList.js.map +1 -1
  6. package/lib/commonjs/components/CustomAlert.js +15 -5
  7. package/lib/commonjs/components/CustomAlert.js.map +1 -1
  8. package/lib/commonjs/components/CustomerForm.js +12 -10
  9. package/lib/commonjs/components/CustomerForm.js.map +1 -1
  10. package/lib/commonjs/components/InitFailed.js +2 -0
  11. package/lib/commonjs/components/InitFailed.js.map +1 -1
  12. package/lib/commonjs/components/MessageInput.js +14 -14
  13. package/lib/commonjs/components/MessageInput.js.map +1 -1
  14. package/lib/commonjs/components/MessageItem.js +6 -14
  15. package/lib/commonjs/components/MessageItem.js.map +1 -1
  16. package/lib/commonjs/constants/activeOpacity.js +8 -0
  17. package/lib/commonjs/constants/activeOpacity.js.map +1 -0
  18. package/lib/commonjs/constants/translations.js +65 -45
  19. package/lib/commonjs/constants/translations.js.map +1 -1
  20. package/lib/commonjs/data/fake/messages.js +2 -0
  21. package/lib/commonjs/data/fake/messages.js.map +1 -1
  22. package/lib/commonjs/hooks/useThemeColors.js +1 -7
  23. package/lib/commonjs/hooks/useThemeColors.js.map +1 -1
  24. package/lib/commonjs/types/Theme.js +4 -2
  25. package/lib/commonjs/types/Theme.js.map +1 -1
  26. package/lib/commonjs/utils/date.js +8 -1
  27. package/lib/commonjs/utils/date.js.map +1 -1
  28. package/lib/module/assets/arrow-right.png +0 -0
  29. package/lib/module/assets/down.png +0 -0
  30. package/lib/module/assets/info-circle.png +0 -0
  31. package/lib/module/components/ChatList.js +130 -39
  32. package/lib/module/components/ChatList.js.map +1 -1
  33. package/lib/module/components/CustomAlert.js +15 -5
  34. package/lib/module/components/CustomAlert.js.map +1 -1
  35. package/lib/module/components/CustomerForm.js +12 -10
  36. package/lib/module/components/CustomerForm.js.map +1 -1
  37. package/lib/module/components/InitFailed.js +2 -0
  38. package/lib/module/components/InitFailed.js.map +1 -1
  39. package/lib/module/components/MessageInput.js +14 -14
  40. package/lib/module/components/MessageInput.js.map +1 -1
  41. package/lib/module/components/MessageItem.js +6 -14
  42. package/lib/module/components/MessageItem.js.map +1 -1
  43. package/lib/module/constants/activeOpacity.js +4 -0
  44. package/lib/module/constants/activeOpacity.js.map +1 -0
  45. package/lib/module/constants/translations.js +65 -45
  46. package/lib/module/constants/translations.js.map +1 -1
  47. package/lib/module/data/fake/messages.js +2 -0
  48. package/lib/module/data/fake/messages.js.map +1 -1
  49. package/lib/module/hooks/useThemeColors.js +2 -8
  50. package/lib/module/hooks/useThemeColors.js.map +1 -1
  51. package/lib/module/types/Theme.js +4 -2
  52. package/lib/module/types/Theme.js.map +1 -1
  53. package/lib/module/utils/date.js +8 -1
  54. package/lib/module/utils/date.js.map +1 -1
  55. package/lib/typescript/commonjs/src/components/ChatList.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/src/components/CustomAlert.d.ts.map +1 -1
  57. package/lib/typescript/commonjs/src/components/CustomerForm.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/src/components/InitFailed.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/src/components/MessageInput.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/src/constants/activeOpacity.d.ts +2 -0
  61. package/lib/typescript/commonjs/src/constants/activeOpacity.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/src/constants/translations.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/src/data/fake/messages.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/src/hooks/useThemeColors.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/src/types/Conversation.d.ts +6 -1
  66. package/lib/typescript/commonjs/src/types/Conversation.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/src/types/LocalizationKeys.d.ts +2 -0
  68. package/lib/typescript/commonjs/src/types/LocalizationKeys.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/src/types/MessageResponse.d.ts +2 -0
  70. package/lib/typescript/commonjs/src/types/MessageResponse.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/src/types/Theme.d.ts +1 -0
  72. package/lib/typescript/commonjs/src/types/Theme.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/src/utils/date.d.ts.map +1 -1
  74. package/lib/typescript/module/src/components/ChatList.d.ts.map +1 -1
  75. package/lib/typescript/module/src/components/CustomAlert.d.ts.map +1 -1
  76. package/lib/typescript/module/src/components/CustomerForm.d.ts.map +1 -1
  77. package/lib/typescript/module/src/components/InitFailed.d.ts.map +1 -1
  78. package/lib/typescript/module/src/components/MessageInput.d.ts.map +1 -1
  79. package/lib/typescript/module/src/constants/activeOpacity.d.ts +2 -0
  80. package/lib/typescript/module/src/constants/activeOpacity.d.ts.map +1 -0
  81. package/lib/typescript/module/src/constants/translations.d.ts.map +1 -1
  82. package/lib/typescript/module/src/data/fake/messages.d.ts.map +1 -1
  83. package/lib/typescript/module/src/hooks/useThemeColors.d.ts.map +1 -1
  84. package/lib/typescript/module/src/types/Conversation.d.ts +6 -1
  85. package/lib/typescript/module/src/types/Conversation.d.ts.map +1 -1
  86. package/lib/typescript/module/src/types/LocalizationKeys.d.ts +2 -0
  87. package/lib/typescript/module/src/types/LocalizationKeys.d.ts.map +1 -1
  88. package/lib/typescript/module/src/types/MessageResponse.d.ts +2 -0
  89. package/lib/typescript/module/src/types/MessageResponse.d.ts.map +1 -1
  90. package/lib/typescript/module/src/types/Theme.d.ts +1 -0
  91. package/lib/typescript/module/src/types/Theme.d.ts.map +1 -1
  92. package/lib/typescript/module/src/utils/date.d.ts.map +1 -1
  93. package/package.json +1 -1
  94. package/src/assets/arrow-right.png +0 -0
  95. package/src/assets/down.png +0 -0
  96. package/src/assets/info-circle.png +0 -0
  97. package/src/components/ChatList.tsx +156 -45
  98. package/src/components/CustomAlert.tsx +24 -6
  99. package/src/components/CustomerForm.tsx +12 -9
  100. package/src/components/InitFailed.tsx +2 -0
  101. package/src/components/MessageInput.tsx +15 -16
  102. package/src/components/MessageItem.tsx +4 -12
  103. package/src/constants/activeOpacity.ts +1 -0
  104. package/src/constants/translations.ts +70 -44
  105. package/src/data/fake/messages.ts +2 -0
  106. package/src/hooks/useThemeColors.ts +2 -7
  107. package/src/types/Conversation.ts +3 -1
  108. package/src/types/LocalizationKeys.ts +2 -0
  109. package/src/types/MessageResponse.ts +2 -0
  110. package/src/types/Theme.ts +3 -0
  111. package/src/utils/date.ts +9 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ChatList.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatList.tsx"],"names":[],"mappings":"AAsCA,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,2CAgf3D"}
1
+ {"version":3,"file":"ChatList.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatList.tsx"],"names":[],"mappings":"AAwCA,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,2CAylB3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"CustomAlert.d.ts","sourceRoot":"","sources":["../../../../../src/components/CustomAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,UAAU,gBAAgB;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,gBAAgB,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAID,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,EACX,cAAc,EACd,cAAc,EACd,UAAU,GACX,EAAE,gBAAgB,2CA4ClB;;AA4DD,wBAAuC"}
1
+ {"version":3,"file":"CustomAlert.d.ts","sourceRoot":"","sources":["../../../../../src/components/CustomAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAKlE,UAAU,gBAAgB;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,gBAAgB,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAID,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,EACX,cAAc,EACd,cAAc,EACd,UAAU,GACX,EAAE,gBAAgB,2CAuDlB;;AAiED,wBAAuC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CustomerForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/CustomerForm.tsx"],"names":[],"mappings":"AAkCA,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,2CAyQ9D"}
1
+ {"version":3,"file":"CustomerForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/CustomerForm.tsx"],"names":[],"mappings":"AAoCA,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,2CAyQ9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"InitFailed.d.ts","sourceRoot":"","sources":["../../../../../src/components/InitFailed.tsx"],"names":[],"mappings":"AAKA,UAAU,eAAe;IACvB,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAED,wBAAgB,UAAU,CAAC,EAAE,aAAa,EAAE,EAAE,eAAe,2CAkB5D"}
1
+ {"version":3,"file":"InitFailed.d.ts","sourceRoot":"","sources":["../../../../../src/components/InitFailed.tsx"],"names":[],"mappings":"AAMA,UAAU,eAAe;IACvB,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAED,wBAAgB,UAAU,CAAC,EAAE,aAAa,EAAE,EAAE,eAAe,2CAmB5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"MessageInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/MessageInput.tsx"],"names":[],"mappings":"AASA,wBAAgB,YAAY,CAAC,EAC3B,cAAc,GACf,EAAE;IACD,cAAc,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,2CA0HA"}
1
+ {"version":3,"file":"MessageInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/MessageInput.tsx"],"names":[],"mappings":"AAWA,wBAAgB,YAAY,CAAC,EAC3B,cAAc,GACf,EAAE;IACD,cAAc,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,2CAuHA"}
@@ -0,0 +1,2 @@
1
+ export declare const activeOpacity = 0.8;
2
+ //# sourceMappingURL=activeOpacity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activeOpacity.d.ts","sourceRoot":"","sources":["../../../../../src/constants/activeOpacity.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../../src/constants/translations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAuc1D,CAAC"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../../src/constants/translations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAie1D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../../src/data/fake/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CA6DvE"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../../src/data/fake/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CA+DvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeColors.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useThemeColors.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEzE,wBAAgB,cAAc,IAAI,WAAW,CAM5C"}
1
+ {"version":3,"file":"useThemeColors.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useThemeColors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE9D,wBAAgB,cAAc,IAAI,WAAW,CAE5C"}
@@ -2,7 +2,12 @@ export interface ConversationMessage {
2
2
  id: number;
3
3
  content: string;
4
4
  created_at: string;
5
- user: any | null;
5
+ user?: any | null;
6
+ bot?: any | null;
7
+ customer?: {
8
+ name: string;
9
+ profile_photo_url: null;
10
+ } | null;
6
11
  }
7
12
  export interface AppConversationMessage extends Omit<ConversationMessage, 'id' | 'created_at'> {
8
13
  id: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"Conversation.d.ts","sourceRoot":"","sources":["../../../../../src/types/Conversation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,YAAY,CAAC;IACtD,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,gBAAgB,CAAC;CACxB"}
1
+ {"version":3,"file":"Conversation.d.ts","sourceRoot":"","sources":["../../../../../src/types/Conversation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAClB,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IACjB,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;CAC7D;AAED,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,YAAY,CAAC;IACtD,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,gBAAgB,CAAC;CACxB"}
@@ -36,5 +36,7 @@ export type LocalizationKeys = {
36
36
  'customer.form.failed.email.desc': string;
37
37
  'customer.form.failed.phone': string;
38
38
  'customer.form.failed.phone.desc': string;
39
+ 'customer.form.name': string;
40
+ 'customer.form.cancel': string;
39
41
  };
40
42
  //# sourceMappingURL=LocalizationKeys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocalizationKeys.d.ts","sourceRoot":"","sources":["../../../../../src/types/LocalizationKeys.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,4BAA4B,EAAE,MAAM,CAAC;IACrC,6BAA6B,EAAE,MAAM,CAAC;IACtC,2BAA2B,EAAE,MAAM,CAAC;IACpC,2BAA2B,EAAE,MAAM,CAAC;IACpC,gCAAgC,EAAE,MAAM,CAAC;IACzC,mCAAmC,EAAE,MAAM,CAAC;IAC5C,iCAAiC,EAAE,MAAM,CAAC;IAC1C,iCAAiC,EAAE,MAAM,CAAC;IAC1C,wCAAwC,EAAE,MAAM,CAAC;IACjD,wCAAwC,EAAE,MAAM,CAAC;IACjD,4CAA4C,EAAE,MAAM,CAAC;IACrD,yCAAyC,EAAE,MAAM,CAAC;IAClD,+BAA+B,EAAE,MAAM,CAAC;IACxC,6BAA6B,EAAE,MAAM,CAAC;IACtC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,wBAAwB,EAAE,MAAM,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,gCAAgC,EAAE,MAAM,CAAC;IACzC,sCAAsC,EAAE,MAAM,CAAC;IAC/C,kBAAkB,EAAE,MAAM,CAAC;IAC3B,2BAA2B,EAAE,MAAM,CAAC;IACpC,gCAAgC,EAAE,MAAM,CAAC;IACzC,4BAA4B,EAAE,MAAM,CAAC;IACrC,iCAAiC,EAAE,MAAM,CAAC;IAC1C,4BAA4B,EAAE,MAAM,CAAC;IACrC,iCAAiC,EAAE,MAAM,CAAC;CAC3C,CAAC"}
1
+ {"version":3,"file":"LocalizationKeys.d.ts","sourceRoot":"","sources":["../../../../../src/types/LocalizationKeys.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,4BAA4B,EAAE,MAAM,CAAC;IACrC,6BAA6B,EAAE,MAAM,CAAC;IACtC,2BAA2B,EAAE,MAAM,CAAC;IACpC,2BAA2B,EAAE,MAAM,CAAC;IACpC,gCAAgC,EAAE,MAAM,CAAC;IACzC,mCAAmC,EAAE,MAAM,CAAC;IAC5C,iCAAiC,EAAE,MAAM,CAAC;IAC1C,iCAAiC,EAAE,MAAM,CAAC;IAC1C,wCAAwC,EAAE,MAAM,CAAC;IACjD,wCAAwC,EAAE,MAAM,CAAC;IACjD,4CAA4C,EAAE,MAAM,CAAC;IACrD,yCAAyC,EAAE,MAAM,CAAC;IAClD,+BAA+B,EAAE,MAAM,CAAC;IACxC,6BAA6B,EAAE,MAAM,CAAC;IACtC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,wBAAwB,EAAE,MAAM,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,gCAAgC,EAAE,MAAM,CAAC;IACzC,sCAAsC,EAAE,MAAM,CAAC;IAC/C,kBAAkB,EAAE,MAAM,CAAC;IAC3B,2BAA2B,EAAE,MAAM,CAAC;IACpC,gCAAgC,EAAE,MAAM,CAAC;IACzC,4BAA4B,EAAE,MAAM,CAAC;IACrC,iCAAiC,EAAE,MAAM,CAAC;IAC1C,4BAA4B,EAAE,MAAM,CAAC;IACrC,iCAAiC,EAAE,MAAM,CAAC;IAC1C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC"}
@@ -7,6 +7,8 @@ export interface MessageResponse {
7
7
  created_at: string;
8
8
  id: number;
9
9
  user: null | any;
10
+ customer: null | any;
11
+ bot: null | any;
10
12
  conversation: {
11
13
  id: number;
12
14
  project_id: number;
@@ -1 +1 @@
1
- {"version":3,"file":"MessageResponse.d.ts","sourceRoot":"","sources":["../../../../../src/types/MessageResponse.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE;QACP,eAAe,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,IAAI,GAAG,GAAG,CAAC;QACjB,YAAY,EAAE;YACZ,EAAE,EAAE,MAAM,CAAC;YACX,UAAU,EAAE,MAAM,CAAC;YACnB,WAAW,EAAE,MAAM,CAAC;YACpB,UAAU,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;YAC1B,QAAQ,EAAE,MAAM,CAAC;YACjB,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE;gBACP,EAAE,EAAE,MAAM,CAAC;gBACX,IAAI,EAAE,MAAM,CAAC;gBACb,eAAe,EAAE,MAAM,CAAC;gBACxB,UAAU,EAAE,MAAM,CAAC;gBACnB,UAAU,EAAE,MAAM,CAAC;gBACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;gBAC1B,IAAI,EAAE,MAAM,CAAC;gBACb,YAAY,EAAE;oBACZ,EAAE,EAAE,MAAM,CAAC;oBACX,IAAI,EAAE,MAAM,CAAC;oBACb,UAAU,EAAE,MAAM,CAAC;oBACnB,UAAU,EAAE,MAAM,CAAC;oBACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;oBAC1B,KAAK,EAAE,KAAK,CAAC;wBACX,EAAE,EAAE,MAAM,CAAC;wBACX,IAAI,EAAE,MAAM,CAAC;wBACb,KAAK,EAAE,MAAM,CAAC;wBACd,iBAAiB,EAAE,IAAI,GAAG,MAAM,CAAC;wBACjC,UAAU,EAAE,MAAM,CAAC;wBACnB,UAAU,EAAE,MAAM,CAAC;wBACnB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;wBACtB,iBAAiB,EAAE,IAAI,GAAG,MAAM,CAAC;wBACjC,yBAAyB,EAAE,IAAI,GAAG,MAAM,CAAC;wBACzC,MAAM,EAAE,OAAO,CAAC;wBAChB,iBAAiB,EAAE,MAAM,CAAC;wBAC1B,KAAK,EAAE;4BACL,eAAe,EAAE,MAAM,CAAC;4BACxB,OAAO,EAAE,MAAM,CAAC;4BAChB,IAAI,EAAE,MAAM,CAAC;4BACb,UAAU,EAAE,MAAM,CAAC;4BACnB,UAAU,EAAE,MAAM,CAAC;yBACpB,CAAC;qBACH,CAAC,CAAC;iBACJ,CAAC;aACH,CAAC;SACH,CAAC;QACF,MAAM,EAAE,GAAG,EAAE,CAAC;KACf,CAAC;CACH"}
1
+ {"version":3,"file":"MessageResponse.d.ts","sourceRoot":"","sources":["../../../../../src/types/MessageResponse.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE;QACP,eAAe,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,IAAI,GAAG,GAAG,CAAC;QACjB,QAAQ,EAAE,IAAI,GAAG,GAAG,CAAC;QACrB,GAAG,EAAE,IAAI,GAAG,GAAG,CAAC;QAChB,YAAY,EAAE;YACZ,EAAE,EAAE,MAAM,CAAC;YACX,UAAU,EAAE,MAAM,CAAC;YACnB,WAAW,EAAE,MAAM,CAAC;YACpB,UAAU,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;YAC1B,QAAQ,EAAE,MAAM,CAAC;YACjB,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE;gBACP,EAAE,EAAE,MAAM,CAAC;gBACX,IAAI,EAAE,MAAM,CAAC;gBACb,eAAe,EAAE,MAAM,CAAC;gBACxB,UAAU,EAAE,MAAM,CAAC;gBACnB,UAAU,EAAE,MAAM,CAAC;gBACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;gBAC1B,IAAI,EAAE,MAAM,CAAC;gBACb,YAAY,EAAE;oBACZ,EAAE,EAAE,MAAM,CAAC;oBACX,IAAI,EAAE,MAAM,CAAC;oBACb,UAAU,EAAE,MAAM,CAAC;oBACnB,UAAU,EAAE,MAAM,CAAC;oBACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;oBAC1B,KAAK,EAAE,KAAK,CAAC;wBACX,EAAE,EAAE,MAAM,CAAC;wBACX,IAAI,EAAE,MAAM,CAAC;wBACb,KAAK,EAAE,MAAM,CAAC;wBACd,iBAAiB,EAAE,IAAI,GAAG,MAAM,CAAC;wBACjC,UAAU,EAAE,MAAM,CAAC;wBACnB,UAAU,EAAE,MAAM,CAAC;wBACnB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;wBACtB,iBAAiB,EAAE,IAAI,GAAG,MAAM,CAAC;wBACjC,yBAAyB,EAAE,IAAI,GAAG,MAAM,CAAC;wBACzC,MAAM,EAAE,OAAO,CAAC;wBAChB,iBAAiB,EAAE,MAAM,CAAC;wBAC1B,KAAK,EAAE;4BACL,eAAe,EAAE,MAAM,CAAC;4BACxB,OAAO,EAAE,MAAM,CAAC;4BAChB,IAAI,EAAE,MAAM,CAAC;4BACb,UAAU,EAAE,MAAM,CAAC;4BACnB,UAAU,EAAE,MAAM,CAAC;yBACpB,CAAC;qBACH,CAAC,CAAC;iBACJ,CAAC;aACH,CAAC;SACH,CAAC;QACF,MAAM,EAAE,GAAG,EAAE,CAAC;KACf,CAAC;CACH"}
@@ -17,6 +17,7 @@ export interface ThemeColors {
17
17
  ghost: string;
18
18
  navy: string;
19
19
  lavender: string;
20
+ silver: string;
20
21
  }
21
22
  export declare const lightTheme: ThemeColors;
22
23
  export declare const darkTheme: ThemeColors;
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../../../src/types/Theme.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,UAAU,EAAE,WAmBxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,WAmBvB,CAAC;AAEF,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;CACnB"}
1
+ {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../../../src/types/Theme.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,UAAU,EAAE,WAoBxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,WAoBvB,CAAC;AAEF,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../../../src/utils/date.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,SACxB,IAAI,GAAG,SAAS,KACrB,MAAM,GAAG,SAGX,CAAC"}
1
+ {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../../../src/utils/date.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,SACxB,IAAI,GAAG,SAAS,KACrB,MAAM,GAAG,SAWX,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@developer_tribe/react-native-comnyx",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "React Native chat component with integrated support panel, enabling real-time customer communication and efficient agent workflow management.",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
Binary file
Binary file
Binary file
@@ -7,6 +7,7 @@ import {
7
7
  ActivityIndicator,
8
8
  Image,
9
9
  TouchableOpacity,
10
+ Keyboard,
10
11
  } from 'react-native';
11
12
  import { getCustomerConversation, sendCustomerMessage } from '../api';
12
13
  import type { AppConversationMessage } from '../types/Conversation';
@@ -21,6 +22,7 @@ import type { LocalizationKeys } from '../types/LocalizationKeys';
21
22
  import { ScaledSheet } from './ScaledSheet';
22
23
  import { formatDate } from '../utils/formatDate';
23
24
  import { viewabilityConfig } from '../viewabilityConfig';
25
+ import { activeOpacity } from '../constants/activeOpacity';
24
26
 
25
27
  const headphonesIcon = require('../assets/headphones-01.png');
26
28
  const closeIcon = require('../assets/x-close.png');
@@ -56,6 +58,7 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
56
58
  const [nexPageFailed, setNexPageFailed] = useState(false);
57
59
  const [initFailed, setInitFailed] = useState(false);
58
60
  const [isScrollingUp, setIsScrollingUp] = useState(false);
61
+ const [isKeyboardVisible, setIsKeyboardVisible] = useState(false);
59
62
  const listChangedRef = useRef(false);
60
63
  const [popupVisible, setPopupVisible] = useState(false);
61
64
  const [selectedMessage, setSelectedMessage] = useState<string>('');
@@ -64,10 +67,20 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
64
67
  const sections = useMemo(() => {
65
68
  if (!data || data.length === 0) return [];
66
69
 
70
+ const validData = data.map((message) => {
71
+ if (!message.created_at || !(message.created_at instanceof Date)) {
72
+ return {
73
+ ...message,
74
+ created_at: new Date(message.created_at || Date.now()),
75
+ };
76
+ }
77
+ return message;
78
+ });
79
+
67
80
  const messagesByDate: Record<string, AppConversationMessage[]> = {};
68
81
 
69
- data.forEach((message: AppConversationMessage) => {
70
- const dateKey = formatDate(message?.created_at);
82
+ validData.forEach((message: AppConversationMessage) => {
83
+ const dateKey = formatDate(message.created_at);
71
84
  if (!messagesByDate[dateKey]) {
72
85
  messagesByDate[dateKey] = [];
73
86
  }
@@ -75,11 +88,42 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
75
88
  messagesByDate[dateKey].push(message);
76
89
  });
77
90
 
91
+ // Check if there are any messages before accessing firstKey
92
+ const dateKeys = Object.keys(messagesByDate);
93
+ if (dateKeys.length === 0) return [];
94
+
78
95
  return Object.entries(messagesByDate).map(([title, messages]) => ({
79
96
  title,
80
- data: messages.sort(
81
- (a, b) => b.created_at.getTime() - a.created_at.getTime()
82
- ),
97
+ data: messages.sort((a, b) => {
98
+ try {
99
+ if (!a.created_at) {
100
+ return 0;
101
+ }
102
+ if (!b.created_at) {
103
+ return 0;
104
+ }
105
+
106
+ const dateA =
107
+ a.created_at instanceof Date
108
+ ? a.created_at
109
+ : new Date(a.created_at);
110
+ const dateB =
111
+ b.created_at instanceof Date
112
+ ? b.created_at
113
+ : new Date(b.created_at);
114
+
115
+ if (typeof dateA.getTime !== 'function') {
116
+ return 0;
117
+ }
118
+ if (typeof dateB.getTime !== 'function') {
119
+ return 0;
120
+ }
121
+
122
+ return dateB.getTime() - dateA.getTime();
123
+ } catch (error) {
124
+ return 0;
125
+ }
126
+ }),
83
127
  }));
84
128
  }, [data]);
85
129
 
@@ -126,7 +170,7 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
126
170
  ...existingMessage,
127
171
  id: res.message.id,
128
172
  content: res.message.content,
129
- user: res.message.user || existingMessage.user,
173
+ customer: res.message.customer || existingMessage.customer,
130
174
  approved: true,
131
175
  error: false,
132
176
  created_at: new Date(res.message.created_at),
@@ -190,24 +234,41 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
190
234
  .then((newData) => {
191
235
  listChangedRef.current = true;
192
236
  setData((prevData) => {
193
- //TODO: backend sorulablir
194
237
  const newMessages = newData?.page?.data ?? [];
195
- const existingIds = new Set(prevData?.map((msg) => msg.id));
196
- const uniqueNewMessages = newMessages.filter(
197
- (msg) => !existingIds.has(msg.id)
198
- );
199
-
200
- const processedMessages = uniqueNewMessages.map((u) => ({
201
- ...u,
202
- created_at: new Date(u.created_at),
203
- approved: true,
204
- }));
205
- if (processedMessages.length === 0) {
206
- nextPageStatus.current = 'empty';
207
- } else {
238
+ // Only filter if we have both previous data and new messages
239
+ if (prevData && prevData.length > 0 && newMessages.length > 0) {
240
+ const existingIds = new Set(prevData.map((msg) => msg.id));
241
+ const uniqueNewMessages = newMessages.filter(
242
+ (msg) => !existingIds.has(msg.id)
243
+ );
244
+
245
+ const processedMessages = uniqueNewMessages.map((u) => ({
246
+ ...u,
247
+ created_at: new Date(u.created_at),
248
+ approved: true,
249
+ }));
250
+
251
+ if (processedMessages.length === 0) {
252
+ nextPageStatus.current = 'empty';
253
+ return prevData; // Return existing data unchanged
254
+ } else {
255
+ nextPageStatus.current = undefined;
256
+ return [...prevData, ...processedMessages];
257
+ }
258
+ } else if (newMessages.length > 0) {
259
+ // Only new messages, no previous data
260
+ const processedMessages = newMessages.map((u) => ({
261
+ ...u,
262
+ created_at: new Date(u.created_at),
263
+ approved: true,
264
+ }));
208
265
  nextPageStatus.current = undefined;
266
+ return processedMessages;
267
+ } else {
268
+ // No new messages
269
+ nextPageStatus.current = 'empty';
270
+ return prevData || []; // Return existing data or empty array
209
271
  }
210
- return [...(prevData ?? []), ...processedMessages];
211
272
  });
212
273
  })
213
274
  .catch((_) => {
@@ -267,7 +328,7 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
267
328
  const contentHeight = event.nativeEvent.contentSize.height;
268
329
  const scrollViewHeight = event.nativeEvent.layoutMeasurement.height;
269
330
 
270
- setIsScrollingUp(currentScrollY > 100);
331
+ setIsScrollingUp(currentScrollY > 300);
271
332
 
272
333
  // Only proceed if we have sections and the list is scrolled enough
273
334
  if (sections && sections.length > 0 && currentScrollY > 0) {
@@ -347,22 +408,39 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
347
408
  .then((newData) => {
348
409
  setData((prevData) => {
349
410
  const newMessages = newData?.page?.data ?? [];
350
- const existingIds = new Set(prevData?.map((msg) => msg.id));
351
- const uniqueNewMessages = newMessages?.filter(
352
- (msg) => !existingIds?.has(msg.id)
353
- );
354
- const processedMessages = uniqueNewMessages?.map((u) => ({
355
- ...u,
356
- created_at: new Date(u.created_at),
357
- approved: true,
358
- }));
359
- useAppStore.setState({
360
- firstMessage: processedMessages?.[0],
361
- });
362
- if (processedMessages?.length === 0) {
363
- setLoading(false);
411
+ // Only proceed with filtering if we have previous data
412
+ if (prevData && prevData.length > 0) {
413
+ const existingIds = new Set(prevData.map((msg) => msg.id));
414
+ const uniqueNewMessages = newMessages.filter(
415
+ (msg) => !existingIds.has(msg.id)
416
+ );
417
+ const processedMessages = uniqueNewMessages.map((u) => ({
418
+ ...u,
419
+ created_at: new Date(u.created_at),
420
+ approved: true,
421
+ }));
422
+ useAppStore.setState({
423
+ firstMessage: processedMessages[0] || prevData[0],
424
+ });
425
+ if (processedMessages.length === 0) {
426
+ setLoading(false);
427
+ }
428
+ return [...prevData, ...processedMessages];
429
+ } else {
430
+ // Handle the case where there's no previous data
431
+ const processedMessages = newMessages.map((u) => ({
432
+ ...u,
433
+ created_at: new Date(u.created_at),
434
+ approved: true,
435
+ }));
436
+ useAppStore.setState({
437
+ firstMessage: processedMessages[0],
438
+ });
439
+ if (processedMessages.length === 0) {
440
+ setLoading(false);
441
+ }
442
+ return processedMessages;
364
443
  }
365
- return processedMessages;
366
444
  });
367
445
  })
368
446
  .catch((e) => {
@@ -382,6 +460,28 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
382
460
  }
383
461
  }, [sections]);
384
462
 
463
+ // Add keyboard listeners
464
+ useEffect(() => {
465
+ const keyboardDidShowListener = Keyboard.addListener(
466
+ 'keyboardDidShow',
467
+ () => {
468
+ setIsKeyboardVisible(true);
469
+ }
470
+ );
471
+ const keyboardDidHideListener = Keyboard.addListener(
472
+ 'keyboardDidHide',
473
+ () => {
474
+ setIsKeyboardVisible(false);
475
+ }
476
+ );
477
+
478
+ // Cleanup function
479
+ return () => {
480
+ keyboardDidShowListener.remove();
481
+ keyboardDidHideListener.remove();
482
+ };
483
+ }, []);
484
+
385
485
  if (nexPageFailed) {
386
486
  return (
387
487
  <View
@@ -397,6 +497,7 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
397
497
  nextPageStatus.current = undefined;
398
498
  nextPage();
399
499
  }}
500
+ activeOpacity={activeOpacity}
400
501
  >
401
502
  <AppText
402
503
  localization="chat.load.error"
@@ -415,7 +516,11 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
415
516
  <View
416
517
  style={[styles.container, { backgroundColor: themeColors.background }]}
417
518
  >
418
- <TouchableOpacity style={[styles.iconContainer]} onPress={onBack}>
519
+ <TouchableOpacity
520
+ style={[styles.iconContainer]}
521
+ onPress={onBack}
522
+ activeOpacity={activeOpacity}
523
+ >
419
524
  <Image
420
525
  source={closeIcon}
421
526
  style={[styles.closeIcon, { tintColor: themeColors.text }]}
@@ -500,9 +605,11 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
500
605
  </View>
501
606
  {isScrollingUp && (
502
607
  <TouchableOpacity
608
+ activeOpacity={activeOpacity}
503
609
  style={[
504
610
  styles.scrollDownButton,
505
- { backgroundColor: themeColors.background },
611
+ { backgroundColor: themeColors.ghost },
612
+ isKeyboardVisible && styles.scrollDownButtonWithKeyboard,
506
613
  ]}
507
614
  onPress={() => scrollToBottom(true)}
508
615
  >
@@ -556,11 +663,12 @@ const styles = ScaledSheet.create({
556
663
  },
557
664
  scrollDownButton: {
558
665
  position: 'absolute',
559
- right: '20@s',
666
+ right: 0,
560
667
  bottom: '15%',
561
- borderRadius: '25@s',
562
- paddingHorizontal: '10@s',
563
- paddingVertical: '10@vs',
668
+ borderTopLeftRadius: '4@s',
669
+ borderBottomLeftRadius: '4@s',
670
+ paddingHorizontal: '14@s',
671
+ paddingVertical: '14@vs',
564
672
  shadowColor: '#000',
565
673
  shadowOffset: {
566
674
  width: 0,
@@ -570,9 +678,12 @@ const styles = ScaledSheet.create({
570
678
  shadowRadius: 3.84,
571
679
  elevation: 5,
572
680
  },
681
+ scrollDownButtonWithKeyboard: {
682
+ bottom: '30%',
683
+ },
573
684
  scrollUpIcon: {
574
- width: '24@s',
575
- height: '24@vs',
685
+ width: '18@vs',
686
+ height: '18@vs',
576
687
  },
577
688
  retryContainer: {
578
689
  flex: 1,
@@ -4,6 +4,8 @@ import { useThemeColors } from '../hooks/useThemeColors';
4
4
  import { AppText } from './AppText';
5
5
  import type { LocalizationKeys } from '../types/LocalizationKeys';
6
6
  import { ScaledSheet } from './ScaledSheet';
7
+ import { activeOpacity } from '../constants/activeOpacity';
8
+ import { vs } from '../utils/scalingUtils';
7
9
 
8
10
  interface CustomPopupProps {
9
11
  isVisible: boolean;
@@ -34,13 +36,23 @@ function CustomPopup({
34
36
  <View
35
37
  style={[styles.popup, { backgroundColor: themeColors.background }]}
36
38
  >
37
- <Image source={infoIcon} height={64} width={64} />
38
- <AppText style={styles.title}>{title}</AppText>
39
- <AppText style={[styles.description, { color: themeColors.navy }]}>
40
- {description}
41
- </AppText>
39
+ <Image
40
+ source={infoIcon}
41
+ height={vs(53)}
42
+ width={vs(53)}
43
+ style={styles.image}
44
+ />
45
+ <AppText
46
+ style={styles.title}
47
+ localization={title as keyof LocalizationKeys}
48
+ />
49
+ <AppText
50
+ style={[styles.description, { color: themeColors.navy }]}
51
+ localization={description as keyof LocalizationKeys}
52
+ />
42
53
  {onResendButton && (
43
54
  <TouchableOpacity
55
+ activeOpacity={activeOpacity}
44
56
  style={[
45
57
  styles.buttonUp,
46
58
  { backgroundColor: themeColors.dark_background },
@@ -54,6 +66,7 @@ function CustomPopup({
54
66
  </TouchableOpacity>
55
67
  )}
56
68
  <TouchableOpacity
69
+ activeOpacity={activeOpacity}
57
70
  style={[
58
71
  styles.buttonDown,
59
72
  { borderColor: themeColors.dark_background },
@@ -83,7 +96,8 @@ const styles = ScaledSheet.create({
83
96
  borderRadius: '20@s',
84
97
  overflow: 'hidden',
85
98
  alignItems: 'center',
86
- paddingVertical: '20@vs',
99
+ paddingTop: '40@vs',
100
+ paddingBottom: '20@vs',
87
101
  },
88
102
  title: {
89
103
  marginVertical: '16@vs',
@@ -127,6 +141,10 @@ const styles = ScaledSheet.create({
127
141
  marginBottom: '12@vs',
128
142
  borderWidth: 1,
129
143
  },
144
+ image: {
145
+ width: '53@s',
146
+ height: '53@s',
147
+ },
130
148
  });
131
149
 
132
150
  export default React.memo(CustomPopup);
@@ -16,6 +16,8 @@ import { useThemeColors } from '../hooks/useThemeColors';
16
16
  import CustomPopup from './CustomAlert';
17
17
  import { useState } from 'react';
18
18
  import { ScaledSheet } from './ScaledSheet';
19
+ import type { LocalizationKeys } from '../types/LocalizationKeys';
20
+ import { activeOpacity } from '../constants/activeOpacity';
19
21
 
20
22
  interface CustomerFormData {
21
23
  name: string;
@@ -109,6 +111,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
109
111
  ]}
110
112
  >
111
113
  <TouchableOpacity
114
+ activeOpacity={activeOpacity}
112
115
  style={[
113
116
  styles.iconContainer,
114
117
  { backgroundColor: themeColors.dark_background },
@@ -144,7 +147,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
144
147
  },
145
148
  ]}
146
149
  >
147
- {localize('customer.form.title')}
150
+ {localize('customer.form.name')}
148
151
  </AppText>
149
152
  <Controller
150
153
  control={control}
@@ -158,7 +161,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
158
161
  <View
159
162
  style={[
160
163
  styles.inputContainer,
161
- { borderBottomColor: themeColors.gainsboro },
164
+ { borderBottomColor: themeColors.ghost },
162
165
  ]}
163
166
  >
164
167
  <TextInput
@@ -200,7 +203,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
200
203
  <View
201
204
  style={[
202
205
  styles.inputContainer,
203
- { borderBottomColor: themeColors.gainsboro },
206
+ { borderBottomColor: themeColors.ghost },
204
207
  ]}
205
208
  >
206
209
  <TextInput
@@ -246,7 +249,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
246
249
  <View
247
250
  style={[
248
251
  styles.inputContainer,
249
- { borderBottomColor: themeColors.gainsboro },
252
+ { borderBottomColor: themeColors.ghost },
250
253
  ]}
251
254
  >
252
255
  <TextInput
@@ -269,6 +272,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
269
272
  />
270
273
  </View>
271
274
  <TouchableOpacity
275
+ activeOpacity={activeOpacity}
272
276
  style={[
273
277
  styles.button,
274
278
  { backgroundColor: themeColors.dark_background },
@@ -291,9 +295,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
291
295
  setPopupVisible(false);
292
296
  setPopupContent({ title: '', description: '' });
293
297
  }}
294
- onResendButton={() => {
295
- setPopupVisible(false);
296
- }}
298
+ buttonText={'customer.form.cancel' as keyof LocalizationKeys}
297
299
  />
298
300
  </Pressable>
299
301
  );
@@ -301,7 +303,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
301
303
 
302
304
  const styles = ScaledSheet.create({
303
305
  container: {
304
- paddingBottom: '24@vs',
306
+ paddingBottom: '20@vs',
305
307
  flex: 1,
306
308
  justifyContent: 'space-between',
307
309
  },
@@ -359,10 +361,11 @@ const styles = ScaledSheet.create({
359
361
  },
360
362
  title: {
361
363
  fontSize: '16@vs',
364
+ fontWeight: '500',
362
365
  },
363
366
  iconContainer: {
364
367
  paddingHorizontal: '20@s',
365
- paddingVertical: '10@vs',
368
+ paddingVertical: '30@vs',
366
369
  },
367
370
  inputContainer: {
368
371
  flexDirection: 'row',
@@ -2,6 +2,7 @@ import { TouchableOpacity, View } from 'react-native';
2
2
  import { useThemeColors } from '../hooks/useThemeColors';
3
3
  import { AppText } from './AppText';
4
4
  import { ScaledSheet } from './ScaledSheet';
5
+ import { activeOpacity } from '../constants/activeOpacity';
5
6
 
6
7
  interface InitFailedProps {
7
8
  setInitFailed: (value: boolean) => void;
@@ -15,6 +16,7 @@ export function InitFailed({ setInitFailed }: InitFailedProps) {
15
16
  style={[styles.container, { backgroundColor: themeColors.background }]}
16
17
  >
17
18
  <TouchableOpacity
19
+ activeOpacity={activeOpacity}
18
20
  style={[styles.retryButton, { backgroundColor: themeColors.primary }]}
19
21
  onPress={() => setInitFailed(false)}
20
22
  >