quickblox-react-ui-kit 0.1.6 → 0.1.7
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/.prettierignore +4 -0
- package/.prettierrc +10 -0
- package/README.md +30 -7
- package/dist/Data/source/remote/RemoteDataSource.d.ts +1 -1
- package/dist/index-ui.d.ts +3 -3
- package/dist/index-ui.js +3 -3
- package/package.json +2 -26
- package/public/favicon.ico +0 -0
- package/public/index.html +47 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/quickblox.js +54609 -0
- package/public/robots.txt +3 -0
- package/src/App.scss +0 -0
- package/src/App.tsx +236 -0
- package/src/CommonTypes/FunctionResult.ts +4 -0
- package/src/Data/Stubs.ts +1131 -0
- package/src/Data/dto/dialog/LocalDialogDTO.ts +42 -0
- package/src/Data/dto/dialog/LocalDialogsDTO.ts +21 -0
- package/src/Data/dto/dialog/RemoteDialogDTO.ts +58 -0
- package/src/Data/dto/dialog/RemoteDialogsDTO.ts +21 -0
- package/src/Data/dto/file/LocalFileDTO.ts +26 -0
- package/src/Data/dto/file/RemoteFileDTO.ts +26 -0
- package/src/Data/dto/message/LocalMessageDTO.ts +51 -0
- package/src/Data/dto/message/LocalMessagesDTO.ts +21 -0
- package/src/Data/dto/message/RemoteMessageDTO.ts +51 -0
- package/src/Data/dto/message/RemoteMessagesDTO.ts +21 -0
- package/src/Data/dto/user/LocalUserDTO.ts +37 -0
- package/src/Data/dto/user/LocalUsersDTO.ts +23 -0
- package/src/Data/dto/user/RemoteUserDTO.ts +37 -0
- package/src/Data/dto/user/RemoteUsersDTO.ts +21 -0
- package/src/Data/mapper/DialogLocalDTOMapper.ts +742 -0
- package/src/Data/mapper/DialogRemoteDTOMapper.ts +777 -0
- package/src/Data/mapper/FileLocalDTOMapper.ts +253 -0
- package/src/Data/mapper/FileRemoteDTOMapper.ts +265 -0
- package/src/Data/mapper/IMapper.ts +14 -0
- package/src/Data/mapper/MessageLocalDTOMapper.ts +425 -0
- package/src/Data/mapper/MessageRemoteDTOMapper.ts +431 -0
- package/src/Data/mapper/UserLocalDTOMapper.ts +381 -0
- package/src/Data/mapper/UserRemoteDTOMapper.ts +393 -0
- package/src/Data/repository/ConnectionRepository.ts +144 -0
- package/src/Data/repository/DialogsRepository.ts +422 -0
- package/src/Data/repository/EventMessagesRepository.ts +291 -0
- package/src/Data/repository/FileRepository.ts +110 -0
- package/src/Data/repository/MessagesRepository.ts +288 -0
- package/src/Data/repository/UsersRepository.ts +324 -0
- package/src/Data/source/exception/LocalDataSourceException.ts +17 -0
- package/src/Data/source/exception/MapperDTOException.ts +19 -0
- package/src/Data/source/exception/RemoteDataSourceException.ts +28 -0
- package/src/Data/source/exception/RepositoryException.ts +27 -0
- package/src/Data/source/local/ChatLocalStorageDataSource.ts +262 -0
- package/src/Data/source/local/ILocalDataSource.ts +45 -0
- package/src/Data/source/local/ILocalFileDataSource.ts +11 -0
- package/src/Data/source/local/LocalDataSource.ts +377 -0
- package/src/Data/source/local/LocalFileDataSource.ts +22 -0
- package/src/Data/source/remote/IRemoteDataSource.ts +112 -0
- package/src/Data/source/remote/Mapper/DialogDTOMapper.ts +415 -0
- package/src/Data/source/remote/Mapper/FileDTOMapper.ts +276 -0
- package/src/Data/source/remote/Mapper/IDTOMapper.ts +4 -0
- package/src/Data/source/remote/Mapper/MessageDTOMapper.ts +399 -0
- package/src/Data/source/remote/Mapper/UserDTOMapper.ts +344 -0
- package/src/Data/source/remote/RemoteDataSource.ts +1391 -0
- package/src/Domain/entity/Chat.ts +4 -0
- package/src/Domain/entity/ChatMessageAttachmentEntity.ts +15 -0
- package/src/Domain/entity/CustomDataEntity.ts +3 -0
- package/src/Domain/entity/DialogEntity.ts +15 -0
- package/src/Domain/entity/DialogEventInfo.ts +15 -0
- package/src/Domain/entity/DialogTypes.ts +7 -0
- package/src/Domain/entity/EventMessageType.ts +7 -0
- package/src/Domain/entity/FileEntity.ts +11 -0
- package/src/Domain/entity/FileTypes.ts +9 -0
- package/src/Domain/entity/GroupDialogEntity.ts +54 -0
- package/src/Domain/entity/LastMessageEntity.ts +5 -0
- package/src/Domain/entity/MessageEntity.ts +25 -0
- package/src/Domain/entity/NotificationTypes.ts +7 -0
- package/src/Domain/entity/PrivateDialogEntity.ts +46 -0
- package/src/Domain/entity/PublicDialogEntity.ts +80 -0
- package/src/Domain/entity/UserEntity.ts +22 -0
- package/src/Domain/exception/domain/DomainExecption.ts +5 -0
- package/src/Domain/repository/IDialogsRepository.ts +40 -0
- package/src/Domain/repository/IFileRepository.ts +9 -0
- package/src/Domain/repository/IMessagesRepository.ts +28 -0
- package/src/Domain/repository/IUsersRepository.ts +13 -0
- package/src/Domain/repository/Pagination.ts +48 -0
- package/src/Domain/use_cases/CreateDialogUseCase.ts +73 -0
- package/src/Domain/use_cases/GetAllDialogsUseCase.ts +20 -0
- package/src/Domain/use_cases/GetAllDialogsUseCaseWithMock.ts +45 -0
- package/src/Domain/use_cases/GetAllMessagesForDialog.ts +61 -0
- package/src/Domain/use_cases/GetAllUsersUseCase.ts +34 -0
- package/src/Domain/use_cases/GetDialogByIdUseCase.ts +28 -0
- package/src/Domain/use_cases/GetUsersByIdsUseCase.ts +22 -0
- package/src/Domain/use_cases/LeaveDialogUseCase.ts +109 -0
- package/src/Domain/use_cases/RemoveUsersFromTheDialogUseCase.ts +103 -0
- package/src/Domain/use_cases/SendTextMessageUseCase.ts +26 -0
- package/src/Domain/use_cases/SubscribeToDialogEventsUseCase.ts +141 -0
- package/src/Domain/use_cases/SubscribeToDialogsUpdatesUseCase.ts +69 -0
- package/src/Domain/use_cases/SubscribeToDialogsUpdatesUseCaseWithMock.ts +61 -0
- package/src/Domain/use_cases/SyncDialogsUseCase.ts +246 -0
- package/src/Domain/use_cases/UpdateDialogUseCase.ts +65 -0
- package/src/Domain/use_cases/UploadFileUseCase.ts +24 -0
- package/src/Domain/use_cases/UserTypingMessageUseCase.ts +51 -0
- package/src/Domain/use_cases/base/BaseUseCase.ts +77 -0
- package/src/Domain/use_cases/base/IUseCase.ts +5 -0
- package/src/Domain/use_cases/base/Subscribable/ISubscribable.ts +6 -0
- package/src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts +151 -0
- package/src/Presentation/.gitkeep +0 -0
- package/src/Presentation/Views/Base/BaseViewModel.ts +67 -0
- package/src/Presentation/Views/CreateDialogFlow/CreateNewDialogFlow.tsx +188 -0
- package/src/Presentation/Views/Dialogs/DialogViewModel.ts +25 -0
- package/src/Presentation/Views/Dialogs/Dialogs.scss +76 -0
- package/src/Presentation/Views/Dialogs/Dialogs.tsx +379 -0
- package/src/Presentation/Views/Dialogs/useDialogsViewModel.ts +379 -0
- package/src/Presentation/Views/Navigation/More.svg +7 -0
- package/src/Presentation/assets/DarkTheme.ts +58 -0
- package/src/Presentation/assets/DefaultThemes/CustomTheme.ts +58 -0
- package/src/Presentation/assets/DefaultThemes/DefaultTheme.ts +58 -0
- package/src/Presentation/assets/LightTheme.ts +58 -0
- package/src/Presentation/assets/ThemeScheme.ts +83 -0
- package/src/Presentation/assets/UiKitTheme.ts +143 -0
- 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/img/web-doc.png +0 -0
- package/src/Presentation/assets/styles/_fonts.scss +32 -0
- package/src/Presentation/assets/styles/_reset-styles.scss +435 -0
- package/src/Presentation/assets/styles/_theme_colors_scheme.scss +56 -0
- package/src/Presentation/assets/styles/_theme_colors_scheme_green.scss +57 -0
- package/src/Presentation/assets/styles/_theme_colors_scheme_pink.scss +72 -0
- package/src/Presentation/assets/styles/_theme_dark.scss +33 -0
- package/src/Presentation/assets/styles/_theme_light.scss +33 -0
- package/src/Presentation/assets/styles/_variables.scss +2 -0
- package/src/Presentation/components/Button.js +5 -0
- package/src/Presentation/components/Navbar.tsx +45 -0
- package/src/Presentation/components/TextInput.js +10 -0
- package/src/Presentation/components/UI/Buttons/ActiveButton/ActiveButton.tsx +40 -0
- package/src/Presentation/components/UI/Buttons/MainBoundedButton/MainBoundedButton.scss +0 -0
- package/src/Presentation/components/UI/Buttons/MainBoundedButton/MainBoundedButton.tsx +30 -0
- package/src/Presentation/components/UI/Buttons/MainButton/MainButton.scss +127 -0
- package/src/Presentation/components/UI/Buttons/MainButton/MainButton.tsx +62 -0
- package/src/Presentation/components/UI/Dialogs/CreateDialog/CreateDialog.scss +45 -0
- package/src/Presentation/components/UI/Dialogs/CreateDialog/CreateDialog.tsx +77 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogInformation.scss +429 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogInformation.tsx +565 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogMemberButton/DialogMembersButton.scss +42 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogMemberButton/DialogMembersButton.tsx +26 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/SingleUser/SingleUser.scss +95 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/SingleUser/SingleUser.tsx +42 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/UsersList.scss +60 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/UsersList.tsx +65 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/UsersListViewModel.ts +13 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/useUsersListViewModel.ts +81 -0
- package/src/Presentation/components/UI/Dialogs/EditDialog/EditDialog.scss +196 -0
- package/src/Presentation/components/UI/Dialogs/EditDialog/EditDialog.tsx +277 -0
- package/src/Presentation/components/UI/Dialogs/EditDialog/UserAvatar/UserAvatar.scss +32 -0
- package/src/Presentation/components/UI/Dialogs/EditDialog/UserAvatar/UserAvatar.tsx +59 -0
- package/src/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.scss +67 -0
- package/src/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.tsx +112 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteMembers.scss +146 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteMembers.tsx +328 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteMembersViewModel.ts +18 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteUsersList/SingleUserWithCheckBox/SingleUserWithCheckBox.scss +113 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteUsersList/SingleUserWithCheckBox/SingleUserWithCheckBox.tsx +79 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteUsersResultViewModel.ts +12 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/NotFoundContent/NotFoundContent.scss +37 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/NotFoundContent/NotFoundContent.tsx +22 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/useInviteMembersViewModel.ts +116 -0
- package/src/Presentation/components/UI/Dialogs/MembersList/MembersList.scss +128 -0
- package/src/Presentation/components/UI/Dialogs/MembersList/MembersList.tsx +93 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AudioAttachmentComponent/AudioAttachmentComponent.scss +7 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AudioAttachmentComponent/AudioAttachmentComponent.tsx +27 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.scss +133 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.tsx +141 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.scss +92 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/HighLightLink/HighLightLink.tsx +128 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.scss +11 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.tsx +25 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.scss +327 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.tsx +906 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesViewModel.ts +20 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/VideoAttachmentComponent/VideoAttachmentComponent.scss +7 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/VideoAttachmentComponent/VideoAttachmentComponent.tsx +33 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/VoiceRecordingProgress/VoiceRecordingProgress.scss +35 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/VoiceRecordingProgress/VoiceRecordingProgress.tsx +89 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/useMessagesViewModel.ts +463 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.scss +100 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.tsx +441 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialogViewModel.ts +42 -0
- package/src/Presentation/components/UI/Dialogs/YesNoQuestion/YesNoQuestion.scss +35 -0
- package/src/Presentation/components/UI/Dialogs/YesNoQuestion/YesNoQuestion.tsx +89 -0
- package/src/Presentation/components/UI/Elements/SwitchButton/SwitchButton.scss +61 -0
- package/src/Presentation/components/UI/Elements/SwitchButton/SwitchButton.tsx +48 -0
- package/src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.scss +74 -0
- package/src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.tsx +72 -0
- package/src/Presentation/components/UI/Placeholders/LoaderComponent/LoaderComponent.scss +21 -0
- package/src/Presentation/components/UI/Placeholders/LoaderComponent/LoaderComponent.tsx +41 -0
- package/src/Presentation/components/UI/svgs/ActiveSvg/ActiveSvg.scss +3 -0
- package/src/Presentation/components/UI/svgs/ActiveSvg/ActiveSvg.tsx +41 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Add/Add.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Add/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/AddContact/Add contact.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/AddContact/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Archive/Archive.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Archive/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Copy/Copy.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Copy/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Delete/Delete.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Delete/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Download/Download.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Download/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Edit/Edit.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Edit/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/EditDots/EditDots.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/EditDots/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Emoji/Emoji.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Emoji/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/ForwardFilled/Forward filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/ForwardFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Hungup/Hungup.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Hungup/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/IncomeCall/Income call.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/IncomeCall/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Like/Like.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Like/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/NewChat/New chat.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/NewChat/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/OutcomeCall/Outcome call.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/OutcomeCall/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Phone/Phone.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Phone/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/PhoneFilled/Phone filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/PhoneFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove/Remove.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove2/Remove2.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove2/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/ReplyFilled/Reply filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/ReplyFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Send/Send.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Send/index.tsx +38 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Share/Share.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Share/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/SwapCamera/Swap camera.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/SwapCamera/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Unarchive/Unarchive.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Unarchive/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/VideoIcon/Video.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/VideoIcon/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Voice/Voice.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Voice/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Brodcast/Broadcast.svg +7 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Brodcast/index.tsx +38 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Chat/Chat.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Chat/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/ChatFilled/Chat filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/ChatFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Conference/Conference.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Conference/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Contact/Contact.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Contact/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/ContactFilled/Contact filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/ContactFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/GroupChat/Group chat.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/GroupChat/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Notifications/Notifications.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Notifications/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/PrivateChat/Private chat.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/PrivateChat/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/PublicChannel/Public channel.svg +7 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/PublicChannel/index.tsx +67 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Stream/Stream.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Stream/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/StreamFilled/Stream filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/StreamFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/User/User.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/User/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/IconsCommonTypes.ts +6 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Attachment/Attachment.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Attachment/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/AudioFile/Audio file.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/AudioFile/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/BrokenFile/Broken file.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/BrokenFile/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Camera/Camera.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Camera/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/GifFile/GIF file.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/GifFile/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/Image.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFile/File.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFile/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFilled/Image filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/LinkWeb/Link.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/LinkWeb/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Location/Location.svg +4 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Location/index.tsx +26 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/TextDocument/Text document.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/TextDocument/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/VideoFile/Video file.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/VideoFile/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Admin/Admin.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Admin/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Banned/Banned.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Banned/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Freeze/Freeze.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Freeze/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Moderations/Moderations.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Moderations/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Muted/Muted.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Muted/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowLeft/Arrow left.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowLeft/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowRight/Arrow right.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowRight/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Back/Back.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Back/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Close/Close.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Close/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Down/Down.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Down/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Leave/Leave.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Leave/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/More/More.svg +7 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/More/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Next/Next.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Next/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Plus/Plus.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Plus/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Refresh/Refresh.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Refresh/index.tsx +36 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Search/Search.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Search/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Settings/Settings.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Settings/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/SettingsField/Settings filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/SettingsField/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Error/Error.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Error/index.tsx +36 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Help/Help.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Help/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Information/Information.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Information/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/InformationFill/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Loader/Loader.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Loader/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Mention/Mention.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Mention/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Sent/Sent.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Sent/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/Viewed_Delivered.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/index.tsx +38 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOff/Camera off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOff/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOn/Camera on.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOn/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOff/Check off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOff/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOn/Check on.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOn/index.tsx +24 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Favourite/Favourite.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Favourite/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FavouriteFilled/Favourite filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FavouriteFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FullScreen/Full screen.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FullScreen/inex.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Hide/Hide.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Hide/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/Play.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Louder/Louder.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Louder/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOff/Mic off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOff/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOn/Mic on.svg +4 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOn/index.tsx +26 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Minimize/Minimize.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Minimize/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOff/Notify off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOff/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOn/Notify on.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOn/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Pause/Pause.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Pause/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Quite/Quite.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Quite/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Record/Record.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Record/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Screenshare/Screenshare.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Screenshare/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Show/Show.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Show/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Speaker/Speaker.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Speaker/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/SpeakerOff/Speaker off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/SpeakerOff/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopRecord/Stop record.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopRecord/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopShare/Stop share.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopShare/index.tsx +22 -0
- package/src/Presentation/components/containers/ColumnContainer/ColumnContainer.scss +6 -0
- package/src/Presentation/components/containers/ColumnContainer/ColumnContainer.tsx +24 -0
- package/src/Presentation/components/containers/RowCenterContainer/RowCenterContainer.scss +45 -0
- package/src/Presentation/components/containers/RowCenterContainer/RowCenterContainer.tsx +95 -0
- package/src/Presentation/components/containers/RowLeftContainer/RowLeftContainer.scss +45 -0
- package/src/Presentation/components/containers/RowLeftContainer/RowLeftContainer.tsx +97 -0
- package/src/Presentation/components/containers/RowRightContainer/RowRightContainer.scss +46 -0
- package/src/Presentation/components/containers/RowRightContainer/RowRightContainer.tsx +97 -0
- package/src/Presentation/components/containers/ScrollableContainer/ScrollableContainer.scss +45 -0
- package/src/Presentation/components/containers/ScrollableContainer/ScrollableContainer.tsx +85 -0
- package/src/Presentation/components/layouts/Desktop/DesktopLayout.scss +31 -0
- package/src/Presentation/components/layouts/Desktop/DesktopLayout.tsx +52 -0
- package/src/Presentation/components/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +234 -0
- package/src/Presentation/components/layouts/LayoutCommonTypes.ts +7 -0
- package/src/Presentation/components/layouts/TestStage/LoginView/Login.scss +71 -0
- package/src/Presentation/components/layouts/TestStage/LoginView/Login.tsx +95 -0
- package/src/Presentation/components/layouts/TestStage/TestStageMarkup.scss +24 -0
- package/src/Presentation/components/layouts/TestStage/TestStageMarkup.tsx +1109 -0
- package/src/Presentation/components/providers/ModalContextProvider/Modal.scss +71 -0
- package/src/Presentation/components/providers/ModalContextProvider/Modal.tsx +131 -0
- package/src/Presentation/components/providers/ModalContextProvider/ModalContextProvider.tsx +38 -0
- package/src/Presentation/components/providers/ModalContextProvider/useModal.ts +39 -0
- package/src/Presentation/components/providers/ProviderProps.ts +5 -0
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +343 -0
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/useEventMessagesRepository.ts +10 -0
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/useQBConnection.ts +38 -0
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/useQbDataContext.ts +82 -0
- package/src/QBconfig.ts +33 -0
- package/src/index-ui.ts +66 -0
- package/src/index.scss +18 -0
- package/src/index.tsx +25 -0
- package/src/logo.svg +1 -0
- package/src/package_artan_react_ui.json +87 -0
- package/src/package_original.json +111 -0
- package/src/qb-api-calls/index.ts +581 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/setupTests.ts +5 -0
- package/src/utils/DateTimeFormatter.ts +35 -0
- package/src/utils/parse.ts +74 -0
- package/tsconfig.json +33 -0
- package/typedoc.json +4 -0
- package/webpack.config.js +56 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
.modal-container-overlay{
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
width: 100%;//inherit;
|
|
5
|
+
height: 100%;//inherit;
|
|
6
|
+
background: var(--secondary-background-modal);
|
|
7
|
+
//display: flex;
|
|
8
|
+
//align-items: center;
|
|
9
|
+
//justify-content: center;
|
|
10
|
+
|
|
11
|
+
&[aria-expanded='false']{
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.modal-container{
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 50%;
|
|
19
|
+
left: 50%;
|
|
20
|
+
transform: translate(-50%, -50%);
|
|
21
|
+
|
|
22
|
+
width: 380px;
|
|
23
|
+
min-height: 312px;
|
|
24
|
+
background-color: var(--main-background);
|
|
25
|
+
// padding: 24px;
|
|
26
|
+
padding-top: 24px;
|
|
27
|
+
padding-left: 24px;
|
|
28
|
+
padding-right: 24px;
|
|
29
|
+
border-radius: 4px;
|
|
30
|
+
|
|
31
|
+
&__close{
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 24px;
|
|
34
|
+
right: 24px;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
|
|
37
|
+
//font-weight: 500;
|
|
38
|
+
//font-size: 20px;
|
|
39
|
+
//font-style: normal;
|
|
40
|
+
//font-family: 'Roboto';
|
|
41
|
+
|
|
42
|
+
font-family: 'Roboto';
|
|
43
|
+
font-style: normal;
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
font-size: 20px;
|
|
46
|
+
line-height: 24px;
|
|
47
|
+
/* identical to box height, or 120% */
|
|
48
|
+
letter-spacing: 0.0015em;
|
|
49
|
+
color: var(--secondary-elements);
|
|
50
|
+
}
|
|
51
|
+
&__subtitle{
|
|
52
|
+
margin-bottom: 24px;
|
|
53
|
+
//
|
|
54
|
+
font-family: 'Roboto';
|
|
55
|
+
font-style: normal;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
font-size: 20px;
|
|
58
|
+
line-height: 24px;
|
|
59
|
+
letter-spacing: 0.0015em;
|
|
60
|
+
color: var(--main-text);
|
|
61
|
+
|
|
62
|
+
//border: 1px solid black;
|
|
63
|
+
}
|
|
64
|
+
&__content{
|
|
65
|
+
margin-bottom: 20px;
|
|
66
|
+
//border: 1px solid brown;
|
|
67
|
+
}
|
|
68
|
+
&__footer{
|
|
69
|
+
//border: 1px solid black;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Modal.scss';
|
|
3
|
+
import Close from '../../UI/svgs/Icons/Navigation/Close';
|
|
4
|
+
|
|
5
|
+
type ModalContextType = {
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
handleModal: (
|
|
8
|
+
show: boolean,
|
|
9
|
+
content: React.ReactNode,
|
|
10
|
+
headerText?: string,
|
|
11
|
+
withoutClose?: boolean,
|
|
12
|
+
haveModalFooter?: boolean,
|
|
13
|
+
haveModalContainerStyle?: React.CSSProperties,
|
|
14
|
+
) => void;
|
|
15
|
+
modalContent: React.ReactNode;
|
|
16
|
+
modalHeader: string;
|
|
17
|
+
modalCloseTab: boolean;
|
|
18
|
+
haveModalFooter: boolean;
|
|
19
|
+
ModalContainerStyle: React.CSSProperties;
|
|
20
|
+
};
|
|
21
|
+
const initValue: ModalContextType = {
|
|
22
|
+
isOpen: false,
|
|
23
|
+
modalCloseTab: true,
|
|
24
|
+
haveModalFooter: true,
|
|
25
|
+
modalHeader: '',
|
|
26
|
+
modalContent: '',
|
|
27
|
+
handleModal: () => {
|
|
28
|
+
console.log('empty function');
|
|
29
|
+
},
|
|
30
|
+
ModalContainerStyle: {},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const ModalContext = React.createContext<ModalContextType>(initValue);
|
|
34
|
+
|
|
35
|
+
function Modal() {
|
|
36
|
+
const {
|
|
37
|
+
isOpen,
|
|
38
|
+
handleModal,
|
|
39
|
+
modalContent,
|
|
40
|
+
modalHeader,
|
|
41
|
+
modalCloseTab,
|
|
42
|
+
haveModalFooter,
|
|
43
|
+
ModalContainerStyle,
|
|
44
|
+
} = React.useContext(ModalContext);
|
|
45
|
+
|
|
46
|
+
const onClickHandler = () => {
|
|
47
|
+
handleModal(false, '');
|
|
48
|
+
};
|
|
49
|
+
const questionSizeBox: React.CSSProperties = haveModalFooter
|
|
50
|
+
? {
|
|
51
|
+
minHeight: '160px',
|
|
52
|
+
minWidth: '380px',
|
|
53
|
+
maxHeight: '160px',
|
|
54
|
+
maxWidth: '380px',
|
|
55
|
+
backgroundColor: 'var(--main-background)',
|
|
56
|
+
// border: '3px solid blue',
|
|
57
|
+
}
|
|
58
|
+
: ModalContainerStyle || {};
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div className="modal-container-overlay" aria-expanded={isOpen}>
|
|
62
|
+
{isOpen ? (
|
|
63
|
+
<div style={questionSizeBox} className="modal-container">
|
|
64
|
+
{modalCloseTab && (
|
|
65
|
+
<div className="modal-container__close" onClick={onClickHandler}>
|
|
66
|
+
<Close width="24" height="24" color="var(--secondary-elements)" />
|
|
67
|
+
</div>
|
|
68
|
+
)}
|
|
69
|
+
<div
|
|
70
|
+
style={haveModalFooter ? { marginBottom: '30px' } : {}}
|
|
71
|
+
className="modal-container__subtitle"
|
|
72
|
+
>
|
|
73
|
+
{modalHeader}
|
|
74
|
+
</div>
|
|
75
|
+
<div className="modal-container__content">{modalContent}</div>
|
|
76
|
+
{/* {haveModalFooter && ( */}
|
|
77
|
+
{/* <div className="modal-container__footer"> */}
|
|
78
|
+
{/* <RowRightContainer */}
|
|
79
|
+
{/* minHeightContainer="32px" */}
|
|
80
|
+
{/* gapBetweenItem="8px" */}
|
|
81
|
+
{/* RightContainerSize={{ */}
|
|
82
|
+
{/* flexBasis: '63px', */}
|
|
83
|
+
{/* minWidth: '63px', */}
|
|
84
|
+
{/* maxWidth: '63px', */}
|
|
85
|
+
{/* minHeight: '32px', */}
|
|
86
|
+
{/* maxHeight: '32px', */}
|
|
87
|
+
{/* }} */}
|
|
88
|
+
{/* RightItem={ */}
|
|
89
|
+
{/* <div> */}
|
|
90
|
+
{/* <button */}
|
|
91
|
+
{/* style={{ */}
|
|
92
|
+
{/* width: '62px', */}
|
|
93
|
+
{/* height: '31px', */}
|
|
94
|
+
{/* borderRadius: '4px', */}
|
|
95
|
+
{/* }} */}
|
|
96
|
+
{/* type="button" */}
|
|
97
|
+
{/* > */}
|
|
98
|
+
{/* Next */}
|
|
99
|
+
{/* </button> */}
|
|
100
|
+
{/* </div> */}
|
|
101
|
+
{/* } */}
|
|
102
|
+
{/* CenterContainerSize={{ */}
|
|
103
|
+
{/* flexBasis: '78px', */}
|
|
104
|
+
{/* minWidth: '78px', */}
|
|
105
|
+
{/* maxWidth: '78px', */}
|
|
106
|
+
{/* minHeight: '32px', */}
|
|
107
|
+
{/* maxHeight: '32px', */}
|
|
108
|
+
{/* }} */}
|
|
109
|
+
{/* CenterItem={ */}
|
|
110
|
+
{/* <div> */}
|
|
111
|
+
{/* <button */}
|
|
112
|
+
{/* style={{ */}
|
|
113
|
+
{/* width: '78px', */}
|
|
114
|
+
{/* height: '31px', */}
|
|
115
|
+
{/* borderRadius: '4px', */}
|
|
116
|
+
{/* }} */}
|
|
117
|
+
{/* type="button" */}
|
|
118
|
+
{/* > */}
|
|
119
|
+
{/* Cancel */}
|
|
120
|
+
{/* </button> */}
|
|
121
|
+
{/* </div> */}
|
|
122
|
+
{/* } */}
|
|
123
|
+
{/* /> */}
|
|
124
|
+
{/* </div> */}
|
|
125
|
+
{/* )} */}
|
|
126
|
+
</div>
|
|
127
|
+
) : null}
|
|
128
|
+
</div>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
export default Modal;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import useModal from './useModal';
|
|
3
|
+
import Modal, { ModalContext } from './Modal';
|
|
4
|
+
import { ProviderProps } from '../ProviderProps';
|
|
5
|
+
|
|
6
|
+
const { Provider } = ModalContext;
|
|
7
|
+
|
|
8
|
+
function ModalContextProvider({ children }: ProviderProps) {
|
|
9
|
+
console.log('call ModalContextProvider:');
|
|
10
|
+
const {
|
|
11
|
+
isOpen,
|
|
12
|
+
handleModal,
|
|
13
|
+
modalContent,
|
|
14
|
+
modalHeader,
|
|
15
|
+
modalCloseTab,
|
|
16
|
+
haveModalFooter,
|
|
17
|
+
ModalContainerStyle,
|
|
18
|
+
} = useModal();
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Provider
|
|
22
|
+
value={{
|
|
23
|
+
isOpen,
|
|
24
|
+
handleModal,
|
|
25
|
+
modalContent,
|
|
26
|
+
modalHeader,
|
|
27
|
+
modalCloseTab,
|
|
28
|
+
haveModalFooter,
|
|
29
|
+
ModalContainerStyle,
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
{children}
|
|
33
|
+
<Modal />
|
|
34
|
+
</Provider>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default ModalContextProvider;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
const useModal = () => {
|
|
4
|
+
const [isOpen, setIsOpen] = React.useState<boolean>(false);
|
|
5
|
+
const [modalContent, setModalContent] = React.useState<React.ReactNode>('');
|
|
6
|
+
const [modalHeader, setModalHeader] = React.useState<string>('');
|
|
7
|
+
const [modalCloseTab, setModalCloseTab] = React.useState<boolean>(true);
|
|
8
|
+
const [haveModalFooter, setHaveModalFooter] = React.useState<boolean>(true);
|
|
9
|
+
const [ModalContainerStyle, setModalContainerStyle] =
|
|
10
|
+
useState<React.CSSProperties>({});
|
|
11
|
+
const handleModal = (
|
|
12
|
+
show: boolean,
|
|
13
|
+
content: React.ReactNode,
|
|
14
|
+
headerText?: string,
|
|
15
|
+
withoutCloseTab?: boolean,
|
|
16
|
+
withoutFooter?: boolean,
|
|
17
|
+
haveModalContainerStyle?: React.CSSProperties,
|
|
18
|
+
) => {
|
|
19
|
+
setIsOpen(show);
|
|
20
|
+
if (content) setModalContent(content);
|
|
21
|
+
if (headerText) setModalHeader(headerText);
|
|
22
|
+
setModalCloseTab(!withoutCloseTab);
|
|
23
|
+
setHaveModalFooter(withoutFooter || false);
|
|
24
|
+
if (haveModalContainerStyle)
|
|
25
|
+
setModalContainerStyle(haveModalContainerStyle);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
isOpen,
|
|
30
|
+
handleModal,
|
|
31
|
+
modalContent,
|
|
32
|
+
modalHeader,
|
|
33
|
+
modalCloseTab,
|
|
34
|
+
haveModalFooter,
|
|
35
|
+
ModalContainerStyle,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default useModal;
|
package/src/Presentation/components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProviderProps } from '../ProviderProps';
|
|
3
|
+
import ModalContextProvider from '../ModalContextProvider/ModalContextProvider';
|
|
4
|
+
import { LocalDataSource } from '../../../../Data/source/local/LocalDataSource';
|
|
5
|
+
import {
|
|
6
|
+
AuthorizationData,
|
|
7
|
+
LoginData,
|
|
8
|
+
RemoteDataSource,
|
|
9
|
+
} from '../../../../Data/source/remote/RemoteDataSource';
|
|
10
|
+
import DialogsRepository from '../../../../Data/repository/DialogsRepository';
|
|
11
|
+
import { SyncDialogsUseCase } from '../../../../Domain/use_cases/SyncDialogsUseCase';
|
|
12
|
+
import { BaseUseCase } from '../../../../Domain/use_cases/base/BaseUseCase';
|
|
13
|
+
import { QBConfig } from '../../../../QBconfig';
|
|
14
|
+
import ConnectionRepository from '../../../../Data/repository/ConnectionRepository';
|
|
15
|
+
import EventMessagesRepository from '../../../../Data/repository/EventMessagesRepository';
|
|
16
|
+
import { CallBackFunction } from '../../../../Domain/use_cases/base/IUseCase';
|
|
17
|
+
|
|
18
|
+
// import packageInfo from '../../../../../package.json';
|
|
19
|
+
|
|
20
|
+
const initialValues = {
|
|
21
|
+
LOCAL_DATA_SOURCE: new LocalDataSource(), // localstorage or session storage
|
|
22
|
+
REMOTE_DATA_SOURCE: new RemoteDataSource(), // QB instances
|
|
23
|
+
CONNECTION_REPOSITORY: new ConnectionRepository(),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const initialEvent = {
|
|
27
|
+
EVENT_MESSAGE_REPOSITORY: new EventMessagesRepository(
|
|
28
|
+
initialValues.REMOTE_DATA_SOURCE,
|
|
29
|
+
initialValues.LOCAL_DATA_SOURCE,
|
|
30
|
+
initialValues.CONNECTION_REPOSITORY,
|
|
31
|
+
),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const initialSync = {
|
|
35
|
+
SYNC_DIALOGS_USE_CASE: new SyncDialogsUseCase(
|
|
36
|
+
new DialogsRepository(
|
|
37
|
+
initialValues.LOCAL_DATA_SOURCE,
|
|
38
|
+
initialValues.REMOTE_DATA_SOURCE,
|
|
39
|
+
),
|
|
40
|
+
initialValues.CONNECTION_REPOSITORY,
|
|
41
|
+
initialEvent.EVENT_MESSAGE_REPOSITORY,
|
|
42
|
+
),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
type AccountData = {
|
|
46
|
+
appId: number;
|
|
47
|
+
accountKey: string;
|
|
48
|
+
authSecret?: string;
|
|
49
|
+
authKey: string;
|
|
50
|
+
sessionToken?: string;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
{ username: string; password: string }
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
export type InitParams = {
|
|
58
|
+
maxFileSize: number;
|
|
59
|
+
accountData: AccountData;
|
|
60
|
+
qbConfig?: QBConfig;
|
|
61
|
+
loginData?: LoginData;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
type QuickBloxProviderProps = ProviderProps & InitParams;
|
|
65
|
+
|
|
66
|
+
type QBDataStorage = {
|
|
67
|
+
LOCAL_DATA_SOURCE: LocalDataSource;
|
|
68
|
+
REMOTE_DATA_SOURCE: RemoteDataSource;
|
|
69
|
+
SYNC_DIALOGS_USE_CASE: BaseUseCase<boolean, boolean>; // need Factory pattern
|
|
70
|
+
CONNECTION_REPOSITORY: ConnectionRepository;
|
|
71
|
+
EVENT_MESSAGE_REPOSITORY: EventMessagesRepository;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type QBReactUIKitVersionInfo = {
|
|
75
|
+
version: string;
|
|
76
|
+
build: string;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export type QBDataContextType = {
|
|
80
|
+
// authProcessed: boolean;
|
|
81
|
+
storage: QBDataStorage;
|
|
82
|
+
InitParams: InitParams;
|
|
83
|
+
updateStorage: (storage: QBDataStorage) => void;
|
|
84
|
+
updateQBInitParams: (InitParams: InitParams) => void;
|
|
85
|
+
release: () => void;
|
|
86
|
+
authorize: (authorizationData: AuthorizationData) => Promise<void>;
|
|
87
|
+
setSubscribeOnSessionExpiredListener: (
|
|
88
|
+
callback: CallBackFunction<boolean>,
|
|
89
|
+
) => void;
|
|
90
|
+
};
|
|
91
|
+
const initDataContext: QBDataContextType = {
|
|
92
|
+
// authProcessed: false,
|
|
93
|
+
storage: {
|
|
94
|
+
LOCAL_DATA_SOURCE: initialValues.LOCAL_DATA_SOURCE, // localstorage or session storage
|
|
95
|
+
REMOTE_DATA_SOURCE: initialValues.REMOTE_DATA_SOURCE, // QB instances
|
|
96
|
+
CONNECTION_REPOSITORY: initialValues.CONNECTION_REPOSITORY,
|
|
97
|
+
EVENT_MESSAGE_REPOSITORY: initialEvent.EVENT_MESSAGE_REPOSITORY,
|
|
98
|
+
SYNC_DIALOGS_USE_CASE: initialSync.SYNC_DIALOGS_USE_CASE,
|
|
99
|
+
// SYNC_DIALOGS_USE_CASE: new SyncDialogsUseCase(
|
|
100
|
+
// new DialogsRepository(
|
|
101
|
+
// initialValues.LOCAL_DATA_SOURCE,
|
|
102
|
+
// initialValues.REMOTE_DATA_SOURCE,
|
|
103
|
+
// ),
|
|
104
|
+
// initialValues.CONNECTION_REPOSITORY,
|
|
105
|
+
// initialEvent.EVENT_MESSAGE_REPOSITORY,
|
|
106
|
+
// ),
|
|
107
|
+
},
|
|
108
|
+
InitParams: {
|
|
109
|
+
accountData: QBConfig.credentials,
|
|
110
|
+
maxFileSize: QBConfig.appConfig.maxFileSize,
|
|
111
|
+
},
|
|
112
|
+
updateQBInitParams: (InitParams: InitParams) => {
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
114
|
+
console.log(
|
|
115
|
+
`call function updateQBInitParams with param ${JSON.stringify(
|
|
116
|
+
InitParams,
|
|
117
|
+
)}`,
|
|
118
|
+
);
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
120
|
+
// @ts-ignore
|
|
121
|
+
this.InitParams = InitParams;
|
|
122
|
+
},
|
|
123
|
+
updateStorage: (storage: QBDataStorage) => {
|
|
124
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
125
|
+
console.log(`empty function with param ${storage}`);
|
|
126
|
+
},
|
|
127
|
+
release: (): void => {
|
|
128
|
+
console.log(`function release start`);
|
|
129
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/ban-ts-comment
|
|
130
|
+
// @ts-ignore
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
132
|
+
initialSync.SYNC_DIALOGS_USE_CASE.release();
|
|
133
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/ban-ts-comment
|
|
134
|
+
// @ts-ignore
|
|
135
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
136
|
+
initialValues.CONNECTION_REPOSITORY.stopKeepAlive();
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/ban-ts-comment
|
|
138
|
+
// @ts-ignore
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
140
|
+
initialValues.REMOTE_DATA_SOURCE.disconnectAndLogoutUser().catch();
|
|
141
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/ban-ts-comment
|
|
142
|
+
// @ts-ignore
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
144
|
+
initialValues.LOCAL_DATA_SOURCE.clearAll().catch();
|
|
145
|
+
console.log(`function release end`);
|
|
146
|
+
},
|
|
147
|
+
authorize: async (authorizationData: AuthorizationData): Promise<void> => {
|
|
148
|
+
console.log('UI Kit authorize');
|
|
149
|
+
initialValues.REMOTE_DATA_SOURCE.authInformation = authorizationData;
|
|
150
|
+
initialValues.REMOTE_DATA_SOURCE.setAuthProcessedSuccessed();
|
|
151
|
+
//
|
|
152
|
+
initialValues.REMOTE_DATA_SOURCE.initEventsHandlers();
|
|
153
|
+
//
|
|
154
|
+
console.log('UI Kit authorize event handler has initialized');
|
|
155
|
+
//
|
|
156
|
+
await initialValues.CONNECTION_REPOSITORY.initializeStates();
|
|
157
|
+
if (!initialValues.CONNECTION_REPOSITORY.needInit) {
|
|
158
|
+
initialValues.CONNECTION_REPOSITORY.keepALiveChatConnection();
|
|
159
|
+
}
|
|
160
|
+
await initialSync.SYNC_DIALOGS_USE_CASE.execute(() => {
|
|
161
|
+
console.log('sync dialogs has started');
|
|
162
|
+
}).catch(() => {
|
|
163
|
+
console.log('sync dialogs has exception');
|
|
164
|
+
});
|
|
165
|
+
//
|
|
166
|
+
console.log(`function authorize end`);
|
|
167
|
+
//
|
|
168
|
+
},
|
|
169
|
+
setSubscribeOnSessionExpiredListener: (
|
|
170
|
+
callback: CallBackFunction<boolean>,
|
|
171
|
+
): void => {
|
|
172
|
+
initialValues.REMOTE_DATA_SOURCE.subscribeOnSessionExpiredListener(
|
|
173
|
+
callback,
|
|
174
|
+
);
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export const qbDataContext =
|
|
179
|
+
React.createContext<QBDataContextType>(initDataContext);
|
|
180
|
+
|
|
181
|
+
const { Provider } = qbDataContext;
|
|
182
|
+
|
|
183
|
+
function QuickBloxUIKitProvider({
|
|
184
|
+
children,
|
|
185
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
186
|
+
accountData,
|
|
187
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
188
|
+
qbConfig,
|
|
189
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
190
|
+
loginData,
|
|
191
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
192
|
+
maxFileSize,
|
|
193
|
+
}: QuickBloxProviderProps) {
|
|
194
|
+
console.log(
|
|
195
|
+
'QuickBloxUIKitProvider with account data: ',
|
|
196
|
+
JSON.stringify(accountData),
|
|
197
|
+
);
|
|
198
|
+
console.log(
|
|
199
|
+
'QuickBloxUIKitProvider with login data: ',
|
|
200
|
+
JSON.stringify(loginData),
|
|
201
|
+
);
|
|
202
|
+
const initStorageState = {
|
|
203
|
+
LOCAL_DATA_SOURCE: initialValues.LOCAL_DATA_SOURCE, // localstorage or session storage
|
|
204
|
+
REMOTE_DATA_SOURCE: initialValues.REMOTE_DATA_SOURCE, // QB instances
|
|
205
|
+
CONNECTION_REPOSITORY: initialValues.CONNECTION_REPOSITORY,
|
|
206
|
+
EVENT_MESSAGE_REPOSITORY: initialEvent.EVENT_MESSAGE_REPOSITORY,
|
|
207
|
+
SYNC_DIALOGS_USE_CASE: initialSync.SYNC_DIALOGS_USE_CASE,
|
|
208
|
+
// SYNC_DIALOGS_USE_CASE: new SyncDialogsUseCase(
|
|
209
|
+
// new DialogsRepository(
|
|
210
|
+
// initialValues.LOCAL_DATA_SOURCE,
|
|
211
|
+
// initialValues.REMOTE_DATA_SOURCE,
|
|
212
|
+
// ),
|
|
213
|
+
// initialValues.CONNECTION_REPOSITORY,
|
|
214
|
+
// initialEvent.EVENT_MESSAGE_REPOSITORY,
|
|
215
|
+
// ),
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
console.log(
|
|
219
|
+
'QuickBloxUIKitProvider with storage init data: ',
|
|
220
|
+
JSON.stringify(initStorageState),
|
|
221
|
+
);
|
|
222
|
+
const [storage, setStorage] = React.useState<QBDataStorage>(initStorageState);
|
|
223
|
+
|
|
224
|
+
console.log('have storage useState completed');
|
|
225
|
+
const updateStorage = (dataStorage: QBDataStorage) => {
|
|
226
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
227
|
+
setStorage(dataStorage);
|
|
228
|
+
};
|
|
229
|
+
// todo: must use accountData if we haves
|
|
230
|
+
const [InitParams, setInitParams] = React.useState<InitParams>({
|
|
231
|
+
accountData: {
|
|
232
|
+
appId: accountData.appId,
|
|
233
|
+
accountKey: accountData.accountKey,
|
|
234
|
+
authKey: accountData.authKey,
|
|
235
|
+
authSecret: accountData.authSecret,
|
|
236
|
+
sessionToken: accountData.sessionToken,
|
|
237
|
+
},
|
|
238
|
+
loginData: {
|
|
239
|
+
login: loginData?.login || '',
|
|
240
|
+
password: loginData?.password || '',
|
|
241
|
+
},
|
|
242
|
+
maxFileSize,
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
console.log('have InitParams useState completed');
|
|
246
|
+
const updateQBInitParams = (initParams: InitParams) => {
|
|
247
|
+
console.log(`log updateQBInitParams ${JSON.stringify(initParams)}`);
|
|
248
|
+
setInitParams(initParams);
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const release = (): void => {
|
|
252
|
+
console.log(`function release start`);
|
|
253
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/ban-ts-comment
|
|
254
|
+
// @ts-ignore
|
|
255
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
256
|
+
initialSync.SYNC_DIALOGS_USE_CASE.release();
|
|
257
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/ban-ts-comment
|
|
258
|
+
// @ts-ignore
|
|
259
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
260
|
+
initialValues.CONNECTION_REPOSITORY.stopKeepAlive();
|
|
261
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/ban-ts-comment
|
|
262
|
+
// @ts-ignore
|
|
263
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
264
|
+
initialValues.REMOTE_DATA_SOURCE.disconnectAndLogoutUser().catch();
|
|
265
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/ban-ts-comment
|
|
266
|
+
// @ts-ignore
|
|
267
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
268
|
+
initialValues.LOCAL_DATA_SOURCE.clearAll().catch();
|
|
269
|
+
console.log(`function release end`);
|
|
270
|
+
};
|
|
271
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
272
|
+
// @ts-ignore
|
|
273
|
+
const authorize = (authorizationData: AuthorizationData): Promise<void> => {
|
|
274
|
+
initialValues.REMOTE_DATA_SOURCE.authInformation = authorizationData;
|
|
275
|
+
initialValues.REMOTE_DATA_SOURCE.setAuthProcessedSuccessed();
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
const setSubscribeOnSessionExpiredListener = (
|
|
279
|
+
callback: CallBackFunction<boolean>,
|
|
280
|
+
): void => {
|
|
281
|
+
initialValues.REMOTE_DATA_SOURCE.subscribeOnSessionExpiredListener(
|
|
282
|
+
callback,
|
|
283
|
+
);
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
// todo: temporary off, must turn on
|
|
287
|
+
// todo: cause of recycle v1
|
|
288
|
+
// storage.CONNECTION_REPOSITORY.keepALiveChatConnection();
|
|
289
|
+
// todo: temporary off, must turn on
|
|
290
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
291
|
+
// storage.SYNC_DIALOGS_USE_CASE.execute(() => {});
|
|
292
|
+
|
|
293
|
+
// todo: MUST use sessionToken or login/pass to re-init
|
|
294
|
+
// const remoteDataSourceMock: RemoteDataSource =
|
|
295
|
+
// storage.REMOTE_DATA_SOURCE as RemoteDataSource;
|
|
296
|
+
// // remoteDataSourceMock
|
|
297
|
+
// .initSDK({
|
|
298
|
+
// appIdOrToken: QBInitParams.accountData.appId,
|
|
299
|
+
// authKeyOrAppId: QBInitParams.accountData.authKey,
|
|
300
|
+
// authSecret: QBInitParams.accountData.authSecret,
|
|
301
|
+
// accountKey: QBInitParams.accountData.accountKey,
|
|
302
|
+
// })
|
|
303
|
+
// .catch(() => {
|
|
304
|
+
// console.log('EXCEPTION remoteDataSourceMock.initSDK');
|
|
305
|
+
// });
|
|
306
|
+
// console.log('!!!-3-after initSDK');
|
|
307
|
+
// // todo: temporary off, must turn on and reorganize code rows
|
|
308
|
+
// storage.CONNECTION_REPOSITORY.initializeStates();
|
|
309
|
+
// // todo: must delete it
|
|
310
|
+
// remoteDataSourceMock.setUpMockStorage();
|
|
311
|
+
// // START SYNC MOCK
|
|
312
|
+
// storage.SYNC_DIALOGS_USE_CASE.execute(() => {
|
|
313
|
+
// console.log('SYNC_DIALOGS_USE_CASE_MOCK.execute');
|
|
314
|
+
// }).catch(() => {
|
|
315
|
+
// console.log('EXCEPTION SYNC_DIALOGS_USE_CASE_MOCK.execute');
|
|
316
|
+
// });
|
|
317
|
+
|
|
318
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
319
|
+
// const [authProcessed, setAuthProcessed] = React.useState(false);
|
|
320
|
+
// const updateAuthProcessedStatus = (status: boolean) => {
|
|
321
|
+
// console.log('updateAuthProcessedStatus, set ', status);
|
|
322
|
+
// setAuthProcessed(status);
|
|
323
|
+
// };
|
|
324
|
+
|
|
325
|
+
return (
|
|
326
|
+
<Provider
|
|
327
|
+
value={{
|
|
328
|
+
InitParams,
|
|
329
|
+
updateQBInitParams,
|
|
330
|
+
// authProcessed,
|
|
331
|
+
release,
|
|
332
|
+
authorize,
|
|
333
|
+
setSubscribeOnSessionExpiredListener,
|
|
334
|
+
storage,
|
|
335
|
+
updateStorage,
|
|
336
|
+
}}
|
|
337
|
+
>
|
|
338
|
+
<ModalContextProvider>{children}</ModalContextProvider>
|
|
339
|
+
</Provider>
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export default QuickBloxUIKitProvider;
|
package/src/Presentation/components/providers/QuickBloxUIKitProvider/useEventMessagesRepository.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import EventMessagesRepository from '../../../../Data/repository/EventMessagesRepository';
|
|
2
|
+
import useQbDataContext from './useQbDataContext';
|
|
3
|
+
|
|
4
|
+
const useEventMessagesRepository = (): EventMessagesRepository => {
|
|
5
|
+
const currentQbDataContext = useQbDataContext();
|
|
6
|
+
|
|
7
|
+
return currentQbDataContext.storage.EVENT_MESSAGE_REPOSITORY;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default useEventMessagesRepository;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { qbDataContext } from './QuickBloxUIKitProvider';
|
|
3
|
+
import ConnectionRepository from '../../../../Data/repository/ConnectionRepository';
|
|
4
|
+
|
|
5
|
+
type QBConnectionInfo = {
|
|
6
|
+
connectionRepository: ConnectionRepository;
|
|
7
|
+
browserOnline: boolean;
|
|
8
|
+
};
|
|
9
|
+
const useQBConnection = (): QBConnectionInfo => {
|
|
10
|
+
const currentQbDataContext = React.useContext(qbDataContext);
|
|
11
|
+
const [navigatorOnline, setNavigatorOnline] = React.useState(
|
|
12
|
+
navigator.onLine,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const setOnline = () => {
|
|
17
|
+
setNavigatorOnline(true);
|
|
18
|
+
};
|
|
19
|
+
const setOffline = () => {
|
|
20
|
+
setNavigatorOnline(false);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
window.addEventListener('online', setOnline);
|
|
24
|
+
window.addEventListener('offline', setOffline);
|
|
25
|
+
|
|
26
|
+
return () => {
|
|
27
|
+
window.removeEventListener('online', setOnline);
|
|
28
|
+
window.removeEventListener('offline', setOffline);
|
|
29
|
+
};
|
|
30
|
+
}, []);
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
browserOnline: navigatorOnline,
|
|
34
|
+
connectionRepository: currentQbDataContext.storage.CONNECTION_REPOSITORY,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default useQBConnection;
|