quickblox-react-ui-kit 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +288 -255
- package/dist/Presentation/Views/Dialogs/Dialogs.d.ts +3 -0
- package/dist/Presentation/Views/Dialogs/useDialogsViewModel.d.ts +3 -1
- package/dist/Presentation/{components/UI → assets}/ DefaultThemes/DefaultTheme.d.ts +2 -2
- package/dist/Presentation/assets/DarkTheme.d.ts +2 -2
- package/dist/Presentation/assets/LightTheme.d.ts +2 -2
- package/dist/Presentation/assets/{Theme.d.ts → UiKitTheme.d.ts} +1 -1
- package/dist/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.d.ts +2 -2
- package/dist/Presentation/components/UI/Dialogs/InviteMembers/InviteMembers.d.ts +2 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.d.ts +2 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/MessagesView.d.ts +2 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/{useMessagesViewModelWithMockUseCase.d.ts → useMessagesViewModel.d.ts} +1 -1
- package/dist/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.d.ts +2 -2
- package/dist/Presentation/components/layouts/Desktop/{DesktopLayoutForMockModels.d.ts → DesktopLayout.d.ts} +2 -2
- package/dist/Presentation/components/layouts/Desktop/QuickBloxUIKitDesktopLayout.d.ts +7 -0
- package/dist/index-ui.d.ts +6 -5
- package/dist/index-ui.js +49 -93
- package/package.json +9 -2
- package/.prettierignore +0 -4
- package/.prettierrc +0 -8
- package/dist/MyButton/MyButton.d.ts +0 -9
- package/dist/MyInput/MyInput.d.ts +0 -10
- package/dist/Presentation/Views/Dialogs/useDialogsViewModelWithMockUseCase.d.ts +0 -4
- package/dist/Presentation/components/layouts/Desktop/Desktop.d.ts +0 -4
- package/dist/Presentation/components/layouts/TestStage/TestStageWithMockData/TestStageWithMockData.d.ts +0 -3
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -47
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/quickblox.js +0 -54609
- package/public/robots.txt +0 -3
- package/src/App.scss +0 -0
- package/src/App.tsx +0 -230
- package/src/CommonTypes/FunctionResult.ts +0 -4
- package/src/Data/Stubs.ts +0 -1131
- package/src/Data/dto/dialog/LocalDialogDTO.ts +0 -42
- package/src/Data/dto/dialog/LocalDialogsDTO.ts +0 -21
- package/src/Data/dto/dialog/RemoteDialogDTO.ts +0 -58
- package/src/Data/dto/dialog/RemoteDialogsDTO.ts +0 -21
- package/src/Data/dto/file/LocalFileDTO.ts +0 -26
- package/src/Data/dto/file/RemoteFileDTO.ts +0 -26
- package/src/Data/dto/message/LocalMessageDTO.ts +0 -51
- package/src/Data/dto/message/LocalMessagesDTO.ts +0 -21
- package/src/Data/dto/message/RemoteMessageDTO.ts +0 -51
- package/src/Data/dto/message/RemoteMessagesDTO.ts +0 -21
- package/src/Data/dto/user/LocalUserDTO.ts +0 -37
- package/src/Data/dto/user/LocalUsersDTO.ts +0 -23
- package/src/Data/dto/user/RemoteUserDTO.ts +0 -37
- package/src/Data/dto/user/RemoteUsersDTO.ts +0 -21
- package/src/Data/mapper/DialogLocalDTOMapper.ts +0 -742
- package/src/Data/mapper/DialogRemoteDTOMapper.ts +0 -776
- package/src/Data/mapper/FileLocalDTOMapper.ts +0 -253
- package/src/Data/mapper/FileRemoteDTOMapper.ts +0 -265
- package/src/Data/mapper/IMapper.ts +0 -14
- package/src/Data/mapper/MessageLocalDTOMapper.ts +0 -425
- package/src/Data/mapper/MessageRemoteDTOMapper.ts +0 -430
- package/src/Data/mapper/UserLocalDTOMapper.ts +0 -381
- package/src/Data/mapper/UserRemoteDTOMapper.ts +0 -393
- package/src/Data/repository/ConnectionRepository.ts +0 -128
- package/src/Data/repository/DialogsRepository.ts +0 -422
- package/src/Data/repository/EventMessagesRepository.ts +0 -291
- package/src/Data/repository/FileRepository.ts +0 -110
- package/src/Data/repository/MessagesRepository.ts +0 -288
- package/src/Data/repository/UsersRepository.ts +0 -324
- package/src/Data/source/exception/LocalDataSourceException.ts +0 -17
- package/src/Data/source/exception/MapperDTOException.ts +0 -19
- package/src/Data/source/exception/RemoteDataSourceException.ts +0 -28
- package/src/Data/source/exception/RepositoryException.ts +0 -27
- package/src/Data/source/local/ChatLocalStorageDataSource.ts +0 -262
- package/src/Data/source/local/ILocalDataSource.ts +0 -45
- package/src/Data/source/local/ILocalFileDataSource.ts +0 -11
- package/src/Data/source/local/LocalDataSource.ts +0 -377
- package/src/Data/source/local/LocalFileDataSource.ts +0 -22
- package/src/Data/source/remote/IRemoteDataSource.ts +0 -112
- package/src/Data/source/remote/Mapper/DialogDTOMapper.ts +0 -401
- package/src/Data/source/remote/Mapper/FileDTOMapper.ts +0 -276
- package/src/Data/source/remote/Mapper/IDTOMapper.ts +0 -4
- package/src/Data/source/remote/Mapper/MessageDTOMapper.ts +0 -399
- package/src/Data/source/remote/Mapper/UserDTOMapper.ts +0 -344
- package/src/Data/source/remote/RemoteDataSource.ts +0 -1278
- package/src/Domain/entity/Chat.ts +0 -4
- package/src/Domain/entity/ChatMessageAttachmentEntity.ts +0 -15
- package/src/Domain/entity/CustomDataEntity.ts +0 -3
- package/src/Domain/entity/DialogEntity.ts +0 -15
- package/src/Domain/entity/DialogEventInfo.ts +0 -15
- package/src/Domain/entity/DialogTypes.ts +0 -7
- package/src/Domain/entity/EventMessageType.ts +0 -7
- package/src/Domain/entity/FileEntity.ts +0 -11
- package/src/Domain/entity/FileTypes.ts +0 -9
- package/src/Domain/entity/GroupDialogEntity.ts +0 -54
- package/src/Domain/entity/LastMessageEntity.ts +0 -5
- package/src/Domain/entity/MessageEntity.ts +0 -25
- package/src/Domain/entity/NotificationTypes.ts +0 -7
- package/src/Domain/entity/PrivateDialogEntity.ts +0 -46
- package/src/Domain/entity/PublicDialogEntity.ts +0 -72
- package/src/Domain/entity/UserEntity.ts +0 -22
- package/src/Domain/exception/domain/DomainExecption.ts +0 -5
- package/src/Domain/repository/IDialogsRepository.ts +0 -40
- package/src/Domain/repository/IFileRepository.ts +0 -9
- package/src/Domain/repository/IMessagesRepository.ts +0 -28
- package/src/Domain/repository/IUsersRepository.ts +0 -13
- package/src/Domain/repository/Pagination.ts +0 -48
- package/src/Domain/use_cases/CreateDialogUseCase.ts +0 -73
- package/src/Domain/use_cases/GetAllDialogsUseCase.ts +0 -20
- package/src/Domain/use_cases/GetAllDialogsUseCaseWithMock.ts +0 -45
- package/src/Domain/use_cases/GetAllMessagesForDialog.ts +0 -61
- package/src/Domain/use_cases/GetAllUsersUseCase.ts +0 -34
- package/src/Domain/use_cases/GetDialogByIdUseCase.ts +0 -28
- package/src/Domain/use_cases/GetUsersByIdsUseCase.ts +0 -22
- package/src/Domain/use_cases/LeaveDialogUseCase.ts +0 -109
- package/src/Domain/use_cases/RemoveUsersFromTheDialogUseCase.ts +0 -103
- package/src/Domain/use_cases/SendTextMessageUseCase.ts +0 -26
- package/src/Domain/use_cases/SubscribeToDialogEventsUseCase.ts +0 -141
- package/src/Domain/use_cases/SubscribeToDialogsUpdatesUseCase.ts +0 -69
- package/src/Domain/use_cases/SubscribeToDialogsUpdatesUseCaseWithMock.ts +0 -61
- package/src/Domain/use_cases/SyncDialogsUseCase.ts +0 -246
- package/src/Domain/use_cases/UpdateDialogUseCase.ts +0 -65
- package/src/Domain/use_cases/UploadFileUseCase.ts +0 -24
- package/src/Domain/use_cases/UserTypingMessageUseCase.ts +0 -51
- package/src/Domain/use_cases/base/BaseUseCase.ts +0 -77
- package/src/Domain/use_cases/base/IUseCase.ts +0 -5
- package/src/Domain/use_cases/base/Subscribable/ISubscribable.ts +0 -6
- package/src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts +0 -143
- package/src/MyButton/MyButton.scss +0 -11
- package/src/MyButton/MyButton.tsx +0 -25
- package/src/MyInput/MyInput.scss +0 -9
- package/src/MyInput/MyInput.tsx +0 -36
- package/src/Presentation/.gitkeep +0 -0
- package/src/Presentation/Views/Base/BaseViewModel.ts +0 -66
- package/src/Presentation/Views/CreateDialogFlow/CreateNewDialogFlow.tsx +0 -187
- package/src/Presentation/Views/Dialogs/DialogViewModel.ts +0 -23
- package/src/Presentation/Views/Dialogs/Dialogs.scss +0 -66
- package/src/Presentation/Views/Dialogs/Dialogs.tsx +0 -372
- package/src/Presentation/Views/Dialogs/useDialogsViewModel.ts +0 -136
- package/src/Presentation/Views/Dialogs/useDialogsViewModelWithMockUseCase.ts +0 -345
- package/src/Presentation/Views/Navigation/More.svg +0 -7
- package/src/Presentation/assets/DarkTheme.ts +0 -58
- package/src/Presentation/assets/LightTheme.ts +0 -58
- package/src/Presentation/assets/Theme.ts +0 -143
- package/src/Presentation/assets/ThemeScheme.ts +0 -83
- package/src/Presentation/assets/fonts/.gitkeep +0 -0
- package/src/Presentation/assets/fonts/Roboto-Bold.eot +0 -0
- package/src/Presentation/assets/fonts/Roboto-Bold.ttf +0 -0
- package/src/Presentation/assets/fonts/Roboto-Bold.woff +0 -0
- package/src/Presentation/assets/fonts/Roboto-Bold.woff2 +0 -0
- package/src/Presentation/assets/fonts/Roboto-Medium.eot +0 -0
- package/src/Presentation/assets/fonts/Roboto-Medium.ttf +0 -0
- package/src/Presentation/assets/fonts/Roboto-Medium.woff +0 -0
- package/src/Presentation/assets/fonts/Roboto-Medium.woff2 +0 -0
- package/src/Presentation/assets/fonts/Roboto-Regular.eot +0 -0
- package/src/Presentation/assets/fonts/Roboto-Regular.ttf +0 -0
- package/src/Presentation/assets/fonts/Roboto-Regular.woff +0 -0
- package/src/Presentation/assets/fonts/Roboto-Regular.woff2 +0 -0
- package/src/Presentation/assets/img/Artem_Koltunov_Selfi.png +0 -0
- package/src/Presentation/assets/img/bee-img.png +0 -0
- package/src/Presentation/assets/styles/_fonts.scss +0 -32
- package/src/Presentation/assets/styles/_reset-styles.scss +0 -435
- package/src/Presentation/assets/styles/_theme_colors_scheme.scss +0 -56
- package/src/Presentation/assets/styles/_theme_dark.scss +0 -33
- package/src/Presentation/assets/styles/_theme_light.scss +0 -33
- package/src/Presentation/assets/styles/_variables.scss +0 -2
- package/src/Presentation/components/Button.js +0 -5
- package/src/Presentation/components/Navbar.tsx +0 -45
- package/src/Presentation/components/TextInput.js +0 -10
- package/src/Presentation/components/UI/ DefaultThemes/CustomTheme.ts +0 -13
- package/src/Presentation/components/UI/ DefaultThemes/DefaultTheme.ts +0 -58
- package/src/Presentation/components/UI/Buttons/ActiveButton/ActiveButton.tsx +0 -40
- package/src/Presentation/components/UI/Buttons/MainBoundedButton/MainBoundedButton.scss +0 -0
- package/src/Presentation/components/UI/Buttons/MainBoundedButton/MainBoundedButton.tsx +0 -30
- package/src/Presentation/components/UI/Buttons/MainButton/MainButton.scss +0 -127
- package/src/Presentation/components/UI/Buttons/MainButton/MainButton.tsx +0 -62
- package/src/Presentation/components/UI/Dialogs/CreateDialog/CreateDialog.scss +0 -45
- package/src/Presentation/components/UI/Dialogs/CreateDialog/CreateDialog.tsx +0 -77
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogInformation.scss +0 -429
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogInformation.tsx +0 -646
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogMemberButton/DialogMembersButton.scss +0 -42
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogMemberButton/DialogMembersButton.tsx +0 -26
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/SingleUser/SingleUser.scss +0 -95
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/SingleUser/SingleUser.tsx +0 -42
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/UsersList.scss +0 -60
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/UsersList.tsx +0 -65
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/UsersListViewModel.ts +0 -13
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/useUsersListViewModel.ts +0 -81
- package/src/Presentation/components/UI/Dialogs/EditDialog/EditDialog.scss +0 -183
- package/src/Presentation/components/UI/Dialogs/EditDialog/EditDialog.tsx +0 -262
- package/src/Presentation/components/UI/Dialogs/EditDialog/UserAvatar/UserAvatar.scss +0 -32
- package/src/Presentation/components/UI/Dialogs/EditDialog/UserAvatar/UserAvatar.tsx +0 -59
- package/src/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.scss +0 -67
- package/src/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.tsx +0 -112
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteMembers.scss +0 -146
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteMembers.tsx +0 -374
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteMembersViewModel.ts +0 -18
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteUsersList/SingleUserWithCheckBox/SingleUserWithCheckBox.scss +0 -113
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteUsersList/SingleUserWithCheckBox/SingleUserWithCheckBox.tsx +0 -87
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteUsersResultViewModel.ts +0 -12
- package/src/Presentation/components/UI/Dialogs/InviteMembers/NotFoundContent/NotFoundContent.scss +0 -37
- package/src/Presentation/components/UI/Dialogs/InviteMembers/NotFoundContent/NotFoundContent.tsx +0 -22
- package/src/Presentation/components/UI/Dialogs/InviteMembers/useInviteMembersViewModel.ts +0 -116
- package/src/Presentation/components/UI/Dialogs/MembersList/MembersList.scss +0 -128
- package/src/Presentation/components/UI/Dialogs/MembersList/MembersList.tsx +0 -89
- package/src/Presentation/components/UI/Dialogs/MessagesView/AudioAttachmentComponent/AudioAttachmentComponent.scss +0 -7
- package/src/Presentation/components/UI/Dialogs/MessagesView/AudioAttachmentComponent/AudioAttachmentComponent.tsx +0 -27
- package/src/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.scss +0 -133
- package/src/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.tsx +0 -137
- package/src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.scss +0 -11
- package/src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.tsx +0 -25
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.scss +0 -327
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.tsx +0 -794
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesViewModel.ts +0 -20
- package/src/Presentation/components/UI/Dialogs/MessagesView/VideoAttachmentComponent/VideoAttachmentComponent.scss +0 -7
- package/src/Presentation/components/UI/Dialogs/MessagesView/VideoAttachmentComponent/VideoAttachmentComponent.tsx +0 -33
- package/src/Presentation/components/UI/Dialogs/MessagesView/VoiceRecordingProgress/VoiceRecordingProgress.scss +0 -35
- package/src/Presentation/components/UI/Dialogs/MessagesView/VoiceRecordingProgress/VoiceRecordingProgress.tsx +0 -86
- package/src/Presentation/components/UI/Dialogs/MessagesView/useMessagesViewModelWithMockUseCase.ts +0 -452
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.scss +0 -100
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.tsx +0 -405
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialogViewModel.ts +0 -42
- package/src/Presentation/components/UI/Dialogs/YesNoQuestion/YesNoQuestion.scss +0 -35
- package/src/Presentation/components/UI/Dialogs/YesNoQuestion/YesNoQuestion.tsx +0 -89
- package/src/Presentation/components/UI/Elements/SwitchButton/SwitchButton.scss +0 -61
- package/src/Presentation/components/UI/Elements/SwitchButton/SwitchButton.tsx +0 -48
- package/src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.scss +0 -74
- package/src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.tsx +0 -72
- package/src/Presentation/components/UI/Placeholders/LoaderComponent/LoaderComponent.scss +0 -21
- package/src/Presentation/components/UI/Placeholders/LoaderComponent/LoaderComponent.tsx +0 -41
- package/src/Presentation/components/UI/svgs/ActiveSvg/ActiveSvg.scss +0 -3
- package/src/Presentation/components/UI/svgs/ActiveSvg/ActiveSvg.tsx +0 -41
- package/src/Presentation/components/UI/svgs/Icons/Actions/Add/Add.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Add/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/AddContact/Add contact.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/AddContact/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Archive/Archive.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Archive/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Copy/Copy.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Copy/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Delete/Delete.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Delete/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Download/Download.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Download/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Edit/Edit.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Edit/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/EditDots/EditDots.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/EditDots/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Emoji/Emoji.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Emoji/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/ForwardFilled/Forward filled.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/ForwardFilled/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Hungup/Hungup.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Hungup/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/IncomeCall/Income call.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/IncomeCall/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Like/Like.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Like/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/NewChat/New chat.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/NewChat/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/OutcomeCall/Outcome call.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/OutcomeCall/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Phone/Phone.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Phone/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Actions/PhoneFilled/Phone filled.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/PhoneFilled/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove/Remove.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove2/Remove2.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove2/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/ReplyFilled/Reply filled.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/ReplyFilled/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Send/Send.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Send/index.tsx +0 -38
- package/src/Presentation/components/UI/svgs/Icons/Actions/Share/Share.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Share/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/SwapCamera/Swap camera.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/SwapCamera/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Unarchive/Unarchive.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Unarchive/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/VideoIcon/Video.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/VideoIcon/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Actions/Voice/Voice.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Actions/Voice/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Contents/Brodcast/Broadcast.svg +0 -7
- package/src/Presentation/components/UI/svgs/Icons/Contents/Brodcast/index.tsx +0 -38
- package/src/Presentation/components/UI/svgs/Icons/Contents/Chat/Chat.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Contents/Chat/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Contents/ChatFilled/Chat filled.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Contents/ChatFilled/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Contents/Conference/Conference.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Contents/Conference/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Contents/Contact/Contact.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Contents/Contact/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Contents/ContactFilled/Contact filled.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Contents/ContactFilled/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Contents/GroupChat/Group chat.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Contents/GroupChat/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Contents/Notifications/Notifications.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Contents/Notifications/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Contents/PrivateChat/Private chat.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Contents/PrivateChat/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Contents/PublicChannel/Public channel.svg +0 -7
- package/src/Presentation/components/UI/svgs/Icons/Contents/PublicChannel/index.tsx +0 -67
- package/src/Presentation/components/UI/svgs/Icons/Contents/Stream/Stream.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Contents/Stream/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Contents/StreamFilled/Stream filled.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Contents/StreamFilled/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Contents/User/User.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Contents/User/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/IconsCommonTypes.ts +0 -6
- package/src/Presentation/components/UI/svgs/Icons/Media/Attachment/Attachment.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Media/Attachment/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Media/AudioFile/Audio file.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Media/AudioFile/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Media/BrokenFile/Broken file.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Media/BrokenFile/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Media/Camera/Camera.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Media/Camera/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Media/GifFile/GIF file.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Media/GifFile/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/Image.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFile/File.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFile/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFilled/Image filled.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFilled/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Media/LinkWeb/Link.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Media/LinkWeb/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Media/Location/Location.svg +0 -4
- package/src/Presentation/components/UI/svgs/Icons/Media/Location/index.tsx +0 -26
- package/src/Presentation/components/UI/svgs/Icons/Media/TextDocument/Text document.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Media/TextDocument/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Media/VideoFile/Video file.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Media/VideoFile/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Admin/Admin.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Admin/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Banned/Banned.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Banned/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Freeze/Freeze.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Freeze/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Moderations/Moderations.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Moderations/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Muted/Muted.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Muted/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowLeft/Arrow left.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowLeft/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowRight/Arrow right.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowRight/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Back/Back.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Back/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Close/Close.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Close/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Down/Down.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Down/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Leave/Leave.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Leave/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Navigation/More/More.svg +0 -7
- package/src/Presentation/components/UI/svgs/Icons/Navigation/More/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Next/Next.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Next/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Plus/Plus.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Plus/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Refresh/Refresh.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Refresh/index.tsx +0 -36
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Search/Search.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Search/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Settings/Settings.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Settings/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Navigation/SettingsField/Settings filled.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Navigation/SettingsField/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Status/Error/Error.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Status/Error/index.tsx +0 -36
- package/src/Presentation/components/UI/svgs/Icons/Status/Help/Help.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Status/Help/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Status/Information/Information.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Status/Information/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Status/InformationFill/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Status/Loader/Loader.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Status/Loader/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Status/Mention/Mention.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Status/Mention/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Status/Sent/Sent.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Status/Sent/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/Viewed_Delivered.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/index.tsx +0 -38
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOff/Camera off.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOff/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOn/Camera on.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOn/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOff/Check off.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOff/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOn/Check on.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOn/index.tsx +0 -24
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Favourite/Favourite.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Favourite/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FavouriteFilled/Favourite filled.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FavouriteFilled/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FullScreen/Full screen.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FullScreen/inex.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Hide/Hide.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Hide/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/Play.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Louder/Louder.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Louder/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOff/Mic off.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOff/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOn/Mic on.svg +0 -4
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOn/index.tsx +0 -26
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Minimize/Minimize.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Minimize/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOff/Notify off.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOff/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOn/Notify on.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOn/index.tsx +0 -35
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Pause/Pause.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Pause/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Quite/Quite.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Quite/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Record/Record.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Record/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Screenshare/Screenshare.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Screenshare/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Show/Show.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Show/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Speaker/Speaker.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Speaker/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/SpeakerOff/Speaker off.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/SpeakerOff/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopRecord/Stop record.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopRecord/index.tsx +0 -22
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopShare/Stop share.svg +0 -3
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopShare/index.tsx +0 -22
- package/src/Presentation/components/containers/ColumnContainer/ColumnContainer.scss +0 -6
- package/src/Presentation/components/containers/ColumnContainer/ColumnContainer.tsx +0 -24
- package/src/Presentation/components/containers/RowCenterContainer/RowCenterContainer.scss +0 -45
- package/src/Presentation/components/containers/RowCenterContainer/RowCenterContainer.tsx +0 -95
- package/src/Presentation/components/containers/RowLeftContainer/RowLeftContainer.scss +0 -45
- package/src/Presentation/components/containers/RowLeftContainer/RowLeftContainer.tsx +0 -97
- package/src/Presentation/components/containers/RowRightContainer/RowRightContainer.scss +0 -46
- package/src/Presentation/components/containers/RowRightContainer/RowRightContainer.tsx +0 -97
- package/src/Presentation/components/containers/ScrollableContainer/ScrollableContainer.scss +0 -46
- package/src/Presentation/components/containers/ScrollableContainer/ScrollableContainer.tsx +0 -85
- package/src/Presentation/components/layouts/Desktop/Desktop.tsx +0 -103
- package/src/Presentation/components/layouts/Desktop/DesktopLayout.scss +0 -31
- package/src/Presentation/components/layouts/Desktop/DesktopLayoutForMockModels.tsx +0 -31
- package/src/Presentation/components/layouts/LayoutCommonTypes.ts +0 -7
- package/src/Presentation/components/layouts/TestStage/LoginView/Login.scss +0 -71
- package/src/Presentation/components/layouts/TestStage/LoginView/Login.tsx +0 -116
- package/src/Presentation/components/layouts/TestStage/TestStageMarkup.scss +0 -24
- package/src/Presentation/components/layouts/TestStage/TestStageMarkup.tsx +0 -1109
- package/src/Presentation/components/layouts/TestStage/TestStageWithMockData/TestStageWithMockData.tsx +0 -209
- package/src/Presentation/components/providers/ModalContextProvider/Modal.scss +0 -71
- package/src/Presentation/components/providers/ModalContextProvider/Modal.tsx +0 -131
- package/src/Presentation/components/providers/ModalContextProvider/ModalContextProvider.tsx +0 -38
- package/src/Presentation/components/providers/ModalContextProvider/useModal.ts +0 -39
- package/src/Presentation/components/providers/ProviderProps.ts +0 -5
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +0 -255
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/useEventMessagesRepository.ts +0 -10
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/useQBConnection.ts +0 -38
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/useQbDataContext.ts +0 -82
- package/src/QBconfig.ts +0 -41
- package/src/index-ui.ts +0 -60
- package/src/index.scss +0 -74
- package/src/index.tsx +0 -25
- package/src/logo.svg +0 -1
- package/src/qb-api-calls/index.ts +0 -543
- package/src/react-app-env.d.ts +0 -1
- package/src/setupTests.ts +0 -5
- package/src/utils/DateTimeFormatter.ts +0 -35
- package/src/utils/parse.ts +0 -74
- package/tsconfig.json +0 -33
- package/typedoc.json +0 -4
- package/webpack.config.js +0 -56
- /package/dist/Presentation/{components/UI → assets}/ DefaultThemes/CustomTheme.d.ts +0 -0
|
@@ -1,794 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import './MessagesView.scss';
|
|
3
|
-
import { DialogEntity } from '../../../../../Domain/entity/DialogEntity';
|
|
4
|
-
import useQBConnection from '../../../providers/QuickBloxUIKitProvider/useQBConnection';
|
|
5
|
-
import ScrollableContainer from '../../../containers/ScrollableContainer/ScrollableContainer';
|
|
6
|
-
import { MessageEntity } from '../../../../../Domain/entity/MessageEntity';
|
|
7
|
-
import ChatMessageAttachmentEntity from '../../../../../Domain/entity/ChatMessageAttachmentEntity';
|
|
8
|
-
import { FileType } from '../../../../../Domain/entity/FileTypes';
|
|
9
|
-
import ImageEmpty from '../../svgs/Icons/Media/ImageEmpty';
|
|
10
|
-
import ImagePlay from '../../svgs/Icons/Toggle/ImagePlay';
|
|
11
|
-
import ColumnContainer from '../../../containers/ColumnContainer/ColumnContainer';
|
|
12
|
-
import ImageFile from '../../svgs/Icons/Media/ImageFile';
|
|
13
|
-
import { MessagesViewModel } from './MessagesViewModel';
|
|
14
|
-
import useMessagesViewModelWithMockUseCase from './useMessagesViewModelWithMockUseCase';
|
|
15
|
-
import LoaderComponent from '../../Placeholders/LoaderComponent/LoaderComponent';
|
|
16
|
-
import ErrorComponent from '../../Placeholders/ErrorComponent/ErrorComponent';
|
|
17
|
-
import HeaderMessages from './HeaderMessages/HeaderMessages';
|
|
18
|
-
import { FunctionTypeVoidToVoid } from '../../../../Views/Base/BaseViewModel';
|
|
19
|
-
import VideoAttachmentComponent from './VideoAttachmentComponent/VideoAttachmentComponent';
|
|
20
|
-
import ImageAttachmentComponent from './ImageAttachmentComponent/ImageAttachmentComponent';
|
|
21
|
-
import { DialogType } from '../../../../../Domain/entity/DialogTypes';
|
|
22
|
-
import { GroupDialogEntity } from '../../../../../Domain/entity/GroupDialogEntity';
|
|
23
|
-
import { PrivateDialogEntity } from '../../../../../Domain/entity/PrivateDialogEntity';
|
|
24
|
-
import { UserEntity } from '../../../../../Domain/entity/UserEntity';
|
|
25
|
-
import useQbDataContext from '../../../providers/QuickBloxUIKitProvider/useQbDataContext';
|
|
26
|
-
import { Pagination } from '../../../../../Domain/repository/Pagination';
|
|
27
|
-
import {
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
|
-
getDateShortFormatEU,
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
|
-
formatShortTime3,
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33
|
-
formatShortTime4,
|
|
34
|
-
getTimeShort24hFormat,
|
|
35
|
-
} from '../../../../../utils/DateTimeFormatter';
|
|
36
|
-
import User from '../../svgs/Icons/Contents/User';
|
|
37
|
-
import ActiveSvg from '../../svgs/ActiveSvg/ActiveSvg';
|
|
38
|
-
import AttachmentIcon from '../../svgs/Icons/Media/Attachment';
|
|
39
|
-
import SendIcon from '../../svgs/Icons/Actions/Send';
|
|
40
|
-
import AudioAttachmentComponent from './AudioAttachmentComponent/AudioAttachmentComponent';
|
|
41
|
-
import AudioFile from '../../svgs/Icons/Media/AudioFile';
|
|
42
|
-
import VoiceIcon from '../../svgs/Icons/Actions/Voice';
|
|
43
|
-
import SentStatusIcon from '../../svgs/Icons/Status/Sent';
|
|
44
|
-
import ViewedDelivered from '../../svgs/Icons/Status/ViewedDelivered';
|
|
45
|
-
import { stringifyError } from '../../../../../utils/parse';
|
|
46
|
-
import VoiceRecordingProgress from './VoiceRecordingProgress/VoiceRecordingProgress';
|
|
47
|
-
|
|
48
|
-
type HeaderDialogsMessagesProps = {
|
|
49
|
-
dialog: DialogEntity;
|
|
50
|
-
InformationHandler?: FunctionTypeVoidToVoid;
|
|
51
|
-
maxWidthToResize?: string;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// eslint-disable-next-line react/function-component-definition
|
|
55
|
-
const MessagesView: React.FC<HeaderDialogsMessagesProps> = ({
|
|
56
|
-
dialog,
|
|
57
|
-
InformationHandler,
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
59
|
-
maxWidthToResize = undefined,
|
|
60
|
-
}: HeaderDialogsMessagesProps) => {
|
|
61
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
62
|
-
const maxWidthToResizing =
|
|
63
|
-
maxWidthToResize || '$message-view-container-wrapper-min-width';
|
|
64
|
-
// const maxWidthToResizing = '720px'; // $message-view-container-wrapper-min-width:
|
|
65
|
-
|
|
66
|
-
const currentContext = useQbDataContext();
|
|
67
|
-
const currentUserId =
|
|
68
|
-
currentContext.storage.REMOTE_DATA_SOURCE.authInformation?.userId;
|
|
69
|
-
const currentUserName =
|
|
70
|
-
currentContext.storage.REMOTE_DATA_SOURCE.authInformation?.userName;
|
|
71
|
-
const { connectionRepository, browserOnline } = useQBConnection();
|
|
72
|
-
const [dialogMessagesCount, setDialogMessageCount] = useState(100);
|
|
73
|
-
const [hasMore, setHasMore] = React.useState(true);
|
|
74
|
-
const [scrollUpToDown, setScrollUpToDown] = React.useState(false);
|
|
75
|
-
const [messagesToView, setMessagesToView] = React.useState<MessageEntity[]>(
|
|
76
|
-
[],
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
const messagesViewModel: MessagesViewModel =
|
|
80
|
-
useMessagesViewModelWithMockUseCase(dialog.type, dialog);
|
|
81
|
-
|
|
82
|
-
useEffect(() => {
|
|
83
|
-
console.log('HAVE NEW DIALOG');
|
|
84
|
-
// messagesViewModel.getMessages(new Pagination());
|
|
85
|
-
messagesViewModel.entity = dialog;
|
|
86
|
-
setMessagesToView([]);
|
|
87
|
-
}, [dialog]);
|
|
88
|
-
|
|
89
|
-
useEffect(() => {
|
|
90
|
-
console.log('HAVE NEW ENTITY');
|
|
91
|
-
messagesViewModel.getMessages(new Pagination());
|
|
92
|
-
}, [messagesViewModel.entity]);
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
function prepareFirstPage(initData: MessageEntity[]) {
|
|
96
|
-
const firstPageSize =
|
|
97
|
-
messagesViewModel.messages.length < 47
|
|
98
|
-
? messagesViewModel.messages.length
|
|
99
|
-
: 47;
|
|
100
|
-
|
|
101
|
-
// for (let i = 0; i < firstPageSize; i += 1) {
|
|
102
|
-
for (let i = firstPageSize - 1; i >= 0; i -= 1) {
|
|
103
|
-
initData.push(messagesViewModel.messages[i]);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const fetchMoreData = () => {
|
|
108
|
-
if (messagesToView.length >= dialogMessagesCount) {
|
|
109
|
-
setHasMore(false);
|
|
110
|
-
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
if (
|
|
114
|
-
hasMore &&
|
|
115
|
-
messagesToView.length > 0 &&
|
|
116
|
-
messagesToView.length < dialogMessagesCount
|
|
117
|
-
) {
|
|
118
|
-
setMessagesToView((prevState) => {
|
|
119
|
-
const newState = [...prevState];
|
|
120
|
-
|
|
121
|
-
const newMessageEntity: MessageEntity =
|
|
122
|
-
messagesViewModel.messages[prevState.length];
|
|
123
|
-
|
|
124
|
-
newState.push(newMessageEntity);
|
|
125
|
-
|
|
126
|
-
return newState;
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
//
|
|
132
|
-
useEffect(() => {
|
|
133
|
-
console.log('Messages have changed');
|
|
134
|
-
setDialogMessageCount(messagesViewModel?.messages?.length || 0);
|
|
135
|
-
if (messagesToView?.length === 0 && messagesViewModel.messages.length > 0) {
|
|
136
|
-
// setDialogMessageCount(messagesViewModel.messages.length);
|
|
137
|
-
const initData: MessageEntity[] = [];
|
|
138
|
-
|
|
139
|
-
console.log(JSON.stringify(messagesViewModel.messages));
|
|
140
|
-
prepareFirstPage(initData);
|
|
141
|
-
setMessagesToView(initData);
|
|
142
|
-
} else if (messagesViewModel.messages.length - messagesToView.length >= 1) {
|
|
143
|
-
setHasMore(true);
|
|
144
|
-
setScrollUpToDown(true);
|
|
145
|
-
}
|
|
146
|
-
}, [messagesViewModel.messages]);
|
|
147
|
-
//
|
|
148
|
-
useEffect(() => {
|
|
149
|
-
console.log('dialogMessagesCount have changed');
|
|
150
|
-
if (messagesViewModel.messages.length - messagesToView.length >= 1) {
|
|
151
|
-
fetchMoreData();
|
|
152
|
-
}
|
|
153
|
-
}, [dialogMessagesCount]);
|
|
154
|
-
//
|
|
155
|
-
|
|
156
|
-
const getSenderName = (sender?: UserEntity): string | undefined => {
|
|
157
|
-
if (!sender) return undefined;
|
|
158
|
-
|
|
159
|
-
return (
|
|
160
|
-
sender.full_name || sender.login || sender.email || sender.id.toString()
|
|
161
|
-
);
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
const renderMessage = (message: MessageEntity, index: number) => {
|
|
165
|
-
const SystemMessage = 'SystemMessage';
|
|
166
|
-
const IncomingMessage = 'IncomingMessage';
|
|
167
|
-
const OutgoingMessage = 'OutgoingMessage';
|
|
168
|
-
|
|
169
|
-
console.log('render message: ', JSON.stringify(message), ' index: ', index);
|
|
170
|
-
let messageView: JSX.Element;
|
|
171
|
-
const checkMessageType = (m: MessageEntity): string => {
|
|
172
|
-
if (m.notification_type && m.notification_type.length > 0) {
|
|
173
|
-
return SystemMessage;
|
|
174
|
-
}
|
|
175
|
-
if (m.sender && m.sender.id !== currentUserId) {
|
|
176
|
-
return IncomingMessage;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return OutgoingMessage;
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
const messageTypes: string = checkMessageType(message);
|
|
183
|
-
|
|
184
|
-
const messageContentRender = (mc: MessageEntity) => {
|
|
185
|
-
const messageText = <div>{mc.message}</div>;
|
|
186
|
-
let messageContent: JSX.Element = messageText;
|
|
187
|
-
|
|
188
|
-
const attachmentContentRender = (att: ChatMessageAttachmentEntity) => {
|
|
189
|
-
let contentPlaceHolder: JSX.Element = <div>{att.type.toString()}</div>;
|
|
190
|
-
|
|
191
|
-
if (att.type.toString().includes(FileType.video)) {
|
|
192
|
-
contentPlaceHolder = att.file ? (
|
|
193
|
-
<VideoAttachmentComponent videoFile={att.file} />
|
|
194
|
-
) : (
|
|
195
|
-
<ImagePlay />
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
if (att.type.toString().includes(FileType.audio)) {
|
|
199
|
-
contentPlaceHolder = att.file ? (
|
|
200
|
-
<AudioAttachmentComponent audioFile={att.file} />
|
|
201
|
-
) : (
|
|
202
|
-
<AudioFile />
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
if (att.type.toString().includes(FileType.image)) {
|
|
206
|
-
contentPlaceHolder = att.file ? (
|
|
207
|
-
<ImageAttachmentComponent imageFile={att.file} />
|
|
208
|
-
) : (
|
|
209
|
-
<ImageEmpty />
|
|
210
|
-
);
|
|
211
|
-
}
|
|
212
|
-
if (att.type.toString().includes(FileType.text)) {
|
|
213
|
-
contentPlaceHolder = att.file ? (
|
|
214
|
-
<div>TEXT</div>
|
|
215
|
-
) : (
|
|
216
|
-
<ImageFile applyZoom />
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
let contentResult: JSX.Element = (
|
|
220
|
-
<div className="message-view-container--message-content-wrapper">
|
|
221
|
-
{contentPlaceHolder}
|
|
222
|
-
</div>
|
|
223
|
-
);
|
|
224
|
-
|
|
225
|
-
if (att.type === FileType.text) {
|
|
226
|
-
contentResult = (
|
|
227
|
-
<div className="message-view-container--file-message-content-wrapper">
|
|
228
|
-
<div className="message-view-container__file-message-icon">
|
|
229
|
-
{contentPlaceHolder}
|
|
230
|
-
</div>
|
|
231
|
-
<div>{att.name || 'file'}</div>
|
|
232
|
-
</div>
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
return contentResult;
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
if (mc.attachments && mc.attachments.length > 0) {
|
|
240
|
-
messageContent = (
|
|
241
|
-
<ColumnContainer maxWidth="100%">
|
|
242
|
-
{mc.attachments.map((attachment) =>
|
|
243
|
-
attachmentContentRender(attachment),
|
|
244
|
-
)}
|
|
245
|
-
{messageText}
|
|
246
|
-
</ColumnContainer>
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return messageContent;
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
if (messageTypes === SystemMessage) {
|
|
254
|
-
messageView = (
|
|
255
|
-
<div
|
|
256
|
-
className="message-view-container--system-message-wrapper"
|
|
257
|
-
key={message.id}
|
|
258
|
-
>
|
|
259
|
-
<div className="message-view-container--system-message-wrapper__date_container">
|
|
260
|
-
<div>{getDateShortFormatEU(message.date_sent)},</div>
|
|
261
|
-
</div>
|
|
262
|
-
{/* <div>{getTimeShort24hFormat(message.date_sent)}</div> */}
|
|
263
|
-
<div>{message.message}</div>
|
|
264
|
-
</div>
|
|
265
|
-
);
|
|
266
|
-
} else if (messageTypes === IncomingMessage) {
|
|
267
|
-
messageView = (
|
|
268
|
-
<div
|
|
269
|
-
className="message-view-container--incoming-message-wrapper"
|
|
270
|
-
key={message.id}
|
|
271
|
-
>
|
|
272
|
-
<div className="message-view-container--incoming-message-wrapper__avatar">
|
|
273
|
-
<div className="message-view-container__sender-avatar">
|
|
274
|
-
<User
|
|
275
|
-
width="24"
|
|
276
|
-
height="24"
|
|
277
|
-
applyZoom
|
|
278
|
-
color="var(--secondary-text)"
|
|
279
|
-
/>
|
|
280
|
-
</div>
|
|
281
|
-
</div>
|
|
282
|
-
<div className="message-view-container--incoming-message-container">
|
|
283
|
-
<div className="message-view-container__sender-name">
|
|
284
|
-
{getSenderName(message.sender) || message.sender_id.toString()}
|
|
285
|
-
</div>
|
|
286
|
-
<div className="message-view-container__sender-message">
|
|
287
|
-
{messageContentRender(message)}
|
|
288
|
-
</div>
|
|
289
|
-
</div>
|
|
290
|
-
<div className="message-view-container__incoming-time">
|
|
291
|
-
{getTimeShort24hFormat(message.date_sent)}
|
|
292
|
-
</div>
|
|
293
|
-
</div>
|
|
294
|
-
);
|
|
295
|
-
} else {
|
|
296
|
-
messageView = (
|
|
297
|
-
<div
|
|
298
|
-
className="message-view-container--outgoing-message-wrapper"
|
|
299
|
-
key={message.id}
|
|
300
|
-
>
|
|
301
|
-
<div className="message-view-container__status-message">
|
|
302
|
-
<div className="message-view-container__incoming-time">
|
|
303
|
-
{message.delivered_ids && message.delivered_ids.length > 0 ? (
|
|
304
|
-
<ViewedDelivered width="13" height="13" applyZoom />
|
|
305
|
-
) : (
|
|
306
|
-
<SentStatusIcon width="13" height="13" applyZoom />
|
|
307
|
-
)}
|
|
308
|
-
</div>
|
|
309
|
-
<div className="message-view-container__incoming-time">
|
|
310
|
-
{getTimeShort24hFormat(message.date_sent)}
|
|
311
|
-
</div>
|
|
312
|
-
</div>
|
|
313
|
-
|
|
314
|
-
<div className="message-view-container__outgoing-message">
|
|
315
|
-
{messageContentRender(message)}
|
|
316
|
-
</div>
|
|
317
|
-
</div>
|
|
318
|
-
);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
return messageView;
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
const getCountDialogMembers = (dialogEntity: DialogEntity): number => {
|
|
325
|
-
let participants = [];
|
|
326
|
-
|
|
327
|
-
if (dialogEntity.type === DialogType.group) {
|
|
328
|
-
participants = (dialogEntity as GroupDialogEntity).participantIds;
|
|
329
|
-
} else if (dialogEntity.type === DialogType.private) {
|
|
330
|
-
participants = [(dialogEntity as PrivateDialogEntity).participantId];
|
|
331
|
-
} else if (dialogEntity.type === DialogType.public) {
|
|
332
|
-
participants = [];
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
return participants.length;
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
const [fileToSend, setFileToSend] = useState<File | null>(null);
|
|
339
|
-
const [messageText, setMessageText] = useState<string>('');
|
|
340
|
-
const [warningErrorText, setWarningErrorText] = useState<string>('');
|
|
341
|
-
|
|
342
|
-
useEffect(() => {
|
|
343
|
-
setWarningErrorText(messagesViewModel.typingText);
|
|
344
|
-
}, [messagesViewModel.typingText]);
|
|
345
|
-
|
|
346
|
-
const ChangeFileHandler = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
347
|
-
const reader = new FileReader();
|
|
348
|
-
const file = event.currentTarget.files
|
|
349
|
-
? event.currentTarget.files[0]
|
|
350
|
-
: null;
|
|
351
|
-
|
|
352
|
-
reader.onloadend = () => {
|
|
353
|
-
setFileToSend(file);
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
if (file !== null) reader.readAsDataURL(file);
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
const showErrorMessage = (errorMessage: string) => {
|
|
360
|
-
setWarningErrorText(errorMessage);
|
|
361
|
-
setTimeout(() => {
|
|
362
|
-
setWarningErrorText('');
|
|
363
|
-
}, 3000);
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
useEffect(() => {
|
|
367
|
-
console.log('have Attachments');
|
|
368
|
-
const MAXSIZE = 90 * 1000000;
|
|
369
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
370
|
-
const flag = fileToSend?.size && fileToSend?.size < MAXSIZE;
|
|
371
|
-
|
|
372
|
-
if (fileToSend?.size && fileToSend?.size < MAXSIZE) {
|
|
373
|
-
messagesViewModel.sendAttachmentMessage(fileToSend);
|
|
374
|
-
} else if (fileToSend) {
|
|
375
|
-
showErrorMessage(
|
|
376
|
-
`file size ${fileToSend?.size} must be less then ${MAXSIZE} mb.`,
|
|
377
|
-
);
|
|
378
|
-
}
|
|
379
|
-
}, [fileToSend]);
|
|
380
|
-
|
|
381
|
-
const [isVoiceMessage, setVoiceMessage] = useState(true);
|
|
382
|
-
const [isRecording, setIsRecording] = useState(false);
|
|
383
|
-
//
|
|
384
|
-
const [permission, setPermission] = useState(false);
|
|
385
|
-
|
|
386
|
-
// const [recordingStatus, setRecordingStatus] = useState('inactive');
|
|
387
|
-
|
|
388
|
-
const [stream, setStream] = useState<MediaStream>();
|
|
389
|
-
// const [mediaRecorder, setMediaRecorder] = useState<MediaRecorder>();
|
|
390
|
-
const mediaRecorder = useRef<MediaRecorder>();
|
|
391
|
-
const [resultAudioBlob, setResultAudioBlob] = useState<Blob>();
|
|
392
|
-
|
|
393
|
-
const [audioChunks, setAudioChunks] = useState<Array<Blob>>([]);
|
|
394
|
-
|
|
395
|
-
const mimeType = 'audio/webm;codecs=opus'; // audio/ogg audio/mpeg audio/webm audio/x-wav audio/mp4
|
|
396
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
397
|
-
const getMicrophonePermission = async () => {
|
|
398
|
-
// if ('MediaRecorder' in window)
|
|
399
|
-
if (window) {
|
|
400
|
-
try {
|
|
401
|
-
const mediaStream = await navigator.mediaDevices.getUserMedia({
|
|
402
|
-
audio: true,
|
|
403
|
-
video: false,
|
|
404
|
-
});
|
|
405
|
-
|
|
406
|
-
setPermission(true);
|
|
407
|
-
setStream(mediaStream);
|
|
408
|
-
} catch (err) {
|
|
409
|
-
// setWarningErrorText(
|
|
410
|
-
// 'The MediaRecorder API is not supported in your browser.',
|
|
411
|
-
// );
|
|
412
|
-
showErrorMessage(
|
|
413
|
-
`The MediaRecorder API throws exception ${stringifyError(err)} .`,
|
|
414
|
-
);
|
|
415
|
-
}
|
|
416
|
-
} else {
|
|
417
|
-
// setWarningErrorText(
|
|
418
|
-
// 'The MediaRecorder API is not supported in your browser.',
|
|
419
|
-
// );
|
|
420
|
-
showErrorMessage(
|
|
421
|
-
'The MediaRecorder API is not supported in your browser.',
|
|
422
|
-
);
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
|
|
426
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/require-await
|
|
427
|
-
const startRecording = async () => {
|
|
428
|
-
if (!stream) return;
|
|
429
|
-
// setRecordingStatus('recording');
|
|
430
|
-
// audio/mp4;codecs=mp4a audio/webm;codecs=opus audio/webm;codecs=vp9,opus
|
|
431
|
-
const mimeContent = window.MediaRecorder.isTypeSupported(
|
|
432
|
-
'audio/mp4;codecs=mp4a',
|
|
433
|
-
)
|
|
434
|
-
? 'audio/mp4;codecs=mp4a'
|
|
435
|
-
: 'audio/webm;codecs=opus';
|
|
436
|
-
/*
|
|
437
|
-
this.mediaRecorder = new MediaRecorder(window.stream, {mimeType: mimeContent});
|
|
438
|
-
*/
|
|
439
|
-
const media = new MediaRecorder(stream, { mimeType: mimeContent });
|
|
440
|
-
|
|
441
|
-
mediaRecorder.current = media;
|
|
442
|
-
mediaRecorder.current.start();
|
|
443
|
-
|
|
444
|
-
const localAudioChunks: any[] = [];
|
|
445
|
-
|
|
446
|
-
mediaRecorder.current.ondataavailable = (event) => {
|
|
447
|
-
// const localAudioChunks: any[] = [];
|
|
448
|
-
|
|
449
|
-
if (typeof event.data === 'undefined') return;
|
|
450
|
-
if (event.data.size === 0) return;
|
|
451
|
-
localAudioChunks.push(event.data);
|
|
452
|
-
console.log('voice data');
|
|
453
|
-
// setAudioChunks(localAudioChunks);
|
|
454
|
-
};
|
|
455
|
-
|
|
456
|
-
setAudioChunks(localAudioChunks);
|
|
457
|
-
};
|
|
458
|
-
|
|
459
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
460
|
-
const stopRecording = () => {
|
|
461
|
-
if (!mediaRecorder.current) return;
|
|
462
|
-
// setRecordingStatus('inactive');
|
|
463
|
-
mediaRecorder.current.stop();
|
|
464
|
-
|
|
465
|
-
mediaRecorder.current.onstop = () => {
|
|
466
|
-
const audioBlob = new Blob(audioChunks, { type: mimeType });
|
|
467
|
-
|
|
468
|
-
setResultAudioBlob(audioBlob);
|
|
469
|
-
|
|
470
|
-
setAudioChunks([]);
|
|
471
|
-
//
|
|
472
|
-
stream?.getAudioTracks().forEach((track) => {
|
|
473
|
-
track.stop();
|
|
474
|
-
});
|
|
475
|
-
setPermission(false);
|
|
476
|
-
//
|
|
477
|
-
};
|
|
478
|
-
};
|
|
479
|
-
|
|
480
|
-
//
|
|
481
|
-
const blobToFile = (theBlob: Blob, fileName: string): File => {
|
|
482
|
-
const b: any = theBlob;
|
|
483
|
-
|
|
484
|
-
// A Blob() is almost a File() - it's just missing the two properties below which we will add
|
|
485
|
-
b.lastModifiedDate = new Date();
|
|
486
|
-
b.name = fileName;
|
|
487
|
-
|
|
488
|
-
// Cast to a File() type
|
|
489
|
-
const resultFile = theBlob as unknown as File;
|
|
490
|
-
|
|
491
|
-
return resultFile;
|
|
492
|
-
};
|
|
493
|
-
|
|
494
|
-
useEffect(() => {
|
|
495
|
-
if (resultAudioBlob) {
|
|
496
|
-
const voiceMessage = blobToFile(
|
|
497
|
-
resultAudioBlob,
|
|
498
|
-
`${currentUserName || ''}_voice_message.webm`,
|
|
499
|
-
);
|
|
500
|
-
|
|
501
|
-
setFileToSend(voiceMessage);
|
|
502
|
-
}
|
|
503
|
-
}, [resultAudioBlob]);
|
|
504
|
-
// test component version
|
|
505
|
-
// useEffect(() => {
|
|
506
|
-
// if (isRecording) {
|
|
507
|
-
// setWarningErrorText(`Your voice is recording during for 1 minute`);
|
|
508
|
-
// } else {
|
|
509
|
-
// setWarningErrorText('');
|
|
510
|
-
// }
|
|
511
|
-
// }, [isRecording]);
|
|
512
|
-
// work version below:
|
|
513
|
-
useEffect(() => {
|
|
514
|
-
// setFileToSend(null);
|
|
515
|
-
if (isRecording) {
|
|
516
|
-
if (!permission) {
|
|
517
|
-
// eslint-disable-next-line promise/catch-or-return,promise/always-return
|
|
518
|
-
getMicrophonePermission().catch(() => {
|
|
519
|
-
// setWarningErrorText(`Have no audio.`);
|
|
520
|
-
showErrorMessage(`Have no audio.`);
|
|
521
|
-
});
|
|
522
|
-
} else {
|
|
523
|
-
// eslint-disable-next-line promise/catch-or-return,promise/always-return
|
|
524
|
-
startRecording().then(() => {
|
|
525
|
-
setWarningErrorText(`Your voice is recording during for 1 minutes`);
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
} else {
|
|
529
|
-
if (permission && mediaRecorder.current) {
|
|
530
|
-
stopRecording();
|
|
531
|
-
}
|
|
532
|
-
setWarningErrorText('');
|
|
533
|
-
}
|
|
534
|
-
}, [isRecording]);
|
|
535
|
-
|
|
536
|
-
useEffect(() => {
|
|
537
|
-
if (isRecording && permission) {
|
|
538
|
-
// eslint-disable-next-line promise/always-return,promise/catch-or-return
|
|
539
|
-
startRecording().then(() => {
|
|
540
|
-
setWarningErrorText(`Your voice is recording during for 1 minutes`);
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
}, [permission]);
|
|
544
|
-
|
|
545
|
-
return (
|
|
546
|
-
<div
|
|
547
|
-
style={
|
|
548
|
-
maxWidthToResize
|
|
549
|
-
? {
|
|
550
|
-
maxWidth: `${maxWidthToResizing}`,
|
|
551
|
-
minWidth: `$message-view-container-wrapper-min-width`,
|
|
552
|
-
// width: `${maxWidthToResizing}`,
|
|
553
|
-
width: '100%',
|
|
554
|
-
}
|
|
555
|
-
: {}
|
|
556
|
-
}
|
|
557
|
-
className="message-view-container"
|
|
558
|
-
>
|
|
559
|
-
<div
|
|
560
|
-
style={{
|
|
561
|
-
flexGrow: `1`,
|
|
562
|
-
flexShrink: `1`,
|
|
563
|
-
flexBasis: `${maxWidthToResizing}`,
|
|
564
|
-
}}
|
|
565
|
-
className="message-view-container--header"
|
|
566
|
-
>
|
|
567
|
-
<HeaderMessages
|
|
568
|
-
dialog={messagesViewModel.entity}
|
|
569
|
-
InformationHandler={InformationHandler}
|
|
570
|
-
countMembers={getCountDialogMembers(dialog)}
|
|
571
|
-
/>
|
|
572
|
-
</div>
|
|
573
|
-
<div
|
|
574
|
-
style={{
|
|
575
|
-
flexGrow: `1`,
|
|
576
|
-
flexShrink: `1`,
|
|
577
|
-
flexBasis: `${maxWidthToResizing}`,
|
|
578
|
-
}}
|
|
579
|
-
className="message-view-container--information"
|
|
580
|
-
>
|
|
581
|
-
<div>
|
|
582
|
-
connection status:
|
|
583
|
-
{browserOnline ? 'online ' : 'offline '}
|
|
584
|
-
{/* eslint-disable-next-line no-nested-ternary */}
|
|
585
|
-
{connectionRepository.isChatConnected() === undefined
|
|
586
|
-
? 'unexpected undefined'
|
|
587
|
-
: connectionRepository.isChatConnected()
|
|
588
|
-
? 'connected'
|
|
589
|
-
: 'disconnected'}
|
|
590
|
-
</div>
|
|
591
|
-
{hasMore && (
|
|
592
|
-
<div style={{ color: 'red' }}>
|
|
593
|
-
unread: {dialogMessagesCount - messagesToView.length}
|
|
594
|
-
</div>
|
|
595
|
-
)}
|
|
596
|
-
<div>{` current user id: ${currentUserId || 'no user'}`}</div>
|
|
597
|
-
</div>
|
|
598
|
-
<div
|
|
599
|
-
style={{
|
|
600
|
-
flexGrow: `1`,
|
|
601
|
-
flexShrink: `1`,
|
|
602
|
-
flexBasis: `${maxWidthToResizing}`,
|
|
603
|
-
}}
|
|
604
|
-
className="message-view-container--messages"
|
|
605
|
-
>
|
|
606
|
-
{messagesViewModel?.error && (
|
|
607
|
-
<ErrorComponent
|
|
608
|
-
title={messagesViewModel?.error}
|
|
609
|
-
ClickActionHandler={() => {
|
|
610
|
-
alert('call click retry');
|
|
611
|
-
}}
|
|
612
|
-
/>
|
|
613
|
-
)}
|
|
614
|
-
{messagesViewModel &&
|
|
615
|
-
messagesViewModel.messages &&
|
|
616
|
-
messagesViewModel.messages.length > 0 &&
|
|
617
|
-
messagesToView &&
|
|
618
|
-
messagesToView.length > 0 && (
|
|
619
|
-
<ScrollableContainer
|
|
620
|
-
data={messagesToView}
|
|
621
|
-
renderItem={renderMessage}
|
|
622
|
-
onEndReached={fetchMoreData}
|
|
623
|
-
onEndReachedThreshold={0.8}
|
|
624
|
-
refreshing={messagesViewModel?.loading}
|
|
625
|
-
autoScrollToBottom={scrollUpToDown}
|
|
626
|
-
/>
|
|
627
|
-
)}
|
|
628
|
-
{messagesViewModel?.loading && (
|
|
629
|
-
<div
|
|
630
|
-
style={{
|
|
631
|
-
height: '44px',
|
|
632
|
-
width: '44px',
|
|
633
|
-
}}
|
|
634
|
-
>
|
|
635
|
-
<LoaderComponent
|
|
636
|
-
width="44"
|
|
637
|
-
height="44"
|
|
638
|
-
color="var(--color-background-info)"
|
|
639
|
-
/>
|
|
640
|
-
</div>
|
|
641
|
-
)}
|
|
642
|
-
<div className="message-view-container--warning-error">
|
|
643
|
-
{warningErrorText}
|
|
644
|
-
</div>
|
|
645
|
-
</div>
|
|
646
|
-
|
|
647
|
-
<div
|
|
648
|
-
style={{
|
|
649
|
-
flex: `flex: 1 1 ${maxWidthToResizing}`,
|
|
650
|
-
}}
|
|
651
|
-
onBlur={() => {
|
|
652
|
-
if (!(messageText && messageText.length > 0)) {
|
|
653
|
-
setVoiceMessage(true);
|
|
654
|
-
}
|
|
655
|
-
}}
|
|
656
|
-
className="message-view-container--chat-input"
|
|
657
|
-
>
|
|
658
|
-
<label
|
|
659
|
-
htmlFor="btnUploadAttachment"
|
|
660
|
-
style={{
|
|
661
|
-
cursor: 'pointer',
|
|
662
|
-
}}
|
|
663
|
-
>
|
|
664
|
-
<div>
|
|
665
|
-
<ActiveSvg
|
|
666
|
-
content={
|
|
667
|
-
<AttachmentIcon
|
|
668
|
-
width="32"
|
|
669
|
-
height="32"
|
|
670
|
-
applyZoom
|
|
671
|
-
color="var(--input-elements)"
|
|
672
|
-
/>
|
|
673
|
-
}
|
|
674
|
-
clickAction={() => {
|
|
675
|
-
console.log('click send message');
|
|
676
|
-
}}
|
|
677
|
-
touchAction={() => {
|
|
678
|
-
console.log('touch send message');
|
|
679
|
-
}}
|
|
680
|
-
/>
|
|
681
|
-
</div>
|
|
682
|
-
<input
|
|
683
|
-
id="btnUploadAttachment"
|
|
684
|
-
type="file"
|
|
685
|
-
accept="image/*, audio/*, video/*, .pdf, .txt,"
|
|
686
|
-
style={{ display: 'none' }}
|
|
687
|
-
onChange={(event) => {
|
|
688
|
-
ChangeFileHandler(event);
|
|
689
|
-
}}
|
|
690
|
-
/>
|
|
691
|
-
</label>
|
|
692
|
-
|
|
693
|
-
{!isRecording && (
|
|
694
|
-
<textarea
|
|
695
|
-
disabled={messagesViewModel?.loading}
|
|
696
|
-
value={messageText}
|
|
697
|
-
onFocus={() => {
|
|
698
|
-
setVoiceMessage(false);
|
|
699
|
-
}}
|
|
700
|
-
onChange={(event) => {
|
|
701
|
-
setMessageText(event.target.value);
|
|
702
|
-
}}
|
|
703
|
-
onInput={() => {
|
|
704
|
-
messagesViewModel.sendTypingTextMessage();
|
|
705
|
-
}}
|
|
706
|
-
placeholder="enter text to send"
|
|
707
|
-
/>
|
|
708
|
-
)}
|
|
709
|
-
|
|
710
|
-
{isRecording && (
|
|
711
|
-
<VoiceRecordingProgress
|
|
712
|
-
longRecInSec={60}
|
|
713
|
-
ClickActionHandler={() => {
|
|
714
|
-
console.log('click send voice message');
|
|
715
|
-
if (messagesViewModel?.loading) return;
|
|
716
|
-
setIsRecording(!isRecording);
|
|
717
|
-
}}
|
|
718
|
-
TouchActionHandler={() => {
|
|
719
|
-
console.log('click send voice message');
|
|
720
|
-
if (messagesViewModel?.loading) return;
|
|
721
|
-
setIsRecording(!isRecording);
|
|
722
|
-
}}
|
|
723
|
-
/>
|
|
724
|
-
)}
|
|
725
|
-
|
|
726
|
-
{!isVoiceMessage && (
|
|
727
|
-
<div>
|
|
728
|
-
<ActiveSvg
|
|
729
|
-
content={
|
|
730
|
-
<SendIcon
|
|
731
|
-
width="21"
|
|
732
|
-
height="18"
|
|
733
|
-
applyZoom
|
|
734
|
-
color="var(--main-elements)"
|
|
735
|
-
/>
|
|
736
|
-
}
|
|
737
|
-
clickAction={() => {
|
|
738
|
-
console.log('click send message');
|
|
739
|
-
if (messagesViewModel?.loading) return;
|
|
740
|
-
setVoiceMessage(true);
|
|
741
|
-
if (messageText.length > 0 && messageText.length <= 1000) {
|
|
742
|
-
const messageTextToSend = messageText;
|
|
743
|
-
|
|
744
|
-
setMessageText('');
|
|
745
|
-
messagesViewModel.sendTextMessage(messageTextToSend);
|
|
746
|
-
setMessageText('');
|
|
747
|
-
} else {
|
|
748
|
-
setWarningErrorText(
|
|
749
|
-
'length of text message must be less then 1000 chars.',
|
|
750
|
-
);
|
|
751
|
-
setTimeout(() => {
|
|
752
|
-
setWarningErrorText('');
|
|
753
|
-
}, 3000);
|
|
754
|
-
}
|
|
755
|
-
}}
|
|
756
|
-
touchAction={() => {
|
|
757
|
-
console.log('touch send message');
|
|
758
|
-
}}
|
|
759
|
-
/>
|
|
760
|
-
</div>
|
|
761
|
-
)}
|
|
762
|
-
{isVoiceMessage && (
|
|
763
|
-
<div>
|
|
764
|
-
<ActiveSvg
|
|
765
|
-
content={
|
|
766
|
-
<VoiceIcon
|
|
767
|
-
width="21"
|
|
768
|
-
height="18"
|
|
769
|
-
applyZoom
|
|
770
|
-
color={isRecording ? 'var(--error)' : 'var(--input-elements)'}
|
|
771
|
-
/>
|
|
772
|
-
}
|
|
773
|
-
clickAction={() => {
|
|
774
|
-
console.log('click send voice message');
|
|
775
|
-
if (messagesViewModel?.loading) return;
|
|
776
|
-
setIsRecording(!isRecording);
|
|
777
|
-
}}
|
|
778
|
-
touchAction={() => {
|
|
779
|
-
console.log('touch send message');
|
|
780
|
-
if (messagesViewModel?.loading) return;
|
|
781
|
-
setIsRecording(!isRecording);
|
|
782
|
-
}}
|
|
783
|
-
/>
|
|
784
|
-
</div>
|
|
785
|
-
)}
|
|
786
|
-
</div>
|
|
787
|
-
{/* <div className="message-view-container--warning-error"> */}
|
|
788
|
-
{/* {warningErrorText} */}
|
|
789
|
-
{/* </div> */}
|
|
790
|
-
</div>
|
|
791
|
-
);
|
|
792
|
-
};
|
|
793
|
-
|
|
794
|
-
export default MessagesView;
|