@abihealth/goapp-react-native 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +157 -0
- package/README.md +3 -0
- package/dist/common/animations/Animation.d.ts +10 -0
- package/dist/common/animations/Animation.js +38 -0
- package/dist/common/animations/FindingAnimation/index.d.ts +2 -0
- package/dist/common/animations/FindingAnimation/index.js +20 -0
- package/dist/common/animations/FindingAnimation/xml.d.ts +2 -0
- package/dist/common/animations/FindingAnimation/xml.js +7 -0
- package/dist/common/animations/HorizontalLoadingAnimation/index.d.ts +5 -0
- package/dist/common/animations/HorizontalLoadingAnimation/index.js +14 -0
- package/dist/common/animations/HorizontalLoadingAnimation/xml.d.ts +1 -0
- package/dist/common/animations/HorizontalLoadingAnimation/xml.js +5 -0
- package/dist/common/animations/LoadingCircleAnimation/index.d.ts +2 -0
- package/dist/common/animations/LoadingCircleAnimation/index.js +24 -0
- package/dist/common/animations/LoadingCircleAnimation/xml.d.ts +2 -0
- package/dist/common/animations/LoadingCircleAnimation/xml.js +5 -0
- package/dist/common/animations/LoadingDotsAnimation/index.d.ts +6 -0
- package/dist/common/animations/LoadingDotsAnimation/index.js +17 -0
- package/dist/common/animations/LoadingDotsAnimation/xml.d.ts +1 -0
- package/dist/common/animations/LoadingDotsAnimation/xml.js +5 -0
- package/dist/common/animations/LoadingHeart.d.ts +2 -0
- package/dist/common/animations/LoadingHeart.js +92 -0
- package/dist/common/api/auth.d.ts +2 -0
- package/dist/common/api/auth.js +18 -0
- package/dist/common/api/config.d.ts +7 -0
- package/dist/common/api/config.js +15 -0
- package/dist/common/api/consultation.d.ts +6 -0
- package/dist/common/api/consultation.js +80 -0
- package/dist/common/api/models/auth.d.ts +8 -0
- package/dist/common/api/models/auth.js +2 -0
- package/dist/common/api/models/consultation.d.ts +70 -0
- package/dist/common/api/models/consultation.js +23 -0
- package/dist/common/api/models/region.d.ts +1 -0
- package/dist/common/api/models/region.js +2 -0
- package/dist/common/api/models/user.d.ts +5 -0
- package/dist/common/api/models/user.js +2 -0
- package/dist/common/api/models/websocket.d.ts +6 -0
- package/dist/common/api/models/websocket.js +2 -0
- package/dist/common/api/user.d.ts +2 -0
- package/dist/common/api/user.js +10 -0
- package/dist/common/api/websocket.d.ts +6 -0
- package/dist/common/api/websocket.js +66 -0
- package/dist/common/assets/background-pattern.png +0 -0
- package/dist/common/components/ActionSheet.d.ts +6 -0
- package/dist/common/components/ActionSheet.js +43 -0
- package/dist/common/components/AnswerScreen/Card.d.ts +8 -0
- package/dist/common/components/AnswerScreen/Card.js +76 -0
- package/dist/common/components/AnswerScreen/CloseConsultationActionSheet.d.ts +2 -0
- package/dist/common/components/AnswerScreen/CloseConsultationActionSheet.js +109 -0
- package/dist/common/components/AnswerScreen/DeliveryAddressCard.d.ts +5 -0
- package/dist/common/components/AnswerScreen/DeliveryAddressCard.js +39 -0
- package/dist/common/components/AnswerScreen/PrescriptionCard/PrescriptionCardHeader.d.ts +5 -0
- package/dist/common/components/AnswerScreen/PrescriptionCard/PrescriptionCardHeader.js +79 -0
- package/dist/common/components/AnswerScreen/PrescriptionCard/index.d.ts +5 -0
- package/dist/common/components/AnswerScreen/PrescriptionCard/index.js +46 -0
- package/dist/common/components/AnswerScreen/Summary.d.ts +5 -0
- package/dist/common/components/AnswerScreen/Summary.js +49 -0
- package/dist/common/components/BackgroundPattern.d.ts +2 -0
- package/dist/common/components/BackgroundPattern.js +19 -0
- package/dist/common/components/Button.d.ts +14 -0
- package/dist/common/components/Button.js +124 -0
- package/dist/common/components/CancelConsultationButton.d.ts +2 -0
- package/dist/common/components/CancelConsultationButton.js +107 -0
- package/dist/common/components/Card.d.ts +2 -0
- package/dist/common/components/Card.js +13 -0
- package/dist/common/components/Checkbox.d.ts +7 -0
- package/dist/common/components/Checkbox.js +75 -0
- package/dist/common/components/DateInput.d.ts +8 -0
- package/dist/common/components/DateInput.js +76 -0
- package/dist/common/components/DoctorProfileCard.d.ts +8 -0
- package/dist/common/components/DoctorProfileCard.js +128 -0
- package/dist/common/components/FadeIn.d.ts +8 -0
- package/dist/common/components/FadeIn.js +66 -0
- package/dist/common/components/FormControl.d.ts +8 -0
- package/dist/common/components/FormControl.js +40 -0
- package/dist/common/components/FormWrapper.d.ts +11 -0
- package/dist/common/components/FormWrapper.js +46 -0
- package/dist/common/components/Header.d.ts +10 -0
- package/dist/common/components/Header.js +109 -0
- package/dist/common/components/Input.d.ts +8 -0
- package/dist/common/components/Input.js +74 -0
- package/dist/common/components/Modal/AttachmentPreviewModal.d.ts +9 -0
- package/dist/common/components/Modal/AttachmentPreviewModal.js +68 -0
- package/dist/common/components/Modal/CancelModal.d.ts +9 -0
- package/dist/common/components/Modal/CancelModal.js +16 -0
- package/dist/common/components/Modal/CloseConsultationModal.d.ts +9 -0
- package/dist/common/components/Modal/CloseConsultationModal.js +16 -0
- package/dist/common/components/Modal/DoctorProfileModal.d.ts +8 -0
- package/dist/common/components/Modal/DoctorProfileModal.js +47 -0
- package/dist/common/components/Modal/ModalHeader.d.ts +7 -0
- package/dist/common/components/Modal/ModalHeader.js +40 -0
- package/dist/common/components/Modal/TwoOptionsModal.d.ts +14 -0
- package/dist/common/components/Modal/TwoOptionsModal.js +58 -0
- package/dist/common/components/Modal/index.d.ts +7 -0
- package/dist/common/components/Modal/index.js +57 -0
- package/dist/common/components/PhoneInput.d.ts +11 -0
- package/dist/common/components/PhoneInput.js +81 -0
- package/dist/common/components/Reminder.d.ts +7 -0
- package/dist/common/components/Reminder.js +214 -0
- package/dist/common/components/ScreenWrapper.d.ts +12 -0
- package/dist/common/components/ScreenWrapper.js +46 -0
- package/dist/common/components/Select.d.ts +17 -0
- package/dist/common/components/Select.js +132 -0
- package/dist/common/components/Slide.d.ts +13 -0
- package/dist/common/components/Slide.js +83 -0
- package/dist/common/components/SlideUp.d.ts +8 -0
- package/dist/common/components/SlideUp.js +69 -0
- package/dist/common/components/Text.d.ts +22 -0
- package/dist/common/components/Text.js +130 -0
- package/dist/common/contexts/ConsultationContext.d.ts +22 -0
- package/dist/common/contexts/ConsultationContext.js +215 -0
- package/dist/common/contexts/FormContext.d.ts +25 -0
- package/dist/common/contexts/FormContext.js +55 -0
- package/dist/common/contexts/ThemeContext.d.ts +13 -0
- package/dist/common/contexts/ThemeContext.js +18 -0
- package/dist/common/hooks/useConsultation.d.ts +13 -0
- package/dist/common/hooks/useConsultation.js +166 -0
- package/dist/common/hooks/useForm.d.ts +10 -0
- package/dist/common/hooks/useForm.js +107 -0
- package/dist/common/hooks/useHeader.d.ts +4 -0
- package/dist/common/hooks/useHeader.js +10 -0
- package/dist/common/hooks/useTheme.d.ts +2 -0
- package/dist/common/hooks/useTheme.js +26 -0
- package/dist/common/hooks/useUser.d.ts +4 -0
- package/dist/common/hooks/useUser.js +10 -0
- package/dist/common/icons/AbiLogoIcon.d.ts +2 -0
- package/dist/common/icons/AbiLogoIcon.js +53 -0
- package/dist/common/icons/BackArrowIcon.d.ts +2 -0
- package/dist/common/icons/BackArrowIcon.js +49 -0
- package/dist/common/icons/CalendarIcon.d.ts +3 -0
- package/dist/common/icons/CalendarIcon.js +43 -0
- package/dist/common/icons/CheckSuccessIcon.d.ts +3 -0
- package/dist/common/icons/CheckSuccessIcon.js +47 -0
- package/dist/common/icons/CloseIcon.d.ts +5 -0
- package/dist/common/icons/CloseIcon.js +51 -0
- package/dist/common/icons/DoctorIcon.d.ts +3 -0
- package/dist/common/icons/DoctorIcon.js +48 -0
- package/dist/common/icons/DoctorImagePlaceholderIcon.d.ts +5 -0
- package/dist/common/icons/DoctorImagePlaceholderIcon.js +64 -0
- package/dist/common/icons/DropdownIcon.d.ts +3 -0
- package/dist/common/icons/DropdownIcon.js +41 -0
- package/dist/common/icons/ExitIcon.d.ts +2 -0
- package/dist/common/icons/ExitIcon.js +58 -0
- package/dist/common/icons/InfoIcon.d.ts +2 -0
- package/dist/common/icons/InfoIcon.js +49 -0
- package/dist/common/icons/KoCircleIcon.d.ts +3 -0
- package/dist/common/icons/KoCircleIcon.js +42 -0
- package/dist/common/icons/MotorbikeIcon.d.ts +2 -0
- package/dist/common/icons/MotorbikeIcon.js +65 -0
- package/dist/common/icons/NoCaseFoundIcon.d.ts +3 -0
- package/dist/common/icons/NoCaseFoundIcon.js +55 -0
- package/dist/common/icons/PdfDownloadIcon.d.ts +2 -0
- package/dist/common/icons/PdfDownloadIcon.js +58 -0
- package/dist/common/icons/PdfIcon.d.ts +2 -0
- package/dist/common/icons/PdfIcon.js +50 -0
- package/dist/common/icons/PersonIcon.d.ts +3 -0
- package/dist/common/icons/PersonIcon.js +45 -0
- package/dist/common/icons/PillsIcon.d.ts +2 -0
- package/dist/common/icons/PillsIcon.js +52 -0
- package/dist/common/icons/PlaneIcon.d.ts +5 -0
- package/dist/common/icons/PlaneIcon.js +48 -0
- package/dist/common/icons/RatingIcon.d.ts +2 -0
- package/dist/common/icons/RatingIcon.js +53 -0
- package/dist/common/icons/StarIcon.d.ts +4 -0
- package/dist/common/icons/StarIcon.js +57 -0
- package/dist/common/icons/TextConsultationIcon.d.ts +4 -0
- package/dist/common/icons/TextConsultationIcon.js +53 -0
- package/dist/common/icons/TrashIcon.d.ts +2 -0
- package/dist/common/icons/TrashIcon.js +49 -0
- package/dist/common/icons/VideoConsultationIcon.d.ts +4 -0
- package/dist/common/icons/VideoConsultationIcon.js +50 -0
- package/dist/common/index.d.ts +57 -0
- package/dist/common/index.js +114 -0
- package/dist/common/locale/i18n.d.ts +5 -0
- package/dist/common/locale/i18n.js +79 -0
- package/dist/common/locale/translations/ar-AE.base.json +604 -0
- package/dist/common/locale/translations/ar-LB.base.json +604 -0
- package/dist/common/locale/translations/bg.base.json +488 -0
- package/dist/common/locale/translations/cs.base.json +499 -0
- package/dist/common/locale/translations/en.base.json +923 -0
- package/dist/common/locale/translations/es-MX.base.json +827 -0
- package/dist/common/locale/translations/es.base.json +827 -0
- package/dist/common/locale/translations/fr.base.json +605 -0
- package/dist/common/locale/translations/hu.base.json +488 -0
- package/dist/common/locale/translations/pl.base.json +487 -0
- package/dist/common/locale/translations/ro.base.json +501 -0
- package/dist/common/locale/translations/ru.base.json +603 -0
- package/dist/common/locale/translations/sk.base.json +535 -0
- package/dist/common/locale/translations/zh-HK.base.json +349 -0
- package/dist/common/locale/translations/zh-SG.base.json +603 -0
- package/dist/common/locale/translations/zh-TW.base.json +873 -0
- package/dist/common/screens/AnswerScreen.d.ts +11 -0
- package/dist/common/screens/AnswerScreen.js +101 -0
- package/dist/common/screens/MatchScreen.d.ts +5 -0
- package/dist/common/screens/MatchScreen.js +36 -0
- package/dist/common/screens/MatchingScreen.d.ts +2 -0
- package/dist/common/screens/MatchingScreen.js +41 -0
- package/dist/common/screens/NoConsultationFoundScreen.d.ts +2 -0
- package/dist/common/screens/NoConsultationFoundScreen.js +34 -0
- package/dist/common/screens/PreparingSummaryScreen.d.ts +5 -0
- package/dist/common/screens/PreparingSummaryScreen.js +35 -0
- package/dist/common/screens/RatingScreen.d.ts +2 -0
- package/dist/common/screens/RatingScreen.js +198 -0
- package/dist/common/screens/index.d.ts +3 -0
- package/dist/common/screens/index.js +29 -0
- package/dist/common/types/consultation.d.ts +93 -0
- package/dist/common/types/consultation.js +41 -0
- package/dist/common/types/deliveryAddress.d.ts +18 -0
- package/dist/common/types/deliveryAddress.js +11 -0
- package/dist/common/types/events.d.ts +13 -0
- package/dist/common/types/events.js +15 -0
- package/dist/common/types/prescription.d.ts +52 -0
- package/dist/common/types/prescription.js +31 -0
- package/dist/common/types/professional.d.ts +14 -0
- package/dist/common/types/professional.js +2 -0
- package/dist/common/types/theme.d.ts +82 -0
- package/dist/common/types/theme.js +58 -0
- package/dist/common/types/user.d.ts +10 -0
- package/dist/common/types/user.js +2 -0
- package/dist/common/utils/platform.d.ts +3 -0
- package/dist/common/utils/platform.js +7 -0
- package/dist/common/utils/professional.d.ts +2 -0
- package/dist/common/utils/professional.js +12 -0
- package/dist/common/utils/zod.d.ts +5 -0
- package/dist/common/utils/zod.js +19 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.js +133 -0
- package/dist/video-consultations/animations/CallingAnimation/index.d.ts +2 -0
- package/dist/video-consultations/animations/CallingAnimation/index.js +17 -0
- package/dist/video-consultations/animations/CallingAnimation/xml.d.ts +2 -0
- package/dist/video-consultations/animations/CallingAnimation/xml.js +5 -0
- package/dist/video-consultations/api/models/video.d.ts +10 -0
- package/dist/video-consultations/api/models/video.js +2 -0
- package/dist/video-consultations/api/video.d.ts +3 -0
- package/dist/video-consultations/api/video.js +12 -0
- package/dist/video-consultations/components/AgoraWrapper/components/BaseRenderUsers.d.ts +12 -0
- package/dist/video-consultations/components/AgoraWrapper/components/BaseRenderUsers.js +174 -0
- package/dist/video-consultations/components/AgoraWrapper/components/BtnControls.d.ts +14 -0
- package/dist/video-consultations/components/AgoraWrapper/components/BtnControls.js +55 -0
- package/dist/video-consultations/components/AgoraWrapper/components/ui/index.d.ts +14 -0
- package/dist/video-consultations/components/AgoraWrapper/components/ui/index.js +100 -0
- package/dist/video-consultations/components/AgoraWrapper/index.d.ts +8 -0
- package/dist/video-consultations/components/AgoraWrapper/index.js +173 -0
- package/dist/video-consultations/components/Modal/EndVideoCallModal.d.ts +8 -0
- package/dist/video-consultations/components/Modal/EndVideoCallModal.js +15 -0
- package/dist/video-consultations/components/VideoConsultation.d.ts +7 -0
- package/dist/video-consultations/components/VideoConsultation.js +42 -0
- package/dist/video-consultations/helpers/eventHandler.d.ts +14 -0
- package/dist/video-consultations/helpers/eventHandler.js +61 -0
- package/dist/video-consultations/hooks/useInitRtcEngine.d.ts +15 -0
- package/dist/video-consultations/hooks/useInitRtcEngine.js +194 -0
- package/dist/video-consultations/icons/EndVideoCallIcon.d.ts +2 -0
- package/dist/video-consultations/icons/EndVideoCallIcon.js +51 -0
- package/dist/video-consultations/icons/HangUpIcon.d.ts +3 -0
- package/dist/video-consultations/icons/HangUpIcon.js +41 -0
- package/dist/video-consultations/icons/MicroOffIcon.d.ts +7 -0
- package/dist/video-consultations/icons/MicroOffIcon.js +47 -0
- package/dist/video-consultations/icons/MicroOnIcon.d.ts +3 -0
- package/dist/video-consultations/icons/MicroOnIcon.js +42 -0
- package/dist/video-consultations/icons/PersonIcon.d.ts +3 -0
- package/dist/video-consultations/icons/PersonIcon.js +45 -0
- package/dist/video-consultations/icons/SwitchCameraIcon.d.ts +3 -0
- package/dist/video-consultations/icons/SwitchCameraIcon.js +41 -0
- package/dist/video-consultations/icons/VideoOffIcon.d.ts +5 -0
- package/dist/video-consultations/icons/VideoOffIcon.js +44 -0
- package/dist/video-consultations/icons/VideoOnIcon.d.ts +3 -0
- package/dist/video-consultations/icons/VideoOnIcon.js +41 -0
- package/dist/video-consultations/index.d.ts +10 -0
- package/dist/video-consultations/index.js +24 -0
- package/dist/video-consultations/screens/DeliveryAddressScreen.d.ts +2 -0
- package/dist/video-consultations/screens/DeliveryAddressScreen.js +84 -0
- package/dist/video-consultations/screens/EndingVideoScreen.d.ts +5 -0
- package/dist/video-consultations/screens/EndingVideoScreen.js +27 -0
- package/dist/video-consultations/screens/JoinVideoCallScreen.d.ts +5 -0
- package/dist/video-consultations/screens/JoinVideoCallScreen.js +108 -0
- package/dist/video-consultations/screens/ProcessingPrescriptionScreen.d.ts +2 -0
- package/dist/video-consultations/screens/ProcessingPrescriptionScreen.js +32 -0
- package/dist/video-consultations/screens/VideoCallScreen.d.ts +3 -0
- package/dist/video-consultations/screens/VideoCallScreen.js +77 -0
- package/dist/video-consultations/utils/permission.d.ts +14 -0
- package/dist/video-consultations/utils/permission.js +97 -0
- package/package.json +58 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.authorization = void 0;
|
|
4
|
+
var config_1 = require("./config");
|
|
5
|
+
var AUTH_URL = 'partner/authorization/token';
|
|
6
|
+
var BASE_URL = { ape1: 'https://ape1.api.abi.ai' };
|
|
7
|
+
var authorization = function (_a) {
|
|
8
|
+
var region = _a.region, clientKey = _a.clientKey;
|
|
9
|
+
return config_1.axios
|
|
10
|
+
.post(AUTH_URL, undefined, {
|
|
11
|
+
baseURL: BASE_URL[region],
|
|
12
|
+
headers: {
|
|
13
|
+
'x-api-key': clientKey
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
.then(function (response) { return response === null || response === void 0 ? void 0 : response.data; });
|
|
17
|
+
};
|
|
18
|
+
exports.authorization = authorization;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.axios = exports.configureAxios = void 0;
|
|
7
|
+
var axios_1 = __importDefault(require("axios"));
|
|
8
|
+
exports.axios = axios_1.default;
|
|
9
|
+
var BASE_URL = { ape1: 'https://m10bzqot97.execute-api.ap-east-1.amazonaws.com/prod' };
|
|
10
|
+
var configureAxios = function (_a) {
|
|
11
|
+
var token = _a.token, region = _a.region;
|
|
12
|
+
axios_1.default.defaults.baseURL = BASE_URL[region];
|
|
13
|
+
axios_1.default.defaults.headers.common.Authorization = "Bearer ".concat(token);
|
|
14
|
+
};
|
|
15
|
+
exports.configureAxios = configureAxios;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CancelConsultationRequest, CloseConsultationRequest, ConsultationRequest, CreateConsultationRequest, GetActiveConsultationRequest, RateConsultationRequest } from './models/consultation';
|
|
2
|
+
export declare const createConsultation: ConsultationRequest<CreateConsultationRequest>;
|
|
3
|
+
export declare const getActiveConsultation: ConsultationRequest<GetActiveConsultationRequest>;
|
|
4
|
+
export declare const cancelConsultation: ConsultationRequest<CancelConsultationRequest>;
|
|
5
|
+
export declare const closeConsultation: ConsultationRequest<CloseConsultationRequest>;
|
|
6
|
+
export declare const rateConsultation: ConsultationRequest<RateConsultationRequest>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var _a;
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.rateConsultation = exports.closeConsultation = exports.cancelConsultation = exports.getActiveConsultation = exports.createConsultation = void 0;
|
|
41
|
+
var consultation_1 = require("../types/consultation");
|
|
42
|
+
var config_1 = require("./config");
|
|
43
|
+
var CONSULTATION_URLS = (_a = {},
|
|
44
|
+
_a[consultation_1.CASE_TYPE.VIDEO] = 'video-consultation',
|
|
45
|
+
_a);
|
|
46
|
+
var SEARCH_CONSULTATION_URL = "/search";
|
|
47
|
+
var CANCEL_CONSULTATION_URL = "/cancel";
|
|
48
|
+
var CLOSE_CONSULTATION_URL = "/close";
|
|
49
|
+
var RATE_CONSULTATION_URL = "/rating";
|
|
50
|
+
var createConsultation = function (caseType) { return function (body) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
51
|
+
return [2 /*return*/, config_1.axios.post(CONSULTATION_URLS[caseType], body).then(function (response) { return response === null || response === void 0 ? void 0 : response.data; })];
|
|
52
|
+
}); }); }; };
|
|
53
|
+
exports.createConsultation = createConsultation;
|
|
54
|
+
var getActiveConsultation = function (caseType) {
|
|
55
|
+
return function (_a) {
|
|
56
|
+
var userId = _a.userId;
|
|
57
|
+
return config_1.axios.get("".concat(CONSULTATION_URLS[caseType]).concat(SEARCH_CONSULTATION_URL, "?userId=").concat(userId)).then(function (response) { return response === null || response === void 0 ? void 0 : response.data; });
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
exports.getActiveConsultation = getActiveConsultation;
|
|
61
|
+
var cancelConsultation = function (caseType) { return function (body) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
62
|
+
return [2 /*return*/, config_1.axios.patch("".concat(CONSULTATION_URLS[caseType]).concat(CANCEL_CONSULTATION_URL), body).then(function (response) { return response === null || response === void 0 ? void 0 : response.data; })];
|
|
63
|
+
}); }); }; };
|
|
64
|
+
exports.cancelConsultation = cancelConsultation;
|
|
65
|
+
var closeConsultation = function (caseType) { return function (body) { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
|
+
return __generator(this, function (_a) {
|
|
67
|
+
return [2 /*return*/, config_1.axios
|
|
68
|
+
.patch("".concat(CONSULTATION_URLS[caseType]).concat(CLOSE_CONSULTATION_URL), body)
|
|
69
|
+
.then(function (response) { return response === null || response === void 0 ? void 0 : response.data; })];
|
|
70
|
+
});
|
|
71
|
+
}); }; };
|
|
72
|
+
exports.closeConsultation = closeConsultation;
|
|
73
|
+
var rateConsultation = function (caseType) { return function (body) { return __awaiter(void 0, void 0, void 0, function () {
|
|
74
|
+
return __generator(this, function (_a) {
|
|
75
|
+
return [2 /*return*/, config_1.axios
|
|
76
|
+
.post("".concat(CONSULTATION_URLS[caseType]).concat(RATE_CONSULTATION_URL), body)
|
|
77
|
+
.then(function (response) { return response === null || response === void 0 ? void 0 : response.data; })];
|
|
78
|
+
});
|
|
79
|
+
}); }; };
|
|
80
|
+
exports.rateConsultation = rateConsultation;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CASE_TYPE, Consultation } from '../../types/consultation';
|
|
3
|
+
export declare const consultationResponseSchema: z.ZodObject<{
|
|
4
|
+
consultation: z.ZodType<Consultation, z.ZodTypeDef, Consultation>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
consultation?: Consultation;
|
|
7
|
+
}, {
|
|
8
|
+
consultation?: Consultation;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const createConsultationRequestSchema: z.ZodObject<{
|
|
11
|
+
userId: z.ZodString;
|
|
12
|
+
question: z.ZodString;
|
|
13
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
userId?: string;
|
|
16
|
+
question?: string;
|
|
17
|
+
attachments?: string[];
|
|
18
|
+
}, {
|
|
19
|
+
userId?: string;
|
|
20
|
+
question?: string;
|
|
21
|
+
attachments?: string[];
|
|
22
|
+
}>;
|
|
23
|
+
export declare const getActiveConsultationRequestSchema: z.ZodObject<{
|
|
24
|
+
userId: z.ZodString;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
userId?: string;
|
|
27
|
+
}, {
|
|
28
|
+
userId?: string;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const cancelConsultationRequestSchema: z.ZodObject<{
|
|
31
|
+
consultationId: z.ZodString;
|
|
32
|
+
userId: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
userId?: string;
|
|
35
|
+
consultationId?: string;
|
|
36
|
+
}, {
|
|
37
|
+
userId?: string;
|
|
38
|
+
consultationId?: string;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const closeConsultationRequestSchema: z.ZodObject<{
|
|
41
|
+
consultationId: z.ZodString;
|
|
42
|
+
userId: z.ZodString;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
userId?: string;
|
|
45
|
+
consultationId?: string;
|
|
46
|
+
}, {
|
|
47
|
+
userId?: string;
|
|
48
|
+
consultationId?: string;
|
|
49
|
+
}>;
|
|
50
|
+
export declare const rateConsultationRequestSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
51
|
+
consultationId: z.ZodString;
|
|
52
|
+
userId: z.ZodString;
|
|
53
|
+
}, {
|
|
54
|
+
rating: z.ZodNumber;
|
|
55
|
+
}>, "strip", z.ZodTypeAny, {
|
|
56
|
+
userId?: string;
|
|
57
|
+
consultationId?: string;
|
|
58
|
+
rating?: number;
|
|
59
|
+
}, {
|
|
60
|
+
userId?: string;
|
|
61
|
+
consultationId?: string;
|
|
62
|
+
rating?: number;
|
|
63
|
+
}>;
|
|
64
|
+
export type ConsultationResponse = z.infer<typeof consultationResponseSchema>;
|
|
65
|
+
export type CreateConsultationRequest = z.infer<typeof createConsultationRequestSchema>;
|
|
66
|
+
export type GetActiveConsultationRequest = z.infer<typeof getActiveConsultationRequestSchema>;
|
|
67
|
+
export type CancelConsultationRequest = z.infer<typeof cancelConsultationRequestSchema>;
|
|
68
|
+
export type CloseConsultationRequest = z.infer<typeof closeConsultationRequestSchema>;
|
|
69
|
+
export type RateConsultationRequest = z.infer<typeof rateConsultationRequestSchema>;
|
|
70
|
+
export type ConsultationRequest<T> = (caseType: CASE_TYPE) => (body: T) => Promise<ConsultationResponse>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rateConsultationRequestSchema = exports.closeConsultationRequestSchema = exports.cancelConsultationRequestSchema = exports.getActiveConsultationRequestSchema = exports.createConsultationRequestSchema = exports.consultationResponseSchema = void 0;
|
|
4
|
+
var zod_1 = require("zod");
|
|
5
|
+
exports.consultationResponseSchema = zod_1.z.object({
|
|
6
|
+
consultation: zod_1.z.custom()
|
|
7
|
+
});
|
|
8
|
+
exports.createConsultationRequestSchema = zod_1.z.object({
|
|
9
|
+
userId: zod_1.z.string(),
|
|
10
|
+
question: zod_1.z.string(),
|
|
11
|
+
attachments: zod_1.z.array(zod_1.z.string()).optional()
|
|
12
|
+
});
|
|
13
|
+
exports.getActiveConsultationRequestSchema = zod_1.z.object({
|
|
14
|
+
userId: zod_1.z.string()
|
|
15
|
+
});
|
|
16
|
+
exports.cancelConsultationRequestSchema = zod_1.z.object({
|
|
17
|
+
consultationId: zod_1.z.string(),
|
|
18
|
+
userId: zod_1.z.string()
|
|
19
|
+
});
|
|
20
|
+
exports.closeConsultationRequestSchema = exports.cancelConsultationRequestSchema;
|
|
21
|
+
exports.rateConsultationRequestSchema = exports.cancelConsultationRequestSchema.extend({
|
|
22
|
+
rating: zod_1.z.number()
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type REGION = 'ape1';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUser = void 0;
|
|
4
|
+
var config_1 = require("./config");
|
|
5
|
+
var USER_URL = "/user";
|
|
6
|
+
var getUser = function (_a) {
|
|
7
|
+
var userId = _a.userId;
|
|
8
|
+
return config_1.axios.get("".concat(USER_URL, "/").concat(userId)).then(function (response) { return response === null || response === void 0 ? void 0 : response.data; });
|
|
9
|
+
};
|
|
10
|
+
exports.getUser = getUser;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.connectWebsocket = void 0;
|
|
40
|
+
var WS_URL = { ape1: 'wss://yrmfk5amqg.execute-api.ap-east-1.amazonaws.com/prod' };
|
|
41
|
+
var connectWebsocket = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
42
|
+
var token = _b.token, userId = _b.userId, region = _b.region;
|
|
43
|
+
return __generator(this, function (_c) {
|
|
44
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
45
|
+
console.log('❔ Connecting to WS...', { token: token, userId: userId, region: region });
|
|
46
|
+
try {
|
|
47
|
+
var websocket_1 = new WebSocket("".concat(WS_URL[region], "?eventType=CONNECT"), null);
|
|
48
|
+
websocket_1.onopen = function () {
|
|
49
|
+
console.log('🟢 WS connected');
|
|
50
|
+
websocket_1.send(JSON.stringify({ action: 'connect', payload: { userId: userId, token: "Bearer ".concat(token) } }));
|
|
51
|
+
resolve(websocket_1);
|
|
52
|
+
};
|
|
53
|
+
websocket_1.onerror = function (e) {
|
|
54
|
+
console.error('🔴 WS error', JSON.stringify(e, null, 2));
|
|
55
|
+
};
|
|
56
|
+
websocket_1.onclose = function (e) {
|
|
57
|
+
console.log('❌ WS closed', JSON.stringify(e, null, 2));
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
reject(e);
|
|
62
|
+
}
|
|
63
|
+
})];
|
|
64
|
+
});
|
|
65
|
+
}); };
|
|
66
|
+
exports.connectWebsocket = connectWebsocket;
|
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { ViewProps } from 'react-native';
|
|
3
|
+
import { SlideProps } from './Slide';
|
|
4
|
+
type ActionSheetProps = ViewProps & SlideProps;
|
|
5
|
+
export declare const ActionSheet: ({ children, height, mode, ...props }: PropsWithChildren<ActionSheetProps>) => React.JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ActionSheet = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var react_native_1 = require("react-native");
|
|
20
|
+
var useTheme_1 = require("../hooks/useTheme");
|
|
21
|
+
var Slide_1 = require("./Slide");
|
|
22
|
+
var ActionSheet = function (_a) {
|
|
23
|
+
var children = _a.children, height = _a.height, mode = _a.mode, props = __rest(_a, ["children", "height", "mode"]);
|
|
24
|
+
var theme = (0, useTheme_1.useTheme)();
|
|
25
|
+
var styles = getStyles(theme);
|
|
26
|
+
return (<Slide_1.Slide {...props} style={[styles.container, theme.shadows.soft, props.style]} height={height} mode={mode}>
|
|
27
|
+
{children}
|
|
28
|
+
</Slide_1.Slide>);
|
|
29
|
+
};
|
|
30
|
+
exports.ActionSheet = ActionSheet;
|
|
31
|
+
var getStyles = function (_a) {
|
|
32
|
+
var borderRadius = _a.borderRadius, colors = _a.colors, spacing = _a.spacing;
|
|
33
|
+
return react_native_1.StyleSheet.create({
|
|
34
|
+
container: {
|
|
35
|
+
borderTopLeftRadius: borderRadius.xl,
|
|
36
|
+
borderTopRightRadius: borderRadius.xl,
|
|
37
|
+
backgroundColor: colors.white,
|
|
38
|
+
width: '100%',
|
|
39
|
+
padding: spacing.sm,
|
|
40
|
+
gap: spacing.sm
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { ViewStyle } from 'react-native-phone-input';
|
|
3
|
+
interface CardProps {
|
|
4
|
+
type: 'question' | 'answer' | 'prescription';
|
|
5
|
+
style?: ViewStyle;
|
|
6
|
+
}
|
|
7
|
+
export declare const Card: ({ children, type, style }: PropsWithChildren<CardProps>) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.Card = void 0;
|
|
48
|
+
var react_1 = __importStar(require("react"));
|
|
49
|
+
var react_native_1 = require("react-native");
|
|
50
|
+
var useTheme_1 = require("../../hooks/useTheme");
|
|
51
|
+
var FadeIn_1 = require("../FadeIn");
|
|
52
|
+
var Card = function (_a) {
|
|
53
|
+
var children = _a.children, type = _a.type, style = _a.style;
|
|
54
|
+
var theme = (0, useTheme_1.useTheme)();
|
|
55
|
+
var styles = getStyles(theme);
|
|
56
|
+
var backgroundColor = (0, react_1.useMemo)(function () { return (type === 'question' ? theme.colors.tertiary : theme.colors.white); }, []);
|
|
57
|
+
var borderRadius = (0, react_1.useMemo)(function () {
|
|
58
|
+
switch (type) {
|
|
59
|
+
// If question, remove radius on bottom right
|
|
60
|
+
case 'question':
|
|
61
|
+
return { borderBottomRightRadius: 0 };
|
|
62
|
+
case 'answer':
|
|
63
|
+
return { borderBottomLeftRadius: 0 };
|
|
64
|
+
case 'prescription':
|
|
65
|
+
return { borderTopLeftRadius: 0 };
|
|
66
|
+
}
|
|
67
|
+
}, []);
|
|
68
|
+
return <FadeIn_1.FadeIn style={[styles.card, { backgroundColor: backgroundColor }, borderRadius, style]}>{children}</FadeIn_1.FadeIn>;
|
|
69
|
+
};
|
|
70
|
+
exports.Card = Card;
|
|
71
|
+
var getStyles = function (_a) {
|
|
72
|
+
var shadows = _a.shadows, spacing = _a.spacing, borderRadius = _a.borderRadius;
|
|
73
|
+
return react_native_1.StyleSheet.create({
|
|
74
|
+
card: __assign({ width: '100%', padding: spacing.sm, borderRadius: borderRadius.xl }, shadows.soft)
|
|
75
|
+
});
|
|
76
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
45
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
46
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
47
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
48
|
+
function step(op) {
|
|
49
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
50
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
51
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
52
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
53
|
+
switch (op[0]) {
|
|
54
|
+
case 0: case 1: t = op; break;
|
|
55
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
56
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
57
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
58
|
+
default:
|
|
59
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
60
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
61
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
62
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
63
|
+
if (t[2]) _.ops.pop();
|
|
64
|
+
_.trys.pop(); continue;
|
|
65
|
+
}
|
|
66
|
+
op = body.call(thisArg, _);
|
|
67
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
68
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
72
|
+
exports.CloseConsultationActionSheet = void 0;
|
|
73
|
+
var react_1 = __importStar(require("react"));
|
|
74
|
+
var react_i18next_1 = require("react-i18next");
|
|
75
|
+
var useConsultation_1 = require("../../hooks/useConsultation");
|
|
76
|
+
var ActionSheet_1 = require("../ActionSheet");
|
|
77
|
+
var Button_1 = require("../Button");
|
|
78
|
+
var CloseConsultationModal_1 = require("../Modal/CloseConsultationModal");
|
|
79
|
+
var CloseConsultationActionSheet = function () {
|
|
80
|
+
var t = (0, react_i18next_1.useTranslation)().t;
|
|
81
|
+
var close = (0, useConsultation_1.useConsultation)().close;
|
|
82
|
+
var _a = (0, react_1.useState)(false), loading = _a[0], setLoading = _a[1];
|
|
83
|
+
var _b = (0, react_1.useState)(false), showModal = _b[0], setShowModal = _b[1];
|
|
84
|
+
var handleCloseConsultation = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
|
+
return __generator(this, function (_a) {
|
|
86
|
+
switch (_a.label) {
|
|
87
|
+
case 0:
|
|
88
|
+
_a.trys.push([0, , 2, 3]);
|
|
89
|
+
setLoading(true);
|
|
90
|
+
return [4 /*yield*/, close()];
|
|
91
|
+
case 1:
|
|
92
|
+
_a.sent();
|
|
93
|
+
return [3 /*break*/, 3];
|
|
94
|
+
case 2:
|
|
95
|
+
setLoading(false);
|
|
96
|
+
return [7 /*endfinally*/];
|
|
97
|
+
case 3: return [2 /*return*/];
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}); };
|
|
101
|
+
return (<>
|
|
102
|
+
<ActionSheet_1.ActionSheet height={85} mode="up">
|
|
103
|
+
<Button_1.Button onPress={function () { return setShowModal(true); }}>{t('button.close_consultation')}</Button_1.Button>
|
|
104
|
+
</ActionSheet_1.ActionSheet>
|
|
105
|
+
|
|
106
|
+
<CloseConsultationModal_1.CloseConsultationModal visible={showModal} onConfirm={handleCloseConsultation} onCancel={function () { return setShowModal(false); }} loading={loading}/>
|
|
107
|
+
</>);
|
|
108
|
+
};
|
|
109
|
+
exports.CloseConsultationActionSheet = CloseConsultationActionSheet;
|