@ethora/chat-component-rn 26.7.2 → 26.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +9 -8
- package/lib/commonjs/assets/icons.js +7 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +20 -6
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +86 -7
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +18 -0
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +11 -4
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +5 -5
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +62 -32
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +208 -70
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +307 -99
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +544 -200
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +226 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +6 -2
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js +8 -0
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +202 -104
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +556 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +210 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +507 -244
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +74 -46
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +9 -2
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +17 -7
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +80 -1
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledComponents.js +9 -3
- package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +12 -0
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/getChatBackground.js +23 -0
- package/lib/commonjs/helpers/getChatBackground.js.map +1 -0
- package/lib/commonjs/helpers/historyPreloadScheduler.js +65 -2
- package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/commonjs/helpers/mediaLibraryRuntime.js +31 -0
- package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/commonjs/helpers/shallowEqual.js +36 -0
- package/lib/commonjs/helpers/shallowEqual.js.map +1 -0
- package/lib/commonjs/helpers/sheetGestures.js +32 -0
- package/lib/commonjs/helpers/sheetGestures.js.map +1 -0
- package/lib/commonjs/hooks/useChatWrapperInit.js +15 -0
- package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/commonjs/hooks/useComposing.js +27 -0
- package/lib/commonjs/hooks/useComposing.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +27 -1
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +121 -1
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +59 -0
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +6 -2
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +3 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +2 -2
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/assets/icons.js +6 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +20 -6
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +87 -8
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +19 -1
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +11 -4
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +5 -5
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +62 -32
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +211 -73
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +298 -102
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +547 -204
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +223 -0
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +6 -2
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/Modal/Modal.js +9 -1
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +205 -106
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +548 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +205 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +509 -248
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +76 -48
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +9 -2
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +17 -7
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +80 -1
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledComponents.js +9 -3
- package/lib/module/components/styled/StyledComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/context/xmppProvider.js +12 -0
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/getChatBackground.js +18 -0
- package/lib/module/helpers/getChatBackground.js.map +1 -0
- package/lib/module/helpers/historyPreloadScheduler.js +66 -3
- package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/module/helpers/mediaLibraryRuntime.js +25 -0
- package/lib/module/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/module/helpers/shallowEqual.js +31 -0
- package/lib/module/helpers/shallowEqual.js.map +1 -0
- package/lib/module/helpers/sheetGestures.js +26 -0
- package/lib/module/helpers/sheetGestures.js.map +1 -0
- package/lib/module/hooks/useChatWrapperInit.js +15 -0
- package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/module/hooks/useComposing.js +28 -1
- package/lib/module/hooks/useComposing.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +28 -2
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/i18n/strings.js +121 -1
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/networking/api-requests/user.api.js +56 -0
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +6 -2
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +3 -1
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +1 -1
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/typescript/assets/icons.d.ts +12 -0
- package/lib/typescript/assets/icons.d.ts.map +1 -1
- package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts +10 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +9 -0
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +10 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +9 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +1 -0
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +75 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +1 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +25 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +1 -0
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +6 -1
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +16 -0
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +1 -0
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
- package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/getChatBackground.d.ts +15 -0
- package/lib/typescript/helpers/getChatBackground.d.ts.map +1 -0
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +3 -0
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/shallowEqual.d.ts +11 -0
- package/lib/typescript/helpers/shallowEqual.d.ts.map +1 -0
- package/lib/typescript/helpers/sheetGestures.d.ts +20 -0
- package/lib/typescript/helpers/sheetGestures.d.ts.map +1 -0
- package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
- package/lib/typescript/hooks/useComposing.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts +1 -0
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/user.api.d.ts +27 -0
- package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +1 -0
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +1 -0
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +1 -0
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +9 -5
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/assets/icons.tsx +29 -9
- package/src/components/Header/HeaderRoomList.tsx +20 -5
- package/src/components/MainComponents/ChatRoom.tsx +92 -8
- package/src/components/MainComponents/ChatWrapper.tsx +19 -1
- package/src/components/MainComponents/MessageList.tsx +21 -3
- package/src/components/MainComponents/ProfileImagePlaceholder.tsx +5 -5
- package/src/components/MainComponents/RoomList.tsx +65 -34
- package/src/components/Menu/HeaderRoomListMenu.tsx +209 -64
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +318 -86
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +599 -278
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +244 -0
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +4 -2
- package/src/components/Modals/Modal/Modal.tsx +7 -0
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +219 -117
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +615 -0
- package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +217 -0
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +14 -4
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +617 -307
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +75 -58
- package/src/components/Modals/styledModalComponents.tsx +9 -2
- package/src/components/RoomComponents/ChatRoomItem.tsx +14 -7
- package/src/components/styled/SendInput.tsx +83 -2
- package/src/components/styled/StyledComponents.ts +9 -3
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +11 -4
- package/src/context/xmppProvider.tsx +14 -0
- package/src/helpers/getChatBackground.ts +18 -0
- package/src/helpers/historyPreloadScheduler.ts +80 -3
- package/src/helpers/mediaLibraryRuntime.ts +25 -0
- package/src/helpers/shallowEqual.ts +33 -0
- package/src/helpers/sheetGestures.ts +25 -0
- package/src/hooks/useChatWrapperInit.ts +15 -0
- package/src/hooks/useComposing.tsx +37 -1
- package/src/hooks/useSendMessage.tsx +32 -2
- package/src/hooks/useUnreadMessagesCounter.ts +11 -0
- package/src/i18n/strings.ts +121 -1
- package/src/networking/api-requests/user.api.ts +71 -0
- package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +17 -3
- package/src/networking/xmppClient.ts +5 -1
- package/src/roomStore/chatSettingsSlice.ts +3 -1
- package/src/roomStore/roomsSlice.ts +1 -1
- package/src/types/types.ts +16 -5
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import {
|
|
5
|
+
ActivityIndicator,
|
|
6
|
+
Modal,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
Text,
|
|
9
|
+
TextInput,
|
|
10
|
+
TouchableOpacity,
|
|
11
|
+
View,
|
|
12
|
+
} from 'react-native';
|
|
13
|
+
import { useSelector } from 'react-redux';
|
|
14
|
+
import { getActiveRoom, RootState } from '../../../roomStore';
|
|
15
|
+
import { postReportRoom } from '../../../networking/api-requests/rooms.api';
|
|
16
|
+
import { useToast } from '../../../context/ToastContext';
|
|
17
|
+
import { useT } from '../../../i18n/useT';
|
|
18
|
+
import { getIconColor } from '../../../helpers/getIconColor';
|
|
19
|
+
import { useChatSettingState } from '../../../hooks/useChatSettingState';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Category ids go to `POST /v1/chats/reports/{chatName}` as-is; the labels
|
|
23
|
+
* come from the i18n table, which already carried `report.category.*`
|
|
24
|
+
* strings in all six locales with nothing rendering them until now.
|
|
25
|
+
*/
|
|
26
|
+
const CATEGORIES = [
|
|
27
|
+
'spam',
|
|
28
|
+
'violence',
|
|
29
|
+
'childAbuse',
|
|
30
|
+
'pornography',
|
|
31
|
+
'personalDetails',
|
|
32
|
+
'illegalDrugs',
|
|
33
|
+
'other',
|
|
34
|
+
] as const;
|
|
35
|
+
|
|
36
|
+
interface ReportChatModalProps {
|
|
37
|
+
visible: boolean;
|
|
38
|
+
onClose: () => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const ReportChatModal: React.FC<ReportChatModalProps> = ({
|
|
42
|
+
visible,
|
|
43
|
+
onClose,
|
|
44
|
+
}) => {
|
|
45
|
+
const t = useT();
|
|
46
|
+
const { showToast } = useToast();
|
|
47
|
+
const { config } = useChatSettingState();
|
|
48
|
+
const activeRoom = useSelector((state: RootState) => getActiveRoom(state));
|
|
49
|
+
const [category, setCategory] = useState<string | null>(null);
|
|
50
|
+
const [details, setDetails] = useState('');
|
|
51
|
+
const [sending, setSending] = useState(false);
|
|
52
|
+
const primary = getIconColor(config);
|
|
53
|
+
|
|
54
|
+
const close = () => {
|
|
55
|
+
setCategory(null);
|
|
56
|
+
setDetails('');
|
|
57
|
+
onClose();
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const submit = async () => {
|
|
61
|
+
if (!category || sending) {return;}
|
|
62
|
+
setSending(true);
|
|
63
|
+
try {
|
|
64
|
+
await postReportRoom({
|
|
65
|
+
chatName: activeRoom?.jid?.split('@')[0] || '',
|
|
66
|
+
category,
|
|
67
|
+
text: details.trim() || undefined,
|
|
68
|
+
});
|
|
69
|
+
showToast({
|
|
70
|
+
id: Date.now().toString(),
|
|
71
|
+
title: 'Success',
|
|
72
|
+
message: t('modal.report.chatTitle'),
|
|
73
|
+
type: 'success',
|
|
74
|
+
});
|
|
75
|
+
close();
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error('Failed to report chat:', error);
|
|
78
|
+
showToast({
|
|
79
|
+
id: Date.now().toString(),
|
|
80
|
+
title: 'Error',
|
|
81
|
+
message: t('modal.report.chatTitle'),
|
|
82
|
+
type: 'error',
|
|
83
|
+
});
|
|
84
|
+
} finally {
|
|
85
|
+
setSending(false);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<Modal
|
|
91
|
+
transparent
|
|
92
|
+
visible={visible}
|
|
93
|
+
animationType="fade"
|
|
94
|
+
onRequestClose={close}
|
|
95
|
+
>
|
|
96
|
+
<View style={styles.backdrop}>
|
|
97
|
+
<TouchableOpacity
|
|
98
|
+
testID="report-backdrop"
|
|
99
|
+
style={StyleSheet.absoluteFill}
|
|
100
|
+
activeOpacity={1}
|
|
101
|
+
onPress={close}
|
|
102
|
+
/>
|
|
103
|
+
<View style={styles.card}>
|
|
104
|
+
<Text style={styles.title}>{t('modal.report.chatTitle')}</Text>
|
|
105
|
+
<View style={styles.categories}>
|
|
106
|
+
{CATEGORIES.map((id) => {
|
|
107
|
+
const selected = category === id;
|
|
108
|
+
return (
|
|
109
|
+
<TouchableOpacity
|
|
110
|
+
key={id}
|
|
111
|
+
testID={`report-category-${id}`}
|
|
112
|
+
activeOpacity={0.7}
|
|
113
|
+
onPress={() => setCategory(id)}
|
|
114
|
+
style={[
|
|
115
|
+
styles.category,
|
|
116
|
+
selected && { borderColor: primary, backgroundColor: primary + '14' },
|
|
117
|
+
]}
|
|
118
|
+
>
|
|
119
|
+
<Text
|
|
120
|
+
style={[styles.categoryLabel, selected && { color: primary }]}
|
|
121
|
+
>
|
|
122
|
+
{t(`report.category.${id}`)}
|
|
123
|
+
</Text>
|
|
124
|
+
</TouchableOpacity>
|
|
125
|
+
);
|
|
126
|
+
})}
|
|
127
|
+
</View>
|
|
128
|
+
{category === 'other' && (
|
|
129
|
+
<TextInput
|
|
130
|
+
testID="report-details"
|
|
131
|
+
style={styles.input}
|
|
132
|
+
placeholder={t('modal.report.otherDetails')}
|
|
133
|
+
placeholderTextColor="#8C8C8C"
|
|
134
|
+
value={details}
|
|
135
|
+
onChangeText={setDetails}
|
|
136
|
+
multiline
|
|
137
|
+
/>
|
|
138
|
+
)}
|
|
139
|
+
<View style={styles.buttons}>
|
|
140
|
+
<TouchableOpacity
|
|
141
|
+
activeOpacity={0.7}
|
|
142
|
+
style={[styles.button, styles.cancel]}
|
|
143
|
+
onPress={close}
|
|
144
|
+
>
|
|
145
|
+
<Text style={styles.cancelLabel}>{t('action.cancel')}</Text>
|
|
146
|
+
</TouchableOpacity>
|
|
147
|
+
<TouchableOpacity
|
|
148
|
+
testID="report-submit"
|
|
149
|
+
activeOpacity={0.7}
|
|
150
|
+
disabled={!category || sending}
|
|
151
|
+
style={[
|
|
152
|
+
styles.button,
|
|
153
|
+
{ backgroundColor: primary, opacity: !category || sending ? 0.5 : 1 },
|
|
154
|
+
]}
|
|
155
|
+
onPress={submit}
|
|
156
|
+
>
|
|
157
|
+
{sending ? (
|
|
158
|
+
<ActivityIndicator color="#FFFFFF" />
|
|
159
|
+
) : (
|
|
160
|
+
<Text style={styles.submitLabel}>{t('action.send')}</Text>
|
|
161
|
+
)}
|
|
162
|
+
</TouchableOpacity>
|
|
163
|
+
</View>
|
|
164
|
+
</View>
|
|
165
|
+
</View>
|
|
166
|
+
</Modal>
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const styles = StyleSheet.create({
|
|
171
|
+
backdrop: {
|
|
172
|
+
flex: 1,
|
|
173
|
+
backgroundColor: 'rgba(15,15,20,0.45)',
|
|
174
|
+
alignItems: 'center',
|
|
175
|
+
justifyContent: 'center',
|
|
176
|
+
padding: 24,
|
|
177
|
+
},
|
|
178
|
+
card: {
|
|
179
|
+
width: '100%',
|
|
180
|
+
borderRadius: 16,
|
|
181
|
+
backgroundColor: '#FFFFFF',
|
|
182
|
+
padding: 20,
|
|
183
|
+
},
|
|
184
|
+
title: {
|
|
185
|
+
fontSize: 18,
|
|
186
|
+
fontWeight: '600',
|
|
187
|
+
color: '#141414',
|
|
188
|
+
marginBottom: 16,
|
|
189
|
+
},
|
|
190
|
+
categories: {
|
|
191
|
+
flexDirection: 'row',
|
|
192
|
+
flexWrap: 'wrap',
|
|
193
|
+
gap: 8,
|
|
194
|
+
},
|
|
195
|
+
category: {
|
|
196
|
+
paddingHorizontal: 12,
|
|
197
|
+
paddingVertical: 8,
|
|
198
|
+
borderRadius: 20,
|
|
199
|
+
borderWidth: 1,
|
|
200
|
+
borderColor: '#E4E4E9',
|
|
201
|
+
},
|
|
202
|
+
categoryLabel: {
|
|
203
|
+
fontSize: 14,
|
|
204
|
+
color: '#141414',
|
|
205
|
+
},
|
|
206
|
+
input: {
|
|
207
|
+
marginTop: 16,
|
|
208
|
+
minHeight: 80,
|
|
209
|
+
borderRadius: 12,
|
|
210
|
+
borderWidth: 1,
|
|
211
|
+
borderColor: '#E4E4E9',
|
|
212
|
+
padding: 12,
|
|
213
|
+
fontSize: 14,
|
|
214
|
+
color: '#141414',
|
|
215
|
+
textAlignVertical: 'top',
|
|
216
|
+
},
|
|
217
|
+
buttons: {
|
|
218
|
+
flexDirection: 'row',
|
|
219
|
+
gap: 12,
|
|
220
|
+
marginTop: 20,
|
|
221
|
+
},
|
|
222
|
+
button: {
|
|
223
|
+
flex: 1,
|
|
224
|
+
height: 44,
|
|
225
|
+
borderRadius: 12,
|
|
226
|
+
alignItems: 'center',
|
|
227
|
+
justifyContent: 'center',
|
|
228
|
+
},
|
|
229
|
+
cancel: {
|
|
230
|
+
backgroundColor: '#F2F2F7',
|
|
231
|
+
},
|
|
232
|
+
cancelLabel: {
|
|
233
|
+
fontSize: 16,
|
|
234
|
+
fontWeight: '500',
|
|
235
|
+
color: '#141414',
|
|
236
|
+
},
|
|
237
|
+
submitLabel: {
|
|
238
|
+
fontSize: 16,
|
|
239
|
+
fontWeight: '600',
|
|
240
|
+
color: '#FFFFFF',
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
export default ReportChatModal;
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import { useVideoPlayer, VideoView } from 'expo-video';
|
|
27
27
|
import { PlayIcon } from '../../../assets/icons';
|
|
28
28
|
import * as FileSystem from 'expo-file-system/legacy';
|
|
29
|
-
import
|
|
29
|
+
import { getMediaLibrary } from '../../../helpers/mediaLibraryRuntime';
|
|
30
30
|
import { useToast } from '../../../context/ToastContext';
|
|
31
31
|
import PdfViewer from './PdfView';
|
|
32
32
|
import DocumentViewer from './DocumentViewer';
|
|
@@ -129,6 +129,8 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
129
129
|
if (!activeFile) {return null;}
|
|
130
130
|
|
|
131
131
|
const requestStoragePermission = async () => {
|
|
132
|
+
const MediaLibrary = getMediaLibrary();
|
|
133
|
+
if (!MediaLibrary?.requestPermissionsAsync) {return false;}
|
|
132
134
|
try {
|
|
133
135
|
const { status } = await MediaLibrary.requestPermissionsAsync();
|
|
134
136
|
return status === 'granted';
|
|
@@ -158,7 +160,7 @@ const FilePreviewModal: React.FC<FilePreviewModalProps> = ({
|
|
|
158
160
|
const download = await FileSystem.downloadAsync(withFileToken(activeFile.fileURL), filePath);
|
|
159
161
|
|
|
160
162
|
if (download.status === 200) {
|
|
161
|
-
await
|
|
163
|
+
await getMediaLibrary()?.saveToLibraryAsync(download.uri);
|
|
162
164
|
showToast({
|
|
163
165
|
id: Date.now().toString(),
|
|
164
166
|
title: 'Success',
|
|
@@ -37,6 +37,13 @@ const Modal: React.FC<ModalProps> = ({ children, modal, setOpenModal }) => {
|
|
|
37
37
|
|
|
38
38
|
return <ModalComponent handleCloseModal={handleClose} />;
|
|
39
39
|
};
|
|
40
|
+
// Modals that present themselves (a real RN <Modal>, so the dim covers
|
|
41
|
+
// the whole window rather than stopping at this component's frame) must
|
|
42
|
+
// not also sit inside the shared in-tree backdrop — that would dim twice.
|
|
43
|
+
if (modal === MODAL_TYPES.NEW_CHAT) {
|
|
44
|
+
return <>{renderModalContent()}{children}</>;
|
|
45
|
+
}
|
|
46
|
+
|
|
40
47
|
return (
|
|
41
48
|
modal && (
|
|
42
49
|
<ModalBackground
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import React, { useState,
|
|
2
|
-
import
|
|
3
|
-
import { AddNewIcon, AddPhotoIcon } from '../../../assets/icons';
|
|
1
|
+
import React, { useState, useMemo } from 'react';
|
|
2
|
+
import { CameraIcon } from '../../../assets/icons';
|
|
4
3
|
import { RootState } from '../../../roomStore';
|
|
5
4
|
import { useXmppClient } from '../../../context/xmppProvider';
|
|
6
|
-
import {
|
|
7
|
-
CloseButton,
|
|
8
|
-
GroupContainer,
|
|
9
|
-
ModalBackground,
|
|
10
|
-
ModalContainer,
|
|
11
|
-
ModalTitle,
|
|
12
|
-
} from '../styledModalComponents';
|
|
13
5
|
import { addRoomViaApi, setCurrentRoom, updateRoom } from '../../../roomStore/roomsSlice';
|
|
14
|
-
import InputWithLabel from '../../styled/StyledInput';
|
|
15
6
|
import { uploadFile } from '../../../networking/api-requests/auth.api';
|
|
16
|
-
import {
|
|
17
|
-
|
|
7
|
+
import {
|
|
8
|
+
ActivityIndicator,
|
|
9
|
+
Alert,
|
|
10
|
+
Image,
|
|
11
|
+
Linking,
|
|
12
|
+
Modal,
|
|
13
|
+
Pressable,
|
|
14
|
+
StyleSheet,
|
|
15
|
+
Text,
|
|
16
|
+
TextInput,
|
|
17
|
+
TouchableOpacity,
|
|
18
|
+
View,
|
|
19
|
+
} from 'react-native';
|
|
20
|
+
import { getIconColor } from '../../../helpers/getIconColor';
|
|
21
|
+
import { useT } from '../../../i18n/useT';
|
|
18
22
|
import * as ImagePicker from 'expo-image-picker';
|
|
19
23
|
import { ApiRoom, ChatAccessOption, RoomMember } from '../../../types/models/room.model';
|
|
20
24
|
import { createRoomFromApi } from '../../../helpers/createRoomFromApi';
|
|
@@ -24,16 +28,16 @@ import { useChatSettingState } from '../../../hooks/useChatSettingState';
|
|
|
24
28
|
import { useToast } from '../../../context/ToastContext';
|
|
25
29
|
|
|
26
30
|
interface NewChatModalProps {
|
|
27
|
-
handleCloseModal?:
|
|
31
|
+
handleCloseModal?: () => void;
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
31
35
|
// Some call sites mount `<NewChatModal />` with no props (e.g. the
|
|
32
|
-
// empty-state in ChatRoom when roomsList is empty).
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
handleCloseModal: handleClose = () => {},
|
|
36
|
+
// empty-state in ChatRoom when roomsList is empty). There is nothing to
|
|
37
|
+
// dismiss back to there, so Cancel just resets the form.
|
|
38
|
+
handleCloseModal: handleClose,
|
|
36
39
|
}) => {
|
|
40
|
+
const t = useT();
|
|
37
41
|
const config = useAppSelector(
|
|
38
42
|
(state: RootState) => state.chatSettingStore.config
|
|
39
43
|
);
|
|
@@ -43,9 +47,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
|
43
47
|
const { user } = useChatSettingState();
|
|
44
48
|
const { showToast } = useToast();
|
|
45
49
|
|
|
46
|
-
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
|
47
50
|
const [loading, setLoading] = useState<boolean>(false);
|
|
48
|
-
const [activeTab, setActiveTab] = useState<'0' | '1' | null>('0');
|
|
49
51
|
|
|
50
52
|
const [roomName, setRoomName] = useState<string>('');
|
|
51
53
|
const [roomDescription, setRoomDescription] = useState<string>('');
|
|
@@ -65,7 +67,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
|
65
67
|
|
|
66
68
|
const validateRoomName = (name: string) => {
|
|
67
69
|
if (name.trim().length < 3) {
|
|
68
|
-
return '
|
|
70
|
+
return t('modal.newChat.nameTooShort');
|
|
69
71
|
}
|
|
70
72
|
return '';
|
|
71
73
|
};
|
|
@@ -97,13 +99,17 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
|
97
99
|
}));
|
|
98
100
|
};
|
|
99
101
|
|
|
100
|
-
const
|
|
101
|
-
const handleCloseModal = () => {
|
|
102
|
-
handleClose();
|
|
103
|
-
setActiveTab('0');
|
|
104
|
-
setIsModalOpen(false);
|
|
102
|
+
const resetForm = () => {
|
|
105
103
|
setRoomName('');
|
|
104
|
+
setRoomDescription('');
|
|
105
|
+
setProfileImage(null);
|
|
106
106
|
setSelectedUsers([]);
|
|
107
|
+
setErrors({ name: '', description: '' });
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const handleCloseModal = () => {
|
|
111
|
+
resetForm();
|
|
112
|
+
handleClose?.();
|
|
107
113
|
};
|
|
108
114
|
|
|
109
115
|
const onUpload = async () => {
|
|
@@ -129,7 +135,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
|
129
135
|
quality: 0.8,
|
|
130
136
|
});
|
|
131
137
|
|
|
132
|
-
if (result.canceled) return;
|
|
138
|
+
if (result.canceled) {return;}
|
|
133
139
|
|
|
134
140
|
const asset = result.assets[0];
|
|
135
141
|
const originalName = asset.uri.split('/').pop();
|
|
@@ -161,7 +167,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
|
161
167
|
usersArrayLength
|
|
162
168
|
);
|
|
163
169
|
|
|
164
|
-
if (!normalizedChat || !client) return;
|
|
170
|
+
if (!normalizedChat || !client) {return;}
|
|
165
171
|
|
|
166
172
|
dispatch(
|
|
167
173
|
addRoomViaApi({
|
|
@@ -261,103 +267,199 @@ const NewChatModal: React.FC<NewChatModalProps> = ({
|
|
|
261
267
|
}
|
|
262
268
|
}
|
|
263
269
|
|
|
264
|
-
|
|
265
|
-
setErrors({ name: '', description: '' });
|
|
266
|
-
setProfileImage(null);
|
|
267
|
-
setRoomName('');
|
|
268
|
-
setRoomDescription('');
|
|
270
|
+
resetForm();
|
|
269
271
|
setLoading(false);
|
|
270
272
|
}
|
|
271
273
|
};
|
|
272
274
|
|
|
275
|
+
const primary = getIconColor(config);
|
|
276
|
+
const pickedUri =
|
|
277
|
+
profileImage && typeof profileImage === 'object' && 'uri' in profileImage
|
|
278
|
+
? profileImage.uri
|
|
279
|
+
: typeof profileImage === 'string'
|
|
280
|
+
? profileImage
|
|
281
|
+
: null;
|
|
282
|
+
|
|
273
283
|
return (
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
<
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
upload={{ active: true, onUpload }}
|
|
301
|
-
remove={{ enabled: true, onRemoveClick }}
|
|
302
|
-
placeholderIcon={<AddPhotoIcon color="#0052CD" />}
|
|
303
|
-
icon={
|
|
304
|
-
profileImage && typeof profileImage === 'object' && 'uri' in profileImage
|
|
305
|
-
? { uri: profileImage.uri }
|
|
306
|
-
: profileImage
|
|
307
|
-
}
|
|
308
|
-
disableOverlay={!profileImage}
|
|
309
|
-
role="user"
|
|
310
|
-
/>
|
|
311
|
-
<GroupContainer
|
|
312
|
-
style={{
|
|
313
|
-
flexDirection: 'column',
|
|
314
|
-
position: 'relative',
|
|
315
|
-
width: '100%',
|
|
316
|
-
}}
|
|
284
|
+
// A real <Modal> rather than an in-tree overlay: the SDK renders inside
|
|
285
|
+
// whatever frame the host gives it, so an in-tree backdrop stopped at
|
|
286
|
+
// the component's edge and left the host's own chrome (tab bars and
|
|
287
|
+
// such) lit. This one dims the whole window.
|
|
288
|
+
<Modal
|
|
289
|
+
transparent
|
|
290
|
+
visible
|
|
291
|
+
animationType="fade"
|
|
292
|
+
statusBarTranslucent
|
|
293
|
+
onRequestClose={handleCloseModal}
|
|
294
|
+
>
|
|
295
|
+
<View style={styles.backdrop}>
|
|
296
|
+
<Pressable
|
|
297
|
+
testID="new-chat-backdrop"
|
|
298
|
+
style={StyleSheet.absoluteFill}
|
|
299
|
+
onPress={handleCloseModal}
|
|
300
|
+
/>
|
|
301
|
+
<View style={styles.card}>
|
|
302
|
+
<Text style={styles.title}>{t('modal.newChat.title')}</Text>
|
|
303
|
+
|
|
304
|
+
<TouchableOpacity
|
|
305
|
+
testID="new-chat-picture"
|
|
306
|
+
activeOpacity={0.8}
|
|
307
|
+
onPress={onUpload}
|
|
308
|
+
onLongPress={pickedUri ? onRemoveClick : undefined}
|
|
309
|
+
style={[styles.picture, { backgroundColor: primary }]}
|
|
317
310
|
>
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
311
|
+
{pickedUri ? (
|
|
312
|
+
<Image source={{ uri: pickedUri }} style={styles.pictureImage} />
|
|
313
|
+
) : (
|
|
314
|
+
<CameraIcon color="#FFFFFF" width={26} height={26} />
|
|
315
|
+
)}
|
|
316
|
+
</TouchableOpacity>
|
|
317
|
+
|
|
318
|
+
<TextInput
|
|
319
|
+
testID="new-chat-name"
|
|
320
|
+
style={styles.input}
|
|
321
|
+
value={roomName}
|
|
322
|
+
onChangeText={handleRoomNameChange}
|
|
323
|
+
placeholder={t('modal.newChat.roomNamePlaceholder')}
|
|
324
|
+
placeholderTextColor="#8C8C8C"
|
|
325
|
+
returnKeyType="next"
|
|
326
|
+
/>
|
|
327
|
+
{!!errors.name && roomName.length > 0 && (
|
|
328
|
+
<Text testID="new-chat-name-error" style={styles.error}>
|
|
329
|
+
{errors.name}
|
|
330
|
+
</Text>
|
|
331
|
+
)}
|
|
332
|
+
|
|
333
|
+
<TextInput
|
|
334
|
+
testID="new-chat-description"
|
|
335
|
+
style={[styles.input, styles.textArea]}
|
|
336
|
+
value={roomDescription}
|
|
337
|
+
onChangeText={handleRoomDescriptionChange}
|
|
338
|
+
placeholder={t('modal.newChat.descriptionPlaceholder')}
|
|
339
|
+
placeholderTextColor="#8C8C8C"
|
|
340
|
+
multiline
|
|
341
|
+
/>
|
|
342
|
+
|
|
343
|
+
<View style={styles.buttons}>
|
|
344
|
+
<TouchableOpacity
|
|
345
|
+
testID="new-chat-cancel"
|
|
346
|
+
activeOpacity={0.7}
|
|
347
|
+
style={[styles.button, styles.cancel]}
|
|
349
348
|
onPress={handleCloseModal}
|
|
350
|
-
|
|
351
|
-
style={{
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
349
|
+
>
|
|
350
|
+
<Text style={styles.cancelLabel}>{t('action.cancel')}</Text>
|
|
351
|
+
</TouchableOpacity>
|
|
352
|
+
<TouchableOpacity
|
|
353
|
+
testID="new-chat-submit"
|
|
354
|
+
activeOpacity={0.7}
|
|
355
|
+
disabled={!isValid || loading}
|
|
356
|
+
style={[
|
|
357
|
+
styles.button,
|
|
358
|
+
{ backgroundColor: primary, opacity: !isValid || loading ? 0.5 : 1 },
|
|
359
|
+
]}
|
|
360
|
+
onPress={handleCreateRoom}
|
|
361
|
+
>
|
|
362
|
+
{loading ? (
|
|
363
|
+
<ActivityIndicator color="#FFFFFF" />
|
|
364
|
+
) : (
|
|
365
|
+
<Text style={styles.submitLabel}>
|
|
366
|
+
{t('modal.newChat.createButton')}
|
|
367
|
+
</Text>
|
|
368
|
+
)}
|
|
369
|
+
</TouchableOpacity>
|
|
370
|
+
</View>
|
|
371
|
+
</View>
|
|
372
|
+
</View>
|
|
373
|
+
</Modal>
|
|
360
374
|
);
|
|
361
375
|
};
|
|
362
376
|
|
|
377
|
+
const styles = StyleSheet.create({
|
|
378
|
+
backdrop: {
|
|
379
|
+
flex: 1,
|
|
380
|
+
// Opaque, per the design: the chat list behind stays hidden rather
|
|
381
|
+
// than showing through a translucent dim.
|
|
382
|
+
backgroundColor: '#E9EDF2',
|
|
383
|
+
alignItems: 'center',
|
|
384
|
+
justifyContent: 'center',
|
|
385
|
+
padding: 24,
|
|
386
|
+
},
|
|
387
|
+
card: {
|
|
388
|
+
width: '100%',
|
|
389
|
+
maxWidth: 380,
|
|
390
|
+
borderRadius: 20,
|
|
391
|
+
backgroundColor: '#FFFFFF',
|
|
392
|
+
padding: 20,
|
|
393
|
+
shadowColor: '#121219',
|
|
394
|
+
shadowOffset: { width: 0, height: 8 },
|
|
395
|
+
shadowOpacity: 0.08,
|
|
396
|
+
shadowRadius: 24,
|
|
397
|
+
elevation: 6,
|
|
398
|
+
},
|
|
399
|
+
title: {
|
|
400
|
+
fontSize: 17,
|
|
401
|
+
fontWeight: '700',
|
|
402
|
+
color: '#141414',
|
|
403
|
+
textAlign: 'center',
|
|
404
|
+
},
|
|
405
|
+
picture: {
|
|
406
|
+
alignSelf: 'center',
|
|
407
|
+
width: 72,
|
|
408
|
+
height: 72,
|
|
409
|
+
borderRadius: 36,
|
|
410
|
+
marginVertical: 18,
|
|
411
|
+
alignItems: 'center',
|
|
412
|
+
justifyContent: 'center',
|
|
413
|
+
overflow: 'hidden',
|
|
414
|
+
},
|
|
415
|
+
pictureImage: {
|
|
416
|
+
width: '100%',
|
|
417
|
+
height: '100%',
|
|
418
|
+
},
|
|
419
|
+
input: {
|
|
420
|
+
borderRadius: 12,
|
|
421
|
+
backgroundColor: '#F4F5F7',
|
|
422
|
+
paddingHorizontal: 14,
|
|
423
|
+
paddingVertical: 12,
|
|
424
|
+
fontSize: 15,
|
|
425
|
+
color: '#141414',
|
|
426
|
+
marginTop: 10,
|
|
427
|
+
},
|
|
428
|
+
textArea: {
|
|
429
|
+
minHeight: 84,
|
|
430
|
+
textAlignVertical: 'top',
|
|
431
|
+
},
|
|
432
|
+
error: {
|
|
433
|
+
color: '#E53935',
|
|
434
|
+
fontSize: 12,
|
|
435
|
+
marginTop: 6,
|
|
436
|
+
marginLeft: 4,
|
|
437
|
+
},
|
|
438
|
+
buttons: {
|
|
439
|
+
flexDirection: 'row',
|
|
440
|
+
gap: 12,
|
|
441
|
+
marginTop: 20,
|
|
442
|
+
},
|
|
443
|
+
button: {
|
|
444
|
+
flex: 1,
|
|
445
|
+
height: 44,
|
|
446
|
+
borderRadius: 12,
|
|
447
|
+
alignItems: 'center',
|
|
448
|
+
justifyContent: 'center',
|
|
449
|
+
},
|
|
450
|
+
cancel: {
|
|
451
|
+
backgroundColor: '#E7E8EA',
|
|
452
|
+
},
|
|
453
|
+
cancelLabel: {
|
|
454
|
+
fontSize: 15,
|
|
455
|
+
fontWeight: '500',
|
|
456
|
+
color: '#8C8C8C',
|
|
457
|
+
},
|
|
458
|
+
submitLabel: {
|
|
459
|
+
fontSize: 15,
|
|
460
|
+
fontWeight: '600',
|
|
461
|
+
color: '#FFFFFF',
|
|
462
|
+
},
|
|
463
|
+
});
|
|
464
|
+
|
|
363
465
|
export default NewChatModal;
|