@abihealth/goapp-react-native 1.37.0 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/common/components/modals/TwoOptionsModal.d.ts +2 -3
- package/dist/common/components/modals/TwoOptionsModal.js +33 -19
- package/dist/common/types/components.d.ts +2 -0
- package/dist/video-consultations/components/agora/AgoraWrapper.js +7 -3
- package/dist/video-consultations/screens/VideoCallScreen.js +0 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.38.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.37.1...goapp-react-native-v1.38.0) (2025-07-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* make two options modal customisable ([#224](https://github.com/abiglobalhealth/react-native-sdk/issues/224)) ([aa07745](https://github.com/abiglobalhealth/react-native-sdk/commit/aa077451481833ab628d37310ceda0066d671d9a))
|
|
9
|
+
|
|
10
|
+
## [1.37.1](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.37.0...goapp-react-native-v1.37.1) (2025-07-14)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* remove padding ([#222](https://github.com/abiglobalhealth/react-native-sdk/issues/222)) ([401b342](https://github.com/abiglobalhealth/react-native-sdk/commit/401b342f09f50327c6a6d29f2110f03008733a4f))
|
|
16
|
+
|
|
3
17
|
## [1.37.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.36.2...goapp-react-native-v1.37.0) (2025-07-03)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface TwoOptionsModalProps {
|
|
2
|
+
export interface TwoOptionsModalProps {
|
|
3
3
|
icon: React.ReactNode;
|
|
4
4
|
text: string;
|
|
5
5
|
description?: string;
|
|
@@ -10,5 +10,4 @@ interface TwoOptionsModalProps {
|
|
|
10
10
|
visible: boolean;
|
|
11
11
|
loading?: boolean;
|
|
12
12
|
}
|
|
13
|
-
export declare const TwoOptionsModal: (
|
|
14
|
-
export {};
|
|
13
|
+
export declare const TwoOptionsModal: (props: TwoOptionsModalProps) => React.JSX.Element;
|
|
@@ -1,39 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
17
|
exports.TwoOptionsModal = void 0;
|
|
18
|
+
var useCustomComponents_1 = require("../../hooks/useCustomComponents");
|
|
7
19
|
var useTheme_1 = require("../../hooks/useTheme");
|
|
8
20
|
var react_1 = __importDefault(require("react"));
|
|
9
21
|
var react_native_1 = require("react-native");
|
|
10
22
|
var Button_1 = require("../Button");
|
|
11
23
|
var Text_1 = require("../Text");
|
|
12
24
|
var Modal_1 = require("./Modal");
|
|
13
|
-
var TwoOptionsModal = function (
|
|
14
|
-
var
|
|
25
|
+
var TwoOptionsModal = function (props) {
|
|
26
|
+
var visible = props.visible, propsWithoutVisible = __rest(props, ["visible"]);
|
|
27
|
+
var icon = propsWithoutVisible.icon, text = propsWithoutVisible.text, description = propsWithoutVisible.description, confirmText = propsWithoutVisible.confirmText, cancelText = propsWithoutVisible.cancelText, onConfirm = propsWithoutVisible.onConfirm, onCancel = propsWithoutVisible.onCancel, loading = propsWithoutVisible.loading;
|
|
15
28
|
var theme = (0, useTheme_1.useTheme)();
|
|
16
29
|
var styles = getStyles(theme);
|
|
30
|
+
var TwoOptionsModal = (0, useCustomComponents_1.useCustomComponents)().TwoOptionsModal;
|
|
17
31
|
return (<Modal_1.Modal visible={visible} onRequestClose={onCancel}>
|
|
18
|
-
<react_native_1.View style={styles.container}>
|
|
19
|
-
|
|
32
|
+
{TwoOptionsModal ? (<TwoOptionsModal {...propsWithoutVisible}/>) : (<react_native_1.View style={styles.container}>
|
|
33
|
+
{icon}
|
|
20
34
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
<react_native_1.View style={styles.textContainer}>
|
|
36
|
+
<Text_1.Text bold center>
|
|
37
|
+
{text}
|
|
38
|
+
</Text_1.Text>
|
|
39
|
+
{description && <Text_1.Text center>{description}</Text_1.Text>}
|
|
40
|
+
</react_native_1.View>
|
|
27
41
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
<react_native_1.View style={styles.buttonsContainer}>
|
|
43
|
+
<Button_1.Button radio onPress={onConfirm} loading={loading}>
|
|
44
|
+
{confirmText}
|
|
45
|
+
</Button_1.Button>
|
|
46
|
+
<Button_1.Button radio variant="secondary" shadow={false} onPress={onCancel} disabled={loading}>
|
|
47
|
+
{cancelText}
|
|
48
|
+
</Button_1.Button>
|
|
49
|
+
</react_native_1.View>
|
|
50
|
+
</react_native_1.View>)}
|
|
37
51
|
</Modal_1.Modal>);
|
|
38
52
|
};
|
|
39
53
|
exports.TwoOptionsModal = TwoOptionsModal;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TwoOptionsModalProps } from '../components/modals/TwoOptionsModal';
|
|
1
2
|
import { IndicationCategory, IndicationSurveyList } from '../../form-prescriptions/api/models/prescription';
|
|
2
3
|
import { ReactElement, ReactNode } from 'react';
|
|
3
4
|
import { ColorValue } from 'react-native';
|
|
@@ -62,6 +63,7 @@ export type Components = {
|
|
|
62
63
|
}) => ReactElement;
|
|
63
64
|
};
|
|
64
65
|
};
|
|
66
|
+
TwoOptionsModal?: (_: Omit<TwoOptionsModalProps, 'visible'>) => ReactElement;
|
|
65
67
|
screens?: {
|
|
66
68
|
MatchingScreen?: {
|
|
67
69
|
containerStyle?: ViewStyle;
|
|
@@ -43,6 +43,7 @@ var useInitRtcEngine_1 = __importDefault(require("../../hooks/useInitRtcEngine")
|
|
|
43
43
|
var react_1 = __importStar(require("react"));
|
|
44
44
|
var react_native_1 = require("react-native");
|
|
45
45
|
var react_native_agora_1 = require("react-native-agora");
|
|
46
|
+
var EndVideoCallModal_1 = require("../modals/EndVideoCallModal");
|
|
46
47
|
var BaseRenderUsers_1 = __importDefault(require("./components/BaseRenderUsers"));
|
|
47
48
|
var BtnControls_1 = __importDefault(require("./components/BtnControls"));
|
|
48
49
|
var AgoraWrapper = function (_a) {
|
|
@@ -52,6 +53,7 @@ var AgoraWrapper = function (_a) {
|
|
|
52
53
|
var _d = (0, react_1.useState)(false), remoteVideoMuted = _d[0], setRemoteVideoMuted = _d[1];
|
|
53
54
|
var _e = (0, react_1.useState)(false), remoteAudioMuted = _e[0], setRemoteAudioMuted = _e[1];
|
|
54
55
|
var _f = (0, useInitRtcEngine_1.default)(rtcProps, true), channelId = _f.channelId, token = _f.token, uid = _f.uid, joinChannelSuccess = _f.joinChannelSuccess, remoteUsers = _f.remoteUsers, startPreview = _f.startPreview, engine = _f.engine, setRemoteUsers = _f.setRemoteUsers;
|
|
56
|
+
var _g = (0, react_1.useState)(false), showEndCallModal = _g[0], setShowEndCallModal = _g[1];
|
|
55
57
|
var joinChannel = function () {
|
|
56
58
|
if (!channelId) {
|
|
57
59
|
logger_1.Logger.error('channelId is invalid');
|
|
@@ -84,8 +86,9 @@ var AgoraWrapper = function (_a) {
|
|
|
84
86
|
engine.current.muteLocalVideoStream(false);
|
|
85
87
|
setMuteLocalVideoStream(false);
|
|
86
88
|
};
|
|
87
|
-
var
|
|
89
|
+
var handleEndVideoCall = function () {
|
|
88
90
|
engine.current.leaveChannel();
|
|
91
|
+
rtcCallbacks === null || rtcCallbacks === void 0 ? void 0 : rtcCallbacks.endCall();
|
|
89
92
|
};
|
|
90
93
|
var onUserOffline = (0, react_1.useCallback)(function (connection, remoteUid, reason) {
|
|
91
94
|
logger_1.Logger.debug('AgoraWrapper:onUserOffline', {
|
|
@@ -174,11 +177,12 @@ var AgoraWrapper = function (_a) {
|
|
|
174
177
|
localAudioStream: muteLocalAudioStream ? unmuteLocalAudioStream : _muteLocalAudioStream,
|
|
175
178
|
localVideoStream: muteLocalVideoStream ? unmuteLocalVideoStream : _muteLocalVideoStream,
|
|
176
179
|
endCall: function () {
|
|
177
|
-
|
|
178
|
-
rtcCallbacks === null || rtcCallbacks === void 0 ? void 0 : rtcCallbacks.endCall();
|
|
180
|
+
setShowEndCallModal(true);
|
|
179
181
|
}
|
|
180
182
|
}}/>
|
|
181
183
|
</react_native_1.View>
|
|
184
|
+
|
|
185
|
+
<EndVideoCallModal_1.EndVideoCallModal visible={showEndCallModal} onConfirm={handleEndVideoCall} onCancel={function () { return setShowEndCallModal(false); }}/>
|
|
182
186
|
</react_native_1.KeyboardAvoidingView>);
|
|
183
187
|
};
|
|
184
188
|
exports.AgoraWrapper = AgoraWrapper;
|