@developer_tribe/react-native-comnyx 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/App.js +59 -0
- package/lib/commonjs/App.js.map +1 -0
- package/lib/commonjs/__dev__.js +29 -0
- package/lib/commonjs/__dev__.js.map +1 -0
- package/lib/commonjs/api/api.js +22 -0
- package/lib/commonjs/api/api.js.map +1 -0
- package/lib/commonjs/api/conversations.js +37 -0
- package/lib/commonjs/api/conversations.js.map +1 -0
- package/lib/commonjs/api/customers.js +15 -0
- package/lib/commonjs/api/customers.js.map +1 -0
- package/lib/commonjs/api/index.js +33 -0
- package/lib/commonjs/api/index.js.map +1 -0
- package/lib/commonjs/api/messages.js +27 -0
- package/lib/commonjs/api/messages.js.map +1 -0
- package/lib/commonjs/assets/clock.png +0 -0
- package/lib/commonjs/assets/double-check.png +0 -0
- package/lib/commonjs/assets/down.png +0 -0
- package/lib/commonjs/assets/send.png +0 -0
- package/lib/commonjs/components/AppText.js +38 -0
- package/lib/commonjs/components/AppText.js.map +1 -0
- package/lib/commonjs/components/ChatList.js +268 -0
- package/lib/commonjs/components/ChatList.js.map +1 -0
- package/lib/commonjs/components/CustomerForm.js +279 -0
- package/lib/commonjs/components/CustomerForm.js.map +1 -0
- package/lib/commonjs/components/EmptyList.js +40 -0
- package/lib/commonjs/components/EmptyList.js.map +1 -0
- package/lib/commonjs/components/InitFailed.js +51 -0
- package/lib/commonjs/components/InitFailed.js.map +1 -0
- package/lib/commonjs/components/MessageInput.js +119 -0
- package/lib/commonjs/components/MessageInput.js.map +1 -0
- package/lib/commonjs/components/MessageItem.js +117 -0
- package/lib/commonjs/components/MessageItem.js.map +1 -0
- package/lib/commonjs/constants/countries.js +587 -0
- package/lib/commonjs/constants/countries.js.map +1 -0
- package/lib/commonjs/constants/translations.js +219 -0
- package/lib/commonjs/constants/translations.js.map +1 -0
- package/lib/commonjs/data/fake/conversations.js +95 -0
- package/lib/commonjs/data/fake/conversations.js.map +1 -0
- package/lib/commonjs/data/fake/customers.js +24 -0
- package/lib/commonjs/data/fake/customers.js.map +1 -0
- package/lib/commonjs/data/fake/messages.js +67 -0
- package/lib/commonjs/data/fake/messages.js.map +1 -0
- package/lib/commonjs/hooks/useLocalize.js +20 -0
- package/lib/commonjs/hooks/useLocalize.js.map +1 -0
- package/lib/commonjs/hooks/usePolling.js +50 -0
- package/lib/commonjs/hooks/usePolling.js.map +1 -0
- package/lib/commonjs/hooks/useThemeColors.js +17 -0
- package/lib/commonjs/hooks/useThemeColors.js.map +1 -0
- package/lib/commonjs/index.js +15 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/register.js +21 -0
- package/lib/commonjs/register.js.map +1 -0
- package/lib/commonjs/store.js +79 -0
- package/lib/commonjs/store.js.map +1 -0
- package/lib/commonjs/types/ApiOptions.js +2 -0
- package/lib/commonjs/types/ApiOptions.js.map +1 -0
- package/lib/commonjs/types/Conversation.js +2 -0
- package/lib/commonjs/types/Conversation.js.map +1 -0
- package/lib/commonjs/types/Customer.js +2 -0
- package/lib/commonjs/types/Customer.js.map +1 -0
- package/lib/commonjs/types/Language.js +2 -0
- package/lib/commonjs/types/Language.js.map +1 -0
- package/lib/commonjs/types/LocalizationKeys.js +2 -0
- package/lib/commonjs/types/LocalizationKeys.js.map +1 -0
- package/lib/commonjs/types/MessageResponse.js +2 -0
- package/lib/commonjs/types/MessageResponse.js.map +1 -0
- package/lib/commonjs/types/Theme.js +29 -0
- package/lib/commonjs/types/Theme.js.map +1 -0
- package/lib/commonjs/utils/date.js +17 -0
- package/lib/commonjs/utils/date.js.map +1 -0
- package/lib/module/App.js +55 -0
- package/lib/module/App.js.map +1 -0
- package/lib/module/__dev__.js +29 -0
- package/lib/module/__dev__.js.map +1 -0
- package/lib/module/api/api.js +17 -0
- package/lib/module/api/api.js.map +1 -0
- package/lib/module/api/conversations.js +32 -0
- package/lib/module/api/conversations.js.map +1 -0
- package/lib/module/api/customers.js +11 -0
- package/lib/module/api/customers.js.map +1 -0
- package/lib/module/api/index.js +6 -0
- package/lib/module/api/index.js.map +1 -0
- package/lib/module/api/messages.js +23 -0
- package/lib/module/api/messages.js.map +1 -0
- package/lib/module/assets/clock.png +0 -0
- package/lib/module/assets/double-check.png +0 -0
- package/lib/module/assets/down.png +0 -0
- package/lib/module/assets/send.png +0 -0
- package/lib/module/components/AppText.js +34 -0
- package/lib/module/components/AppText.js.map +1 -0
- package/lib/module/components/ChatList.js +265 -0
- package/lib/module/components/ChatList.js.map +1 -0
- package/lib/module/components/CustomerForm.js +275 -0
- package/lib/module/components/CustomerForm.js.map +1 -0
- package/lib/module/components/EmptyList.js +36 -0
- package/lib/module/components/EmptyList.js.map +1 -0
- package/lib/module/components/InitFailed.js +47 -0
- package/lib/module/components/InitFailed.js.map +1 -0
- package/lib/module/components/MessageInput.js +115 -0
- package/lib/module/components/MessageInput.js.map +1 -0
- package/lib/module/components/MessageItem.js +114 -0
- package/lib/module/components/MessageItem.js.map +1 -0
- package/lib/module/constants/countries.js +583 -0
- package/lib/module/constants/countries.js.map +1 -0
- package/lib/module/constants/translations.js +215 -0
- package/lib/module/constants/translations.js.map +1 -0
- package/lib/module/data/fake/conversations.js +88 -0
- package/lib/module/data/fake/conversations.js.map +1 -0
- package/lib/module/data/fake/customers.js +20 -0
- package/lib/module/data/fake/customers.js.map +1 -0
- package/lib/module/data/fake/messages.js +63 -0
- package/lib/module/data/fake/messages.js.map +1 -0
- package/lib/module/hooks/useLocalize.js +16 -0
- package/lib/module/hooks/useLocalize.js.map +1 -0
- package/lib/module/hooks/usePolling.js +46 -0
- package/lib/module/hooks/usePolling.js.map +1 -0
- package/lib/module/hooks/useThemeColors.js +13 -0
- package/lib/module/hooks/useThemeColors.js.map +1 -0
- package/lib/module/index.js +3 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/register.js +17 -0
- package/lib/module/register.js.map +1 -0
- package/lib/module/store.js +74 -0
- package/lib/module/store.js.map +1 -0
- package/lib/module/types/ApiOptions.js +2 -0
- package/lib/module/types/ApiOptions.js.map +1 -0
- package/lib/module/types/Conversation.js +2 -0
- package/lib/module/types/Conversation.js.map +1 -0
- package/lib/module/types/Customer.js +2 -0
- package/lib/module/types/Customer.js.map +1 -0
- package/lib/module/types/Language.js +2 -0
- package/lib/module/types/Language.js.map +1 -0
- package/lib/module/types/LocalizationKeys.js +2 -0
- package/lib/module/types/LocalizationKeys.js.map +1 -0
- package/lib/module/types/MessageResponse.js +2 -0
- package/lib/module/types/MessageResponse.js.map +1 -0
- package/lib/module/types/Theme.js +25 -0
- package/lib/module/types/Theme.js.map +1 -0
- package/lib/module/utils/date.js +12 -0
- package/lib/module/utils/date.js.map +1 -0
- package/lib/typescript/commonjs/src/App.d.ts +9 -0
- package/lib/typescript/commonjs/src/App.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/__dev__.d.ts +2 -0
- package/lib/typescript/commonjs/src/__dev__.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/api/api.d.ts +4 -0
- package/lib/typescript/commonjs/src/api/api.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/api/conversations.d.ts +7 -0
- package/lib/typescript/commonjs/src/api/conversations.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/api/customers.d.ts +4 -0
- package/lib/typescript/commonjs/src/api/customers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/api/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/api/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/api/messages.d.ts +4 -0
- package/lib/typescript/commonjs/src/api/messages.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/AppText.d.ts +10 -0
- package/lib/typescript/commonjs/src/components/AppText.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/ChatList.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/ChatList.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/CustomerForm.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/CustomerForm.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/EmptyList.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/EmptyList.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/InitFailed.d.ts +6 -0
- package/lib/typescript/commonjs/src/components/InitFailed.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/MessageInput.d.ts +4 -0
- package/lib/typescript/commonjs/src/components/MessageInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/MessageItem.d.ts +5 -0
- package/lib/typescript/commonjs/src/components/MessageItem.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/constants/countries.d.ts +6 -0
- package/lib/typescript/commonjs/src/constants/countries.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/constants/translations.d.ts +4 -0
- package/lib/typescript/commonjs/src/constants/translations.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/data/fake/conversations.d.ts +5 -0
- package/lib/typescript/commonjs/src/data/fake/conversations.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/data/fake/customers.d.ts +3 -0
- package/lib/typescript/commonjs/src/data/fake/customers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/data/fake/messages.d.ts +3 -0
- package/lib/typescript/commonjs/src/data/fake/messages.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useLocalize.d.ts +3 -0
- package/lib/typescript/commonjs/src/hooks/useLocalize.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/usePolling.d.ts +2 -0
- package/lib/typescript/commonjs/src/hooks/usePolling.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useThemeColors.d.ts +3 -0
- package/lib/typescript/commonjs/src/hooks/useThemeColors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +4 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/register.d.ts +5 -0
- package/lib/typescript/commonjs/src/register.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/store.d.ts +35 -0
- package/lib/typescript/commonjs/src/store.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/ApiOptions.d.ts +4 -0
- package/lib/typescript/commonjs/src/types/ApiOptions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/Conversation.d.ts +26 -0
- package/lib/typescript/commonjs/src/types/Conversation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/Customer.d.ts +30 -0
- package/lib/typescript/commonjs/src/types/Customer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/Language.d.ts +2 -0
- package/lib/typescript/commonjs/src/types/Language.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/LocalizationKeys.d.ts +22 -0
- package/lib/typescript/commonjs/src/types/LocalizationKeys.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/MessageResponse.d.ts +59 -0
- package/lib/typescript/commonjs/src/types/MessageResponse.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/Theme.d.ts +18 -0
- package/lib/typescript/commonjs/src/types/Theme.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/date.d.ts +7 -0
- package/lib/typescript/commonjs/src/utils/date.d.ts.map +1 -0
- package/lib/typescript/module/src/App.d.ts +9 -0
- package/lib/typescript/module/src/App.d.ts.map +1 -0
- package/lib/typescript/module/src/__dev__.d.ts +2 -0
- package/lib/typescript/module/src/__dev__.d.ts.map +1 -0
- package/lib/typescript/module/src/api/api.d.ts +4 -0
- package/lib/typescript/module/src/api/api.d.ts.map +1 -0
- package/lib/typescript/module/src/api/conversations.d.ts +7 -0
- package/lib/typescript/module/src/api/conversations.d.ts.map +1 -0
- package/lib/typescript/module/src/api/customers.d.ts +4 -0
- package/lib/typescript/module/src/api/customers.d.ts.map +1 -0
- package/lib/typescript/module/src/api/index.d.ts +4 -0
- package/lib/typescript/module/src/api/index.d.ts.map +1 -0
- package/lib/typescript/module/src/api/messages.d.ts +4 -0
- package/lib/typescript/module/src/api/messages.d.ts.map +1 -0
- package/lib/typescript/module/src/components/AppText.d.ts +10 -0
- package/lib/typescript/module/src/components/AppText.d.ts.map +1 -0
- package/lib/typescript/module/src/components/ChatList.d.ts +2 -0
- package/lib/typescript/module/src/components/ChatList.d.ts.map +1 -0
- package/lib/typescript/module/src/components/CustomerForm.d.ts +2 -0
- package/lib/typescript/module/src/components/CustomerForm.d.ts.map +1 -0
- package/lib/typescript/module/src/components/EmptyList.d.ts +2 -0
- package/lib/typescript/module/src/components/EmptyList.d.ts.map +1 -0
- package/lib/typescript/module/src/components/InitFailed.d.ts +6 -0
- package/lib/typescript/module/src/components/InitFailed.d.ts.map +1 -0
- package/lib/typescript/module/src/components/MessageInput.d.ts +4 -0
- package/lib/typescript/module/src/components/MessageInput.d.ts.map +1 -0
- package/lib/typescript/module/src/components/MessageItem.d.ts +5 -0
- package/lib/typescript/module/src/components/MessageItem.d.ts.map +1 -0
- package/lib/typescript/module/src/constants/countries.d.ts +6 -0
- package/lib/typescript/module/src/constants/countries.d.ts.map +1 -0
- package/lib/typescript/module/src/constants/translations.d.ts +4 -0
- package/lib/typescript/module/src/constants/translations.d.ts.map +1 -0
- package/lib/typescript/module/src/data/fake/conversations.d.ts +5 -0
- package/lib/typescript/module/src/data/fake/conversations.d.ts.map +1 -0
- package/lib/typescript/module/src/data/fake/customers.d.ts +3 -0
- package/lib/typescript/module/src/data/fake/customers.d.ts.map +1 -0
- package/lib/typescript/module/src/data/fake/messages.d.ts +3 -0
- package/lib/typescript/module/src/data/fake/messages.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useLocalize.d.ts +3 -0
- package/lib/typescript/module/src/hooks/useLocalize.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/usePolling.d.ts +2 -0
- package/lib/typescript/module/src/hooks/usePolling.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useThemeColors.d.ts +3 -0
- package/lib/typescript/module/src/hooks/useThemeColors.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +4 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/register.d.ts +5 -0
- package/lib/typescript/module/src/register.d.ts.map +1 -0
- package/lib/typescript/module/src/store.d.ts +35 -0
- package/lib/typescript/module/src/store.d.ts.map +1 -0
- package/lib/typescript/module/src/types/ApiOptions.d.ts +4 -0
- package/lib/typescript/module/src/types/ApiOptions.d.ts.map +1 -0
- package/lib/typescript/module/src/types/Conversation.d.ts +26 -0
- package/lib/typescript/module/src/types/Conversation.d.ts.map +1 -0
- package/lib/typescript/module/src/types/Customer.d.ts +30 -0
- package/lib/typescript/module/src/types/Customer.d.ts.map +1 -0
- package/lib/typescript/module/src/types/Language.d.ts +2 -0
- package/lib/typescript/module/src/types/Language.d.ts.map +1 -0
- package/lib/typescript/module/src/types/LocalizationKeys.d.ts +22 -0
- package/lib/typescript/module/src/types/LocalizationKeys.d.ts.map +1 -0
- package/lib/typescript/module/src/types/MessageResponse.d.ts +59 -0
- package/lib/typescript/module/src/types/MessageResponse.d.ts.map +1 -0
- package/lib/typescript/module/src/types/Theme.d.ts +18 -0
- package/lib/typescript/module/src/types/Theme.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/date.d.ts +7 -0
- package/lib/typescript/module/src/utils/date.d.ts.map +1 -0
- package/package.json +10 -2
- package/src/App.tsx +59 -0
- package/src/__dev__.ts +22 -0
- package/src/api/api.ts +16 -0
- package/src/api/conversations.ts +53 -0
- package/src/api/customers.ts +16 -0
- package/src/api/index.ts +6 -0
- package/src/api/messages.ts +33 -0
- package/src/assets/clock.png +0 -0
- package/src/assets/double-check.png +0 -0
- package/src/assets/down.png +0 -0
- package/src/assets/send.png +0 -0
- package/src/components/AppText.tsx +43 -0
- package/src/components/ChatList.tsx +299 -0
- package/src/components/CustomerForm.tsx +300 -0
- package/src/components/EmptyList.tsx +32 -0
- package/src/components/InitFailed.tsx +46 -0
- package/src/components/MessageInput.tsx +133 -0
- package/src/components/MessageItem.tsx +141 -0
- package/src/constants/countries.ts +200 -0
- package/src/constants/translations.ts +232 -0
- package/src/data/fake/conversations.ts +558 -0
- package/src/data/fake/customers.ts +19 -0
- package/src/data/fake/messages.ts +64 -0
- package/src/hooks/useLocalize.ts +18 -0
- package/src/hooks/usePolling.ts +46 -0
- package/src/hooks/useThemeColors.ts +10 -0
- package/src/index.tsx +4 -5
- package/src/register.ts +17 -0
- package/src/store.ts +85 -0
- package/src/types/ApiOptions.ts +4 -0
- package/src/types/Conversation.ts +29 -0
- package/src/types/Customer.ts +31 -0
- package/src/types/Language.ts +11 -0
- package/src/types/LocalizationKeys.ts +21 -0
- package/src/types/MessageResponse.ts +58 -0
- package/src/types/Theme.ts +40 -0
- package/src/utils/date.ts +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@developer_tribe/react-native-comnyx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
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",
|
|
@@ -65,11 +65,13 @@
|
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@commitlint/config-conventional": "^19.6.0",
|
|
67
67
|
"@evilmartians/lefthook": "^1.5.0",
|
|
68
|
+
"@react-native-async-storage/async-storage": "^2.1.2",
|
|
68
69
|
"@react-native-community/cli": "15.0.1",
|
|
69
70
|
"@react-native/eslint-config": "^0.73.1",
|
|
70
71
|
"@release-it/conventional-changelog": "^9.0.2",
|
|
71
72
|
"@types/jest": "^29.5.5",
|
|
72
73
|
"@types/react": "^18.2.44",
|
|
74
|
+
"axios": "1.7.9",
|
|
73
75
|
"commitlint": "^19.6.1",
|
|
74
76
|
"del-cli": "^5.1.0",
|
|
75
77
|
"eslint": "^8.51.0",
|
|
@@ -82,12 +84,15 @@
|
|
|
82
84
|
"react-native-builder-bob": "^0.38.3",
|
|
83
85
|
"release-it": "^17.10.0",
|
|
84
86
|
"turbo": "^1.10.7",
|
|
85
|
-
"typescript": "
|
|
87
|
+
"typescript": "5.1.6",
|
|
88
|
+
"use-sync-external-store": "^1.5.0",
|
|
89
|
+
"zustand": "^5.0.3"
|
|
86
90
|
},
|
|
87
91
|
"resolutions": {
|
|
88
92
|
"@types/react": "^18.2.44"
|
|
89
93
|
},
|
|
90
94
|
"peerDependencies": {
|
|
95
|
+
"@react-native-async-storage/async-storage": ">=2.0.0",
|
|
91
96
|
"react": "*",
|
|
92
97
|
"react-native": "*"
|
|
93
98
|
},
|
|
@@ -199,5 +204,8 @@
|
|
|
199
204
|
},
|
|
200
205
|
"engines": {
|
|
201
206
|
"node": ">=22.0.0"
|
|
207
|
+
},
|
|
208
|
+
"dependencies": {
|
|
209
|
+
"react-hook-form": "^7.55.0"
|
|
202
210
|
}
|
|
203
211
|
}
|
package/src/App.tsx
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { View, StyleSheet } from 'react-native';
|
|
2
|
+
import { useAppStore } from './store';
|
|
3
|
+
import { ChatList } from './components/ChatList';
|
|
4
|
+
import { CustomerForm } from './components/CustomerForm';
|
|
5
|
+
import type { LanguageCode } from './types/Language';
|
|
6
|
+
import { useEffect } from 'react';
|
|
7
|
+
import { AppText } from './components/AppText';
|
|
8
|
+
import { useThemeColors } from './hooks/useThemeColors';
|
|
9
|
+
import { usePolling } from './hooks/usePolling';
|
|
10
|
+
|
|
11
|
+
interface ComnyxProps {
|
|
12
|
+
language?: LanguageCode;
|
|
13
|
+
theme?: 'light' | 'dark';
|
|
14
|
+
fake?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function Comnyx({
|
|
18
|
+
language = 'en',
|
|
19
|
+
theme = 'dark',
|
|
20
|
+
fake = false,
|
|
21
|
+
}: ComnyxProps) {
|
|
22
|
+
const { initialized, customer } = useAppStore((s) => ({
|
|
23
|
+
initialized: s.initialized,
|
|
24
|
+
customer: s.customer,
|
|
25
|
+
}));
|
|
26
|
+
const themeColors = useThemeColors();
|
|
27
|
+
usePolling();
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
useAppStore.getState().setLanguage(language);
|
|
30
|
+
useAppStore.getState().setTheme(theme);
|
|
31
|
+
useAppStore.getState().setFake(fake);
|
|
32
|
+
}, [language, theme, fake]);
|
|
33
|
+
|
|
34
|
+
if (!initialized) {
|
|
35
|
+
return (
|
|
36
|
+
<View
|
|
37
|
+
style={[styles.container, { backgroundColor: themeColors.background }]}
|
|
38
|
+
>
|
|
39
|
+
<AppText localization="app.initialization.required" />
|
|
40
|
+
</View>
|
|
41
|
+
);
|
|
42
|
+
} else if (!customer) {
|
|
43
|
+
return <CustomerForm />;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<View
|
|
48
|
+
style={[styles.container, { backgroundColor: themeColors.background }]}
|
|
49
|
+
>
|
|
50
|
+
<ChatList />
|
|
51
|
+
</View>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const styles = StyleSheet.create({
|
|
56
|
+
container: {
|
|
57
|
+
flex: 1,
|
|
58
|
+
},
|
|
59
|
+
});
|
package/src/__dev__.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useAppStore } from './store';
|
|
2
|
+
import type { LanguageCode } from './types/Language';
|
|
3
|
+
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
global.clearStorage = async () => {
|
|
6
|
+
useAppStore.setState({ data: null });
|
|
7
|
+
console.info('Storage cleared');
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
global.changeLanguage = (language: string) => {
|
|
12
|
+
useAppStore.setState({ language: language as LanguageCode });
|
|
13
|
+
console.info(`Language changed to: ${language}`);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
global.toggleTheme = () => {
|
|
18
|
+
const currentTheme = useAppStore.getState().theme;
|
|
19
|
+
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
|
20
|
+
useAppStore.setState({ theme: newTheme });
|
|
21
|
+
console.info(`Theme changed to: ${newTheme}`);
|
|
22
|
+
};
|
package/src/api/api.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
const axiosInstance = axios.create({
|
|
3
|
+
//baseURL: 'https://api.comnyx.com',
|
|
4
|
+
baseURL: 'https://stage.comnyx.com',
|
|
5
|
+
headers: {
|
|
6
|
+
'Content-Type': 'application/json',
|
|
7
|
+
},
|
|
8
|
+
timeout: 1000,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export function initApi(token: string) {
|
|
12
|
+
axiosInstance.defaults.headers.common['Content-Type'] = 'application/json';
|
|
13
|
+
axiosInstance.defaults.headers.common.Authorization = 'Bearer ' + token;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { axiosInstance };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ConversationResponse } from '../types/Conversation';
|
|
2
|
+
import type { ApiOptions } from '../types/ApiOptions';
|
|
3
|
+
import {
|
|
4
|
+
getFakeConversationResponse,
|
|
5
|
+
getFakePaginatedConversationResponse,
|
|
6
|
+
} from '../data/fake/conversations';
|
|
7
|
+
import { axiosInstance } from './api';
|
|
8
|
+
import { dateToUnixTimestamp } from '../utils/date';
|
|
9
|
+
|
|
10
|
+
const PER_PAGE = 25;
|
|
11
|
+
|
|
12
|
+
export function getCustomerConversation(
|
|
13
|
+
externalId: string,
|
|
14
|
+
created_at: Date | undefined,
|
|
15
|
+
page: number = 0,
|
|
16
|
+
options: ApiOptions & { per_page?: number }
|
|
17
|
+
): Promise<ConversationResponse> {
|
|
18
|
+
if (options.fake) {
|
|
19
|
+
return getFakePaginatedConversationResponse(
|
|
20
|
+
page,
|
|
21
|
+
options.per_page ?? PER_PAGE
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
return axiosInstance
|
|
25
|
+
.get<ConversationResponse>(`/api/customers/${externalId}/conversation`, {
|
|
26
|
+
params: {
|
|
27
|
+
page,
|
|
28
|
+
// per_page: PER_PAGE,
|
|
29
|
+
getOld: 1,
|
|
30
|
+
getFrom: dateToUnixTimestamp(created_at),
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
.then((res) => res.data);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function getNewCustomerConversation(
|
|
37
|
+
externalId: string,
|
|
38
|
+
created_at: Date | undefined,
|
|
39
|
+
options: ApiOptions
|
|
40
|
+
): Promise<ConversationResponse> {
|
|
41
|
+
if (options.fake) {
|
|
42
|
+
return getFakeConversationResponse(25, 0, 0, true);
|
|
43
|
+
}
|
|
44
|
+
return axiosInstance
|
|
45
|
+
.get<ConversationResponse>(`/api/customers/${externalId}/conversation`, {
|
|
46
|
+
params: {
|
|
47
|
+
page: 1,
|
|
48
|
+
// per_page: 25,
|
|
49
|
+
getFrom: dateToUnixTimestamp(created_at),
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
.then((res) => res.data);
|
|
53
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CreateCustomerRequest, Customer } from '../types/Customer';
|
|
2
|
+
import type { ApiOptions } from '../types/ApiOptions';
|
|
3
|
+
import { getFakeCustomer } from '../data/fake/customers';
|
|
4
|
+
import { axiosInstance } from './api';
|
|
5
|
+
|
|
6
|
+
export function createCustomer(
|
|
7
|
+
customerData: CreateCustomerRequest,
|
|
8
|
+
options: ApiOptions
|
|
9
|
+
): Promise<Customer> {
|
|
10
|
+
if (options.fake) {
|
|
11
|
+
return Promise.resolve(getFakeCustomer(customerData));
|
|
12
|
+
}
|
|
13
|
+
return axiosInstance
|
|
14
|
+
.post('/api/customers/create', customerData)
|
|
15
|
+
.then((res) => res.data);
|
|
16
|
+
}
|
package/src/api/index.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { MessageResponse } from '../types/MessageResponse';
|
|
2
|
+
import type { ApiOptions } from '../types/ApiOptions';
|
|
3
|
+
import { getFakeMessageResponse } from '../data/fake/messages';
|
|
4
|
+
import { axiosInstance } from './api';
|
|
5
|
+
|
|
6
|
+
export function sendCustomerMessage(
|
|
7
|
+
externalId: string,
|
|
8
|
+
content: string,
|
|
9
|
+
options: ApiOptions
|
|
10
|
+
): Promise<MessageResponse> {
|
|
11
|
+
if (options.fake) {
|
|
12
|
+
return new Promise<MessageResponse>((resolve, _) => {
|
|
13
|
+
setTimeout(() => {
|
|
14
|
+
resolve(getFakeMessageResponse(content));
|
|
15
|
+
}, 500);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return axiosInstance
|
|
19
|
+
.post<MessageResponse>(
|
|
20
|
+
'/api/customers/message',
|
|
21
|
+
{
|
|
22
|
+
externalId,
|
|
23
|
+
content,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
headers: {
|
|
27
|
+
'Accept': 'application/json',
|
|
28
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
.then((res) => res.data);
|
|
33
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Text } from 'react-native';
|
|
2
|
+
import type { TextProps } from 'react-native';
|
|
3
|
+
import { LocalizationList } from '../constants/translations';
|
|
4
|
+
import { useAppStore } from '../store';
|
|
5
|
+
import { useThemeColors } from '../hooks/useThemeColors';
|
|
6
|
+
import type { LocalizationKeys } from '../types/LocalizationKeys';
|
|
7
|
+
|
|
8
|
+
interface AppTextProps extends Omit<TextProps, 'children'> {
|
|
9
|
+
localization?: keyof LocalizationKeys;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function AppText({
|
|
14
|
+
style,
|
|
15
|
+
localization,
|
|
16
|
+
children,
|
|
17
|
+
...props
|
|
18
|
+
}: AppTextProps) {
|
|
19
|
+
const themeColors = useThemeColors();
|
|
20
|
+
const { language } = useAppStore((s) => ({
|
|
21
|
+
language: s.language,
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
const localizedText = localization
|
|
25
|
+
? (LocalizationList[language as keyof typeof LocalizationList] ||
|
|
26
|
+
LocalizationList.en)[localization]
|
|
27
|
+
: undefined;
|
|
28
|
+
|
|
29
|
+
const content = localizedText || children;
|
|
30
|
+
|
|
31
|
+
if (!content) {
|
|
32
|
+
console.warn(
|
|
33
|
+
'AppText: No content provided. Either localization or children must be provided.'
|
|
34
|
+
);
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Text style={[{ color: themeColors.text }, style]} {...props}>
|
|
40
|
+
{content}
|
|
41
|
+
</Text>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { useAppStore } from '../store';
|
|
3
|
+
import {
|
|
4
|
+
FlatList,
|
|
5
|
+
View,
|
|
6
|
+
useWindowDimensions,
|
|
7
|
+
ActivityIndicator,
|
|
8
|
+
Image,
|
|
9
|
+
TouchableOpacity,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import { getCustomerConversation } from '../api';
|
|
12
|
+
import type { AppConversationMessage } from '../types/Conversation';
|
|
13
|
+
import { StyleSheet } from 'react-native';
|
|
14
|
+
import { MessageItem } from './MessageItem';
|
|
15
|
+
import { MessageInput } from './MessageInput';
|
|
16
|
+
import { useThemeColors } from '../hooks/useThemeColors';
|
|
17
|
+
import { AppText } from './AppText';
|
|
18
|
+
import { InitFailed } from './InitFailed';
|
|
19
|
+
import { EmptyList } from './EmptyList';
|
|
20
|
+
|
|
21
|
+
function LoadingItem() {
|
|
22
|
+
const themeColors = useThemeColors();
|
|
23
|
+
return (
|
|
24
|
+
<View
|
|
25
|
+
style={[styles.loadingItem, { backgroundColor: themeColors.background }]}
|
|
26
|
+
>
|
|
27
|
+
<ActivityIndicator size="large" color={themeColors.primary} />
|
|
28
|
+
</View>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function ChatList() {
|
|
33
|
+
const themeColors = useThemeColors();
|
|
34
|
+
const { height: windowHeight } = useWindowDimensions();
|
|
35
|
+
const MESSAGE_MIN_HEIGHT = 60;
|
|
36
|
+
const FLATLIST_PADDING = 20;
|
|
37
|
+
const MESSAGES_PER_PAGE = Math.ceil(
|
|
38
|
+
(windowHeight - FLATLIST_PADDING) / MESSAGE_MIN_HEIGHT
|
|
39
|
+
);
|
|
40
|
+
const [loading, setLoading] = useState(true);
|
|
41
|
+
const { customer, data, setData } = useAppStore((s) => ({
|
|
42
|
+
customer: s.customer,
|
|
43
|
+
data: s.data,
|
|
44
|
+
setData: s.setData,
|
|
45
|
+
}));
|
|
46
|
+
const ref = useRef<FlatList<AppConversationMessage>>(null);
|
|
47
|
+
const [page, setPage] = useState(1);
|
|
48
|
+
const nextPageStatus = useRef<'fail' | 'loading' | 'empty'>();
|
|
49
|
+
const [nexPageFailed, setNexPageFailed] = useState(false);
|
|
50
|
+
const [initFailed, setInitFailed] = useState(false);
|
|
51
|
+
const [isScrollingUp, setIsScrollingUp] = useState(false);
|
|
52
|
+
const listChangedRef = useRef(false);
|
|
53
|
+
|
|
54
|
+
const nextPage = useCallback(() => {
|
|
55
|
+
if (nextPageStatus.current) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
console.log('next');
|
|
59
|
+
nextPageStatus.current = 'loading';
|
|
60
|
+
if (customer?.external_id) {
|
|
61
|
+
const newPage = page + 1;
|
|
62
|
+
setPage(newPage);
|
|
63
|
+
const firstMessage = useAppStore.getState().firstMessage;
|
|
64
|
+
getCustomerConversation(
|
|
65
|
+
customer?.external_id,
|
|
66
|
+
firstMessage?.created_at,
|
|
67
|
+
newPage,
|
|
68
|
+
{
|
|
69
|
+
fake: useAppStore.getState().fake,
|
|
70
|
+
per_page: MESSAGES_PER_PAGE,
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
.then((newData) => {
|
|
74
|
+
listChangedRef.current = true;
|
|
75
|
+
setData((prevData) => {
|
|
76
|
+
const newMessages = newData.page.data;
|
|
77
|
+
const existingIds = new Set(prevData?.map((msg) => msg.id));
|
|
78
|
+
const uniqueNewMessages = newMessages.filter(
|
|
79
|
+
(msg) => !existingIds.has(msg.id)
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const processedMessages = uniqueNewMessages.map((u) => ({
|
|
83
|
+
...u,
|
|
84
|
+
created_at: new Date(u.created_at),
|
|
85
|
+
approved: true,
|
|
86
|
+
}));
|
|
87
|
+
if (processedMessages.length === 0) {
|
|
88
|
+
nextPageStatus.current = 'empty';
|
|
89
|
+
} else {
|
|
90
|
+
nextPageStatus.current = undefined;
|
|
91
|
+
}
|
|
92
|
+
return [...(prevData ?? []), ...processedMessages];
|
|
93
|
+
});
|
|
94
|
+
})
|
|
95
|
+
.catch((_) => {
|
|
96
|
+
nextPageStatus.current = 'fail';
|
|
97
|
+
setNexPageFailed(true);
|
|
98
|
+
})
|
|
99
|
+
.finally(() => {
|
|
100
|
+
setLoading(false);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}, [MESSAGES_PER_PAGE, customer?.external_id, page, setData]);
|
|
104
|
+
|
|
105
|
+
const renderItem = useCallback(
|
|
106
|
+
({ item }: { item: AppConversationMessage }) => <MessageItem item={item} />,
|
|
107
|
+
[]
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const handleScroll = useCallback(
|
|
111
|
+
(event: any) => {
|
|
112
|
+
const currentScrollY = event.nativeEvent.contentOffset.y;
|
|
113
|
+
const contentHeight = event.nativeEvent.contentSize.height;
|
|
114
|
+
const scrollViewHeight = event.nativeEvent.layoutMeasurement.height;
|
|
115
|
+
setIsScrollingUp(currentScrollY > 100);
|
|
116
|
+
|
|
117
|
+
if (currentScrollY >= contentHeight - scrollViewHeight - 200) {
|
|
118
|
+
nextPage();
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
[nextPage]
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const scrollToBottom = useCallback(
|
|
125
|
+
(animated: boolean) => {
|
|
126
|
+
if (ref.current && data?.length) {
|
|
127
|
+
ref.current.scrollToOffset({
|
|
128
|
+
offset: 0,
|
|
129
|
+
animated,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
[data]
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (customer?.external_id && !initFailed) {
|
|
138
|
+
getCustomerConversation(customer?.external_id, new Date(), 1, {
|
|
139
|
+
fake: useAppStore.getState().fake,
|
|
140
|
+
per_page: MESSAGES_PER_PAGE,
|
|
141
|
+
})
|
|
142
|
+
.then((newData) => {
|
|
143
|
+
setData((prevData) => {
|
|
144
|
+
const newMessages = newData.page.data;
|
|
145
|
+
const existingIds = new Set(prevData?.map((msg) => msg.id));
|
|
146
|
+
const uniqueNewMessages = newMessages.filter(
|
|
147
|
+
(msg) => !existingIds.has(msg.id)
|
|
148
|
+
);
|
|
149
|
+
const processedMessages = uniqueNewMessages.map((u) => ({
|
|
150
|
+
...u,
|
|
151
|
+
created_at: new Date(u.created_at),
|
|
152
|
+
approved: true,
|
|
153
|
+
}));
|
|
154
|
+
useAppStore.setState({
|
|
155
|
+
firstMessage: processedMessages[0],
|
|
156
|
+
});
|
|
157
|
+
if (processedMessages.length === 0) {
|
|
158
|
+
setLoading(false);
|
|
159
|
+
}
|
|
160
|
+
return processedMessages;
|
|
161
|
+
});
|
|
162
|
+
})
|
|
163
|
+
.catch((e) => {
|
|
164
|
+
setInitFailed(true);
|
|
165
|
+
console.error(e);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}, [MESSAGES_PER_PAGE, customer?.external_id, initFailed, setData]);
|
|
169
|
+
|
|
170
|
+
if (nexPageFailed) {
|
|
171
|
+
return (
|
|
172
|
+
<View
|
|
173
|
+
style={[
|
|
174
|
+
styles.retryContainer,
|
|
175
|
+
{ backgroundColor: themeColors.background },
|
|
176
|
+
]}
|
|
177
|
+
>
|
|
178
|
+
<TouchableOpacity
|
|
179
|
+
style={[styles.retryButton, { backgroundColor: themeColors.primary }]}
|
|
180
|
+
onPress={() => {
|
|
181
|
+
setNexPageFailed(false);
|
|
182
|
+
nextPageStatus.current = undefined;
|
|
183
|
+
nextPage();
|
|
184
|
+
}}
|
|
185
|
+
>
|
|
186
|
+
<AppText
|
|
187
|
+
localization="chat.load.error"
|
|
188
|
+
style={[styles.retryText, { color: themeColors.background }]}
|
|
189
|
+
/>
|
|
190
|
+
</TouchableOpacity>
|
|
191
|
+
</View>
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (initFailed) {
|
|
196
|
+
return <InitFailed setInitFailed={setInitFailed} />;
|
|
197
|
+
}
|
|
198
|
+
return (
|
|
199
|
+
<View
|
|
200
|
+
style={[styles.container, { backgroundColor: themeColors.background }]}
|
|
201
|
+
>
|
|
202
|
+
<FlatList
|
|
203
|
+
ref={ref}
|
|
204
|
+
data={data}
|
|
205
|
+
inverted
|
|
206
|
+
renderItem={renderItem}
|
|
207
|
+
contentContainerStyle={[
|
|
208
|
+
styles.contentContainer,
|
|
209
|
+
{ backgroundColor: themeColors.background },
|
|
210
|
+
]}
|
|
211
|
+
style={styles.list}
|
|
212
|
+
ListEmptyComponent={
|
|
213
|
+
!loading && (!data || data.length === 0) ? <EmptyList /> : null
|
|
214
|
+
}
|
|
215
|
+
ListFooterComponent={loading ? <LoadingItem /> : null}
|
|
216
|
+
keyExtractor={(item) => item.id + '-' + item.created_at}
|
|
217
|
+
removeClippedSubviews={true}
|
|
218
|
+
maxToRenderPerBatch={10}
|
|
219
|
+
windowSize={21}
|
|
220
|
+
initialNumToRender={MESSAGES_PER_PAGE}
|
|
221
|
+
getItemLayout={(_, index) => ({
|
|
222
|
+
length: MESSAGE_MIN_HEIGHT + 10,
|
|
223
|
+
offset: (MESSAGE_MIN_HEIGHT + 10) * index,
|
|
224
|
+
index,
|
|
225
|
+
})}
|
|
226
|
+
onScroll={handleScroll}
|
|
227
|
+
scrollEventThrottle={16}
|
|
228
|
+
/>
|
|
229
|
+
{isScrollingUp && (
|
|
230
|
+
<TouchableOpacity
|
|
231
|
+
style={[
|
|
232
|
+
styles.scrollDownButton,
|
|
233
|
+
{ backgroundColor: themeColors.background },
|
|
234
|
+
]}
|
|
235
|
+
onPress={() => scrollToBottom(true)}
|
|
236
|
+
>
|
|
237
|
+
<Image
|
|
238
|
+
source={require('../assets/down.png')}
|
|
239
|
+
style={[styles.scrollUpIcon, { tintColor: themeColors.text }]}
|
|
240
|
+
/>
|
|
241
|
+
</TouchableOpacity>
|
|
242
|
+
)}
|
|
243
|
+
<MessageInput scrollToBottom={scrollToBottom} />
|
|
244
|
+
</View>
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const styles = StyleSheet.create({
|
|
249
|
+
container: {
|
|
250
|
+
flex: 1,
|
|
251
|
+
},
|
|
252
|
+
list: {
|
|
253
|
+
flex: 1,
|
|
254
|
+
},
|
|
255
|
+
contentContainer: {
|
|
256
|
+
paddingVertical: 10,
|
|
257
|
+
paddingHorizontal: 10,
|
|
258
|
+
},
|
|
259
|
+
loadingItem: {
|
|
260
|
+
height: 200,
|
|
261
|
+
alignItems: 'center',
|
|
262
|
+
justifyContent: 'center',
|
|
263
|
+
},
|
|
264
|
+
scrollDownButton: {
|
|
265
|
+
position: 'absolute',
|
|
266
|
+
right: 20,
|
|
267
|
+
bottom: '15%',
|
|
268
|
+
borderRadius: 25,
|
|
269
|
+
padding: 10,
|
|
270
|
+
shadowColor: '#000',
|
|
271
|
+
shadowOffset: {
|
|
272
|
+
width: 0,
|
|
273
|
+
height: 2,
|
|
274
|
+
},
|
|
275
|
+
shadowOpacity: 0.25,
|
|
276
|
+
shadowRadius: 3.84,
|
|
277
|
+
elevation: 5,
|
|
278
|
+
},
|
|
279
|
+
scrollUpIcon: {
|
|
280
|
+
width: 24,
|
|
281
|
+
height: 24,
|
|
282
|
+
},
|
|
283
|
+
retryContainer: {
|
|
284
|
+
flex: 1,
|
|
285
|
+
alignItems: 'center',
|
|
286
|
+
justifyContent: 'center',
|
|
287
|
+
padding: 20,
|
|
288
|
+
},
|
|
289
|
+
retryButton: {
|
|
290
|
+
padding: 15,
|
|
291
|
+
borderRadius: 8,
|
|
292
|
+
alignItems: 'center',
|
|
293
|
+
justifyContent: 'center',
|
|
294
|
+
},
|
|
295
|
+
retryText: {
|
|
296
|
+
fontSize: 16,
|
|
297
|
+
fontWeight: '500',
|
|
298
|
+
},
|
|
299
|
+
});
|