quickblox-react-ui-kit 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +258 -255
- package/dist/App.d.ts +1 -2
- 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/Button.d.ts +1 -1
- package/dist/Presentation/components/Navbar.d.ts +1 -2
- package/dist/Presentation/components/TextInput.d.ts +1 -1
- package/dist/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.d.ts +2 -2
- 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/UI/Placeholders/LoaderComponent/LoaderComponent.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Add/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/AddContact/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Archive/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Copy/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Delete/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Download/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Edit/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/EditDots/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Emoji/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/ForwardFilled/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Hungup/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/IncomeCall/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Like/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/NewChat/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/OutcomeCall/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Phone/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/PhoneFilled/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Remove/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Remove2/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/ReplyFilled/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Send/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Share/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/SwapCamera/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Unarchive/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/VideoIcon/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Voice/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/Brodcast/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/Chat/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/ChatFilled/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/Conference/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/Contact/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/ContactFilled/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/GroupChat/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/Notifications/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/PrivateChat/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/PublicChannel/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/Stream/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/StreamFilled/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Contents/User/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Media/Attachment/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Media/AudioFile/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Media/BrokenFile/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Media/Camera/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Media/GifFile/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Media/ImageFile/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Media/ImageFilled/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Media/LinkWeb/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Media/Location/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Media/TextDocument/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Media/VideoFile/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Moderation/Admin/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Moderation/Banned/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Moderation/Freeze/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Moderation/Moderations/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Moderation/Muted/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/ArrowLeft/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/ArrowRight/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Back/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Close/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Down/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Leave/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/More/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Next/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Plus/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Refresh/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Search/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Settings/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/SettingsField/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Status/Error/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Status/Help/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Status/Information/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Status/InformationFill/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Status/Loader/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Status/Mention/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Status/Sent/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/CameraOff/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/CameraOn/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/CheckOff/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/CheckOn/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Favourite/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/FavouriteFilled/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/FullScreen/inex.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Hide/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Louder/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/MicOff/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/MicOn/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Minimize/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/NotifyOff/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/NotifyOn/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Pause/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Quite/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Record/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Screenshare/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Show/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Speaker/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/SpeakerOff/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/StopRecord/index.d.ts +1 -2
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/StopShare/index.d.ts +1 -2
- package/dist/Presentation/components/containers/ScrollableContainer/ScrollableContainer.d.ts +1 -1
- 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/Presentation/components/layouts/TestStage/TestStageMarkup.d.ts +1 -2
- package/dist/Presentation/components/providers/ModalContextProvider/Modal.d.ts +1 -1
- package/dist/Presentation/components/providers/ModalContextProvider/ModalContextProvider.d.ts +1 -2
- package/dist/Presentation/components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.d.ts +1 -1
- package/dist/index-ui.d.ts +4 -5
- package/dist/index-ui.js +343 -398
- package/package.json +1 -1
- package/src/App.tsx +14 -7
- package/src/Presentation/Views/Dialogs/Dialogs.tsx +3 -0
- package/src/Presentation/Views/Dialogs/useDialogsViewModel.ts +254 -50
- package/src/Presentation/{components/UI → assets}/ DefaultThemes/DefaultTheme.ts +2 -2
- package/src/Presentation/assets/DarkTheme.ts +2 -2
- package/src/Presentation/assets/LightTheme.ts +2 -2
- package/src/Presentation/assets/{Theme.ts → UiKitTheme.ts} +2 -2
- package/src/Presentation/components/UI/Buttons/MainButton/MainButton.scss +8 -8
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogInformation.tsx +1 -1
- package/src/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.tsx +2 -2
- package/src/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.tsx +4 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.tsx +9 -3
- package/src/Presentation/components/UI/Dialogs/MessagesView/{useMessagesViewModelWithMockUseCase.ts → useMessagesViewModel.ts} +4 -6
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.tsx +2 -2
- package/src/Presentation/components/layouts/Desktop/{DesktopLayoutForMockModels.tsx → DesktopLayout.tsx} +2 -2
- package/src/Presentation/components/layouts/{TestStage/TestStageWithMockData/TestStageWithMockData.tsx → Desktop/QuickBloxUIKitDesktopLayout.tsx} +37 -29
- package/src/Presentation/components/layouts/TestStage/TestStageMarkup.tsx +1 -1
- package/src/QBconfig.ts +0 -8
- package/src/index-ui.ts +6 -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/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/Views/Dialogs/useDialogsViewModelWithMockUseCase.ts +0 -345
- package/src/Presentation/components/layouts/Desktop/Desktop.tsx +0 -103
- /package/dist/Presentation/{components/UI → assets}/ DefaultThemes/CustomTheme.d.ts +0 -0
- /package/src/Presentation/{components/UI → assets}/ DefaultThemes/CustomTheme.ts +0 -0
|
@@ -28,11 +28,11 @@ import ChatMessageAttachmentEntity from '../../../../../Domain/entity/ChatMessag
|
|
|
28
28
|
import { UserTypingMessageUseCase } from '../../../../../Domain/use_cases/UserTypingMessageUseCase';
|
|
29
29
|
import { DialogEventInfo } from '../../../../../Domain/entity/DialogEventInfo';
|
|
30
30
|
|
|
31
|
-
export default function
|
|
31
|
+
export default function useMessagesViewModel(
|
|
32
32
|
dialogType: DialogType,
|
|
33
33
|
dialogEntity: DialogEntity,
|
|
34
34
|
): MessagesViewModel {
|
|
35
|
-
console.log('
|
|
35
|
+
console.log('useMessagesViewModel');
|
|
36
36
|
const [loading, setLoading] = useState(false);
|
|
37
37
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38
38
|
const [error, setError] = useState('error: wrong message list');
|
|
@@ -50,9 +50,7 @@ export default function useMessagesViewModelWithMockUseCase(
|
|
|
50
50
|
|
|
51
51
|
const [typingText, setTypingText] = useState<string>('');
|
|
52
52
|
const dialogUpdateHandler = (dialogInfo: DialogEventInfo) => {
|
|
53
|
-
console.log(
|
|
54
|
-
'call dialogUpdateHandler in useMessagesViewModelWithMockUseCase',
|
|
55
|
-
);
|
|
53
|
+
console.log('call dialogUpdateHandler in useMessagesViewModel');
|
|
56
54
|
const getSender = async (sender_id: number) => {
|
|
57
55
|
const getUser: GetUsersByIdsUseCase = new GetUsersByIdsUseCase(
|
|
58
56
|
new UsersRepository(
|
|
@@ -338,7 +336,7 @@ export default function useMessagesViewModelWithMockUseCase(
|
|
|
338
336
|
const errorMessage = stringifyError(reason);
|
|
339
337
|
|
|
340
338
|
console.log(
|
|
341
|
-
'exception in sendMessage in
|
|
339
|
+
'exception in sendMessage in useMessagesViewModel',
|
|
342
340
|
errorMessage,
|
|
343
341
|
);
|
|
344
342
|
setLoading(false);
|
|
@@ -13,7 +13,7 @@ import RowLeftContainer from '../../../containers/RowLeftContainer/RowLeftContai
|
|
|
13
13
|
import PreviewDialogViewModel from './PreviewDialogViewModel';
|
|
14
14
|
import NotifyOff from '../../svgs/Icons/Toggle/NotifyOff';
|
|
15
15
|
import EditDots from '../../svgs/Icons/Actions/EditDots';
|
|
16
|
-
import
|
|
16
|
+
import UiKitTheme from '../../../../assets/UiKitTheme';
|
|
17
17
|
|
|
18
18
|
export type ThemeNames = 'light' | 'dark' | 'custom';
|
|
19
19
|
type PreviewDialogsColorTheme = {
|
|
@@ -26,7 +26,7 @@ type PreviewDialogsColorTheme = {
|
|
|
26
26
|
};
|
|
27
27
|
type PreviewDialogsTheme = {
|
|
28
28
|
themeName?: ThemeNames;
|
|
29
|
-
colorTheme?:
|
|
29
|
+
colorTheme?: UiKitTheme;
|
|
30
30
|
selected: boolean;
|
|
31
31
|
muted: boolean;
|
|
32
32
|
};
|
|
@@ -6,7 +6,7 @@ type LayoutItems = {
|
|
|
6
6
|
dialogMessagesView: React.ReactNode;
|
|
7
7
|
dialogInfoView: React.ReactNode;
|
|
8
8
|
};
|
|
9
|
-
function
|
|
9
|
+
function DesktopLayout({
|
|
10
10
|
dialogsView,
|
|
11
11
|
dialogMessagesView,
|
|
12
12
|
dialogInfoView,
|
|
@@ -28,4 +28,4 @@ function DesktopLayoutForMockModels({
|
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export default
|
|
31
|
+
export default DesktopLayout;
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import useQbDataContext from '
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
import useQbDataContext from '../../providers/QuickBloxUIKitProvider/useQbDataContext';
|
|
3
|
+
import { DialogEntity } from '../../../../Domain/entity/DialogEntity';
|
|
4
|
+
import { DialogsViewModel } from '../../../Views/Dialogs/DialogViewModel';
|
|
5
|
+
import DialogsComponent from '../../../Views/Dialogs/Dialogs';
|
|
6
|
+
import DialogInformation from '../../UI/Dialogs/DialogInformation/DialogInformation';
|
|
7
|
+
import DesktopLayout from './DesktopLayout';
|
|
8
|
+
import MessagesView from '../../UI/Dialogs/MessagesView/MessagesView';
|
|
9
|
+
import useDialogsViewModel from '../../../Views/Dialogs/useDialogsViewModel';
|
|
10
|
+
import { Pagination } from '../../../../Domain/repository/Pagination';
|
|
11
|
+
import { SubscribeToDialogEventsUseCase } from '../../../../Domain/use_cases/SubscribeToDialogEventsUseCase';
|
|
12
|
+
import useEventMessagesRepository from '../../providers/QuickBloxUIKitProvider/useEventMessagesRepository';
|
|
13
|
+
import EventMessageType from '../../../../Domain/entity/EventMessageType';
|
|
14
|
+
import { NotificationTypes } from '../../../../Domain/entity/NotificationTypes';
|
|
15
|
+
import { stringifyError } from '../../../../utils/parse';
|
|
16
|
+
import { DialogEventInfo } from '../../../../Domain/entity/DialogEventInfo';
|
|
17
|
+
import UiKitTheme from '../../../assets/UiKitTheme';
|
|
18
|
+
import BaseViewModel from '../../../Views/Base/BaseViewModel';
|
|
19
|
+
|
|
20
|
+
type QuickBloxUIKitDesktopLayoutProps = {
|
|
21
|
+
theme?: UiKitTheme;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const QuickBloxUIKitDesktopLayout: React.FC<
|
|
25
|
+
QuickBloxUIKitDesktopLayoutProps
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars,react/function-component-definition
|
|
27
|
+
> = ({ theme = undefined }: QuickBloxUIKitDesktopLayoutProps) => {
|
|
28
|
+
console.log('create QuickBloxUIKitDesktopLayout');
|
|
21
29
|
const [selectedDialog, setSelectedDialog] =
|
|
22
30
|
React.useState<BaseViewModel<DialogEntity>>();
|
|
23
31
|
|
|
@@ -25,20 +33,20 @@ function TestStageWithMockData() {
|
|
|
25
33
|
const eventMessaging = useEventMessagesRepository();
|
|
26
34
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
27
35
|
// @ts-ignore
|
|
28
|
-
const
|
|
29
|
-
currentContext.storage.REMOTE_DATA_SOURCE.authInformation;
|
|
36
|
+
const userName =
|
|
37
|
+
currentContext.storage.REMOTE_DATA_SOURCE.authInformation?.userName;
|
|
30
38
|
const userId =
|
|
31
39
|
currentContext.storage.REMOTE_DATA_SOURCE.authInformation?.userId;
|
|
32
40
|
|
|
33
41
|
const dialogsViewModel: DialogsViewModel =
|
|
34
|
-
|
|
42
|
+
useDialogsViewModel(currentContext);
|
|
35
43
|
|
|
36
44
|
const subscribeToDialogEventsUseCase: SubscribeToDialogEventsUseCase =
|
|
37
45
|
new SubscribeToDialogEventsUseCase(eventMessaging, 'TestStage');
|
|
38
46
|
|
|
39
47
|
/* DATA needed to init MockData
|
|
40
|
-
const remoteDataSourceMock:
|
|
41
|
-
.
|
|
48
|
+
const remoteDataSourceMock: RemoteDataSourceMock = currentContext.storage
|
|
49
|
+
.REMOTE_DATA_SOURCE_MOCK as RemoteDataSourceMock;
|
|
42
50
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
43
51
|
const localDataSource: LocalDataSource =
|
|
44
52
|
currentContext.storage.LOCAL_DATA_SOURCE;
|
|
@@ -55,11 +63,11 @@ function TestStageWithMockData() {
|
|
|
55
63
|
|
|
56
64
|
console.log(
|
|
57
65
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
58
|
-
`initialValue.
|
|
66
|
+
`initialValue.REMOTE_DATA_SOURCE_MOCK.needInit: ${currentContext.storage.REMOTE_DATA_SOURCE.needInit}`,
|
|
59
67
|
);
|
|
60
68
|
console.log(
|
|
61
69
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
62
|
-
`initialValue.
|
|
70
|
+
`initialValue.REMOTE_DATA_SOURCE_MOCK.authProcessed: ${currentContext.storage.REMOTE_DATA_SOURCE.authProcessed}`,
|
|
63
71
|
);
|
|
64
72
|
|
|
65
73
|
console.log(
|
|
@@ -159,7 +167,7 @@ function TestStageWithMockData() {
|
|
|
159
167
|
};
|
|
160
168
|
|
|
161
169
|
return (
|
|
162
|
-
<
|
|
170
|
+
<DesktopLayout
|
|
163
171
|
dialogsView={
|
|
164
172
|
<DialogsComponent
|
|
165
173
|
dialogsViewModel={dialogsViewModel} // 1 Get 2 Update UseCase
|
|
@@ -204,6 +212,6 @@ function TestStageWithMockData() {
|
|
|
204
212
|
}
|
|
205
213
|
/>
|
|
206
214
|
);
|
|
207
|
-
}
|
|
215
|
+
};
|
|
208
216
|
|
|
209
|
-
export default
|
|
217
|
+
export default QuickBloxUIKitDesktopLayout;
|
|
@@ -200,7 +200,7 @@ function TestStageMarkup() {
|
|
|
200
200
|
);
|
|
201
201
|
|
|
202
202
|
function changeThemeActions() {
|
|
203
|
-
console.log('
|
|
203
|
+
console.log('UiKitTheme has changed.');
|
|
204
204
|
setThemeName(document.documentElement.getAttribute('data-theme'));
|
|
205
205
|
setDialogsList(dialogs);
|
|
206
206
|
}
|
package/src/QBconfig.ts
CHANGED
package/src/index-ui.ts
CHANGED
|
@@ -2,8 +2,6 @@ import './index.scss';
|
|
|
2
2
|
import MainButton, {
|
|
3
3
|
TypeButton,
|
|
4
4
|
} from './Presentation/components/UI/Buttons/MainButton/MainButton';
|
|
5
|
-
import MyButton from './MyButton/MyButton';
|
|
6
|
-
import MyInput from './MyInput/MyInput';
|
|
7
5
|
import QuickBloxUIKitProvider, {
|
|
8
6
|
qbDataContext,
|
|
9
7
|
} from './Presentation/components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider';
|
|
@@ -12,14 +10,14 @@ import useQBConnection from './Presentation/components/providers/QuickBloxUIKitP
|
|
|
12
10
|
import useQbDataContext from './Presentation/components/providers/QuickBloxUIKitProvider/useQbDataContext';
|
|
13
11
|
import useEventMessagesRepository from './Presentation/components/providers/QuickBloxUIKitProvider/useEventMessagesRepository';
|
|
14
12
|
import { DialogsViewModel } from './Presentation/Views/Dialogs/DialogViewModel';
|
|
15
|
-
import
|
|
13
|
+
import useDialogsViewModel from './Presentation/Views/Dialogs/useDialogsViewModel';
|
|
16
14
|
import { SubscribeToDialogEventsUseCase } from './Domain/use_cases/SubscribeToDialogEventsUseCase';
|
|
17
15
|
import { Pagination } from './Domain/repository/Pagination';
|
|
18
16
|
import { DialogEventInfo } from './Domain/entity/DialogEventInfo';
|
|
19
17
|
import EventMessageType from './Domain/entity/EventMessageType';
|
|
20
18
|
import { NotificationTypes } from './Domain/entity/NotificationTypes';
|
|
21
19
|
import { stringifyError } from './utils/parse';
|
|
22
|
-
import
|
|
20
|
+
import DesktopLayout from './Presentation/components/layouts/Desktop/DesktopLayout';
|
|
23
21
|
import DialogsComponent from './Presentation/Views/Dialogs/Dialogs';
|
|
24
22
|
import MessagesView from './Presentation/components/UI/Dialogs/MessagesView/MessagesView';
|
|
25
23
|
import DialogInformation from './Presentation/components/UI/Dialogs/DialogInformation/DialogInformation';
|
|
@@ -29,11 +27,10 @@ import {
|
|
|
29
27
|
LoginData,
|
|
30
28
|
RemoteDataSource,
|
|
31
29
|
} from './Data/source/remote/RemoteDataSource';
|
|
30
|
+
import QuickBloxUIKitDesktopLayout from './Presentation/components/layouts/Desktop/QuickBloxUIKitDesktopLayout';
|
|
32
31
|
|
|
33
32
|
export {
|
|
34
33
|
MainButton,
|
|
35
|
-
MyButton,
|
|
36
|
-
MyInput,
|
|
37
34
|
TypeButton,
|
|
38
35
|
type LoginData,
|
|
39
36
|
QuickBloxUIKitProvider,
|
|
@@ -44,17 +41,18 @@ export {
|
|
|
44
41
|
useQbDataContext,
|
|
45
42
|
useEventMessagesRepository,
|
|
46
43
|
type DialogsViewModel,
|
|
47
|
-
|
|
44
|
+
useDialogsViewModel,
|
|
48
45
|
SubscribeToDialogEventsUseCase,
|
|
49
46
|
Pagination,
|
|
50
47
|
type DialogEventInfo,
|
|
51
48
|
EventMessageType,
|
|
52
49
|
NotificationTypes,
|
|
53
50
|
stringifyError,
|
|
54
|
-
|
|
51
|
+
DesktopLayout,
|
|
55
52
|
DialogsComponent,
|
|
56
53
|
MessagesView,
|
|
57
54
|
DialogInformation,
|
|
58
55
|
type DialogEntity,
|
|
59
56
|
BaseViewModel,
|
|
57
|
+
QuickBloxUIKitDesktopLayout,
|
|
60
58
|
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { QBDataContextType } from '../../components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider';
|
|
2
|
-
import { Pagination } from '../../../Domain/repository/Pagination';
|
|
3
|
-
import { DialogsViewModel } from './DialogViewModel';
|
|
4
|
-
export default function useDialogsViewModelWithMockUseCase(currentContext: QBDataContextType, initPagination?: Pagination): DialogsViewModel;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, {FC} from "react";
|
|
2
|
-
import './MyButton.scss';
|
|
3
|
-
|
|
4
|
-
export interface MyButtonProps {
|
|
5
|
-
children?: React.ReactNode
|
|
6
|
-
color: string;
|
|
7
|
-
big: boolean;
|
|
8
|
-
}
|
|
9
|
-
const MyButton: FC<MyButtonProps> = ({
|
|
10
|
-
children,
|
|
11
|
-
color,
|
|
12
|
-
big,
|
|
13
|
-
...props}) => {
|
|
14
|
-
const rootClasses = ['my-button'];
|
|
15
|
-
if (big) {
|
|
16
|
-
rootClasses.push('big-btn')
|
|
17
|
-
}
|
|
18
|
-
return(
|
|
19
|
-
<button {...props} className={rootClasses.join(' ')} style={{color}}>
|
|
20
|
-
{children}
|
|
21
|
-
</button>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default MyButton;
|
package/src/MyInput/MyInput.scss
DELETED
package/src/MyInput/MyInput.tsx
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React, {FC} from "react";
|
|
2
|
-
import './MyInput.scss';
|
|
3
|
-
|
|
4
|
-
export interface MyInputProps {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
placeholer: string;
|
|
7
|
-
label: string;
|
|
8
|
-
big: boolean;
|
|
9
|
-
}
|
|
10
|
-
const MyInput: FC<MyInputProps> = ({
|
|
11
|
-
children,
|
|
12
|
-
placeholer,
|
|
13
|
-
label,
|
|
14
|
-
big,
|
|
15
|
-
...props
|
|
16
|
-
}) => {
|
|
17
|
-
const rootClasses = ['my-input'];
|
|
18
|
-
if (big) {
|
|
19
|
-
rootClasses.push('big-input')
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return(
|
|
23
|
-
<div>
|
|
24
|
-
<label>
|
|
25
|
-
{label}
|
|
26
|
-
<input className={rootClasses.join(' ')}
|
|
27
|
-
placeholder={placeholer} {...props} />
|
|
28
|
-
</label>
|
|
29
|
-
<div className="name">*important data</div>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export default MyInput;
|