@jescon-technologies/react-native-ui-kit 0.0.5 → 0.0.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/dist/Common/ErrorBoundary.d.ts +15 -0
- package/dist/Common/ErrorBoundary.d.ts.map +1 -0
- package/dist/Common/ErrorBoundary.js +64 -0
- package/dist/Common/ErrorBoundary.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/src/Common/ErrorBoundary.d.ts +15 -0
- package/dist/src/Common/ErrorBoundary.d.ts.map +1 -0
- package/dist/src/Common/ErrorBoundary.js +64 -0
- package/dist/src/Common/ErrorBoundary.js.map +1 -0
- package/package.json +17 -5
- package/.gitattributes +0 -2
- package/index.d.ts +0 -66
- package/index.js +0 -66
- package/src/Alerts/AAlert.js +0 -137
- package/src/Alerts/AAlertIOS.js +0 -97
- package/src/Alerts/ABlink.js +0 -40
- package/src/Common/ErrorBoundary.tsx +0 -73
- package/src/Common/Icons.js +0 -49
- package/src/Common/NetworkServiceCall.js +0 -265
- package/src/CommonStyle/CommonTheme.js +0 -11
- package/src/CommonStyle/ComponentFunctions.js +0 -632
- package/src/CommonStyle/PopupStyle.js +0 -146
- package/src/CommonStyle/commonStyle.js +0 -93
- package/src/CommonStyle/componentStyle.js +0 -545
- package/src/CommonStyle/optionListStyles.js +0 -175
- package/src/Components/ByProductPage.js +0 -200
- package/src/Components/CDropDownListNew.js +0 -153
- package/src/Components/CSupplierList.js +0 -88
- package/src/Components/CVerificationCard.js +0 -2822
- package/src/Components/CustomButton.js +0 -67
- package/src/Components/CustomCard.js +0 -127
- package/src/Components/CustomTextInput.js +0 -47
- package/src/Components/EquipmentPage.js +0 -313
- package/src/Components/FilterInput.Copy.js +0 -723
- package/src/Components/FilterInput.js +0 -569
- package/src/Components/HSubHeading.js +0 -68
- package/src/Components/HeaderCard.js +0 -40
- package/src/Components/MoreOptionsScreen.js +0 -251
- package/src/Components/NonSwipableProductCard.js +0 -226
- package/src/Components/NonSwipableSupplierCard.js +0 -348
- package/src/Components/ProductCard.js +0 -1336
- package/src/Components/QualityProductCard.js +0 -1059
- package/src/Components/RateProductCard.js +0 -1452
- package/src/Components/RawMaterial.js +0 -261
- package/src/Components/SDropDownEdited.js +0 -549
- package/src/Components/SDropDownNew.js +0 -529
- package/src/Components/SHelpDescription.js +0 -147
- package/src/Components/STextInputNew.js +0 -510
- package/src/Components/SearchProductCard.js +0 -470
- package/src/Components/StageByProduct.js +0 -199
- package/src/Components/SupplierCard.js +0 -243
- package/src/Components/SupplierInvoiceCard.js +0 -405
- package/src/Components/SwipableSupplierCard.js +0 -136
- package/src/Components/TagTemplate.js +0 -74
- package/src/Components/WrappedComponent.js +0 -25
- package/src/Custom/CBooking.js +0 -944
- package/src/Custom/CBookingPostpone.js +0 -1822
- package/src/Custom/CCalendar.js +0 -560
- package/src/Custom/CCard.js +0 -880
- package/src/Custom/CDetailCard.js +0 -205
- package/src/Custom/CHelpImage.js +0 -52
- package/src/Custom/CReport.js +0 -569
- package/src/Custom/CScrollView.js +0 -73
- package/src/Custom/CSignature.js +0 -112
- package/src/Custom/CSliderMenu.js +0 -339
- package/src/Custom/CSupplierCard.js +0 -99
- package/src/Custom/CTemplateCard.js +0 -438
- package/src/Custom/CTokenAllocation.js +0 -1402
- package/src/Custom/CTokenListOverlay.js +0 -122
- package/src/Custom/CWardStatus.js +0 -444
- package/src/Custom/Charts/CBarChart.js +0 -218
- package/src/Custom/Charts/CDashBoardList.js +0 -133
- package/src/Custom/Charts/CDashBoardTable.js +0 -172
- package/src/Custom/Charts/CLineChart.js +0 -193
- package/src/Custom/Charts/CPieChart.js +0 -186
- package/src/Custom/Loader.js +0 -182
- package/src/Custom/OUserView.js +0 -1121
- package/src/Custom/PreviewDosage.js +0 -115
- package/src/Custom/SearchLoader.js +0 -32
- package/src/Custom/TableComponent/CActivityTable.js +0 -707
- package/src/Custom/TableComponent/CMoreButtonTable.js +0 -197
- package/src/Custom/TableComponent/CTable.js +0 -185
- package/src/Custom/TableComponent/CTextBody.js +0 -40
- package/src/Custom/TableComponent/CTextHeader.js +0 -17
- package/src/Custom/TableComponent/PreviewPrescriptionNew.js +0 -1011
- package/src/Custom/TableComponent/SDropdownTable.js +0 -491
- package/src/Custom/TableComponent/TagTable.js +0 -1200
- package/src/CustomComponents/CAddColumn.js +0 -140
- package/src/CustomComponents/CAssessmentDelete.js +0 -307
- package/src/CustomComponents/CAwesomeButton.js +0 -83
- package/src/CustomComponents/CAwesomeMoreButton.js +0 -54
- package/src/CustomComponents/CBackHandler.js +0 -273
- package/src/CustomComponents/CCalendar.js +0 -243
- package/src/CustomComponents/CCommentOverlay.js +0 -202
- package/src/CustomComponents/CComments.js +0 -162
- package/src/CustomComponents/CContainerView.js +0 -24
- package/src/CustomComponents/CCustomTextInput.js +0 -336
- package/src/CustomComponents/CDetailView.js +0 -40
- package/src/CustomComponents/CDropDownList.js +0 -153
- package/src/CustomComponents/CDropdownSelect.js +0 -555
- package/src/CustomComponents/CFooterView.js +0 -42
- package/src/CustomComponents/CImagePickerSave.js +0 -316
- package/src/CustomComponents/CModalOverlay.js +0 -91
- package/src/CustomComponents/CNetworkStatus.js +0 -327
- package/src/CustomComponents/CNotesInstructions.js +0 -1000
- package/src/CustomComponents/COverlay.js +0 -81
- package/src/CustomComponents/CRemarks.js +0 -176
- package/src/CustomComponents/CRowAdd.js +0 -143
- package/src/CustomComponents/CSummaryDropDown.js +0 -327
- package/src/CustomComponents/CText.js +0 -9
- package/src/CustomComponents/CVectorIcon.js +0 -34
- package/src/CustomComponents/HtmlContentViewer.js +0 -65
- package/src/CustomComponents/PdfContentViewer.js +0 -90
- package/src/CustomComponents/SDropDownDosage.js +0 -1087
- package/src/CustomComponents/SwipableProductCard.js +0 -246
- package/src/CustomComponents/SwipableProductImageCard.js +0 -254
- package/src/CustomComponents/WorkOrderDetails.js +0 -1216
- package/src/CustomComponents/WorkOrderDetailsPage.js +0 -1213
- package/src/HOC/ConfirmOverlay.js +0 -192
- package/src/HOC/HHeading.js +0 -70
- package/src/HOC/HMoreButton.js +0 -88
- package/src/HOC/HNatureHeading.js +0 -402
- package/src/HOC/HOCIcons.js +0 -80
- package/src/HOC/HOverlayCentered.js +0 -140
- package/src/HOC/HShadowButton.js +0 -45
- package/src/HOC/HShadowCountButton.js +0 -82
- package/src/HOC/OptionOverlay.js +0 -48
- package/src/Json/Chart.json +0 -818
- package/src/Json/Consultation.json +0 -622
- package/src/Json/CreditBill.json +0 -490
- package/src/Json/Dropdown.json +0 -216
- package/src/Json/DropdownConsultation.json +0 -228
- package/src/Json/DynamicReports.json +0 -623
- package/src/Json/Footer.json +0 -79
- package/src/Media/AudioScreen.js +0 -342
- package/src/Media/BarcodeScan.js +0 -145
- package/src/Media/CAudioPlay.js +0 -228
- package/src/Media/CCaptureImageWithoutEdit.js +0 -330
- package/src/Media/CImageGallery.js +0 -289
- package/src/Media/CImageZoom.js +0 -82
- package/src/Media/CSingleImage.js +0 -391
- package/src/Media/CSketchCanvas.js +0 -76
- package/src/Media/CVideoPlay.js +0 -31
- package/src/Media/DocumentScreen.js +0 -362
- package/src/Media/DrawingScreen.js +0 -578
- package/src/Media/ImageScreen.js +0 -309
- package/src/Media/RecordAudio.js +0 -250
- package/src/Media/RecordVideo.js +0 -223
- package/src/Media/VideoScreen.js +0 -378
- package/src/Navigation/PageNavigation.js +0 -224
- package/src/Navigation/useFocusEffect.js +0 -2
- package/src/Navigation/useFocusEffect.native.js +0 -1
- package/src/Navigation/useFocusEffect.web.js +0 -1
- package/src/Navigation/useIsFocused.js +0 -1
- package/src/Navigation/useIsFocused.native.js +0 -1
- package/src/Navigation/useIsFocused.web.js +0 -1
- package/src/Navigation/useNavigation.js +0 -2
- package/src/Navigation/useNavigation.native.js +0 -1
- package/src/Navigation/useNavigation.web.js +0 -1
- package/src/Screens/CMedications.js +0 -528
- package/src/Screens/CWebViewGallery.js +0 -203
- package/src/Screens/ChartScan.js +0 -279
- package/src/Screens/ChartScreenNew.js +0 -1579
- package/src/Screens/Consultation.js +0 -1500
- package/src/Screens/Dashboard.js +0 -778
- package/src/Screens/FileExplorer.js +0 -288
- package/src/Screens/Footer.js +0 -340
- package/src/Screens/ForgotPassword.js +0 -288
- package/src/Screens/HeaderBlock.js +0 -353
- package/src/Screens/Login.js +0 -328
- package/src/Screens/Notification.js +0 -149
- package/src/Screens/OcrScreen.js +0 -20
- package/src/Screens/PdfPreview.js +0 -507
- package/src/Screens/RegistrationDetails.js +0 -467
- package/src/Screens/SearchScreen.js +0 -582
- package/src/Screens/Splash.js +0 -788
- package/src/Screens/SwipeLeftView.js +0 -1867
- package/src/StaticComponents/SAlphabet.js +0 -47
- package/src/StaticComponents/SCheckBox.js +0 -42
- package/src/StaticComponents/SDatePicker.js +0 -208
- package/src/StaticComponents/SDatePickerLabel.js +0 -253
- package/src/StaticComponents/SDatePickerNew.js +0 -258
- package/src/StaticComponents/SDateTimePickerNew.js +0 -381
- package/src/StaticComponents/SDropDownGenerate.js +0 -450
- package/src/StaticComponents/SDropDownHoc.js +0 -636
- package/src/StaticComponents/SDropDownIcon.js +0 -500
- package/src/StaticComponents/SMenuBox.js +0 -131
- package/src/StaticComponents/SOverlay.js +0 -177
- package/src/StaticComponents/SOverlayTextInput.js +0 -109
- package/src/StaticComponents/SSearch.js +0 -438
- package/src/StaticComponents/SSearchBar.js +0 -53
- package/src/StaticComponents/SSpeedDial.js +0 -303
- package/src/StaticComponents/STextInput.js +0 -289
- package/src/StaticComponents/STextInputProps.js +0 -36
- package/src/StaticComponents/STimePicker.js +0 -171
- package/src/StaticComponents/STimingDropDownNew.js +0 -1585
- package/src/StaticComponents/STimingSwitch.js +0 -34
- package/src/layout/CContainerView.js +0 -21
- package/src/layout/CDetailView.js +0 -81
- package/src/layout/HeaderBlock.js +0 -353
- package/src/layout/INVLoginLayout.js +0 -657
- package/src/layout/Loader.js +0 -176
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
import React, { useState, memo } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Text,
|
|
4
|
-
View,
|
|
5
|
-
Image,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
ActivityIndicator,
|
|
8
|
-
StyleSheet,
|
|
9
|
-
Dimensions,
|
|
10
|
-
PermissionsAndroid,
|
|
11
|
-
Platform,
|
|
12
|
-
} from 'react-native';
|
|
13
|
-
import { colors } from '../CommonStyle/commonStyle';
|
|
14
|
-
import ComponentStyles, { normalize } from '../CommonStyle/componentStyle';
|
|
15
|
-
import NetworkServiceCall from '../Common/NetworkServiceCall';
|
|
16
|
-
import DocumentPicker from 'react-native-document-picker';
|
|
17
|
-
import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
|
18
|
-
import { useNavigation } from '../Navigation/useNavigation';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import { APIURL, EMRAPI, imageURL } from '../../../../../src/Common/apiConstants';
|
|
22
|
-
import { isNU, LoaderIndicator, notifyMessage } from '../CommonStyle/ComponentFunctions';
|
|
23
|
-
import ReactNativeBlobUtil from 'react-native-blob-util';
|
|
24
|
-
//import PhotoEditor from 'react-native-photo-editor';
|
|
25
|
-
import { Global } from '../../../../../src/Common/Global';
|
|
26
|
-
|
|
27
|
-
function CSingleImage(props) {
|
|
28
|
-
|
|
29
|
-
const navigation = useNavigation();
|
|
30
|
-
const { width, height } = Dimensions.get('window');
|
|
31
|
-
const [data, setData] = useState();
|
|
32
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
33
|
-
const [isMsgShow, setIsMsgShow] = useState(false);
|
|
34
|
-
const [Msg, setMsg] = useState(false);
|
|
35
|
-
const [showImage, setShowImage] = useState(props.imageurl != undefined && props.imageurl != null && props.imageurl != '' ? props.imageurl
|
|
36
|
-
: 'https://icon-library.com/images/no-image-icon/no-image-icon-0.jpg');
|
|
37
|
-
console.log('showImage', showImage);
|
|
38
|
-
const [pathPE, setPathPE] = useState();
|
|
39
|
-
|
|
40
|
-
const isPermitted = async () => {
|
|
41
|
-
if (Platform.OS === 'android') {
|
|
42
|
-
try {
|
|
43
|
-
const granted = await PermissionsAndroid.request(
|
|
44
|
-
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE,
|
|
45
|
-
);
|
|
46
|
-
return granted === PermissionsAndroid.RESULTS.GRANTED;
|
|
47
|
-
} catch (err) {
|
|
48
|
-
alert('Write permission error', err);
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
} else {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const getResolvedPath = async (uri, filen) => {
|
|
57
|
-
|
|
58
|
-
const fileBase64 = await ReactNativeBlobUtil.fs.readFile(uri, 'base64');
|
|
59
|
-
const relativePath = ReactNativeBlobUtil.fs.dirs.CacheDir;
|
|
60
|
-
const fileName = `${filen}`;
|
|
61
|
-
const path = `${relativePath}/${fileName}`;
|
|
62
|
-
|
|
63
|
-
// Create temporary file
|
|
64
|
-
await ReactNativeBlobUtil.fs.writeFile(path, fileBase64, 'base64');
|
|
65
|
-
return { relativePath, fileName, path };
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const browseFromDevice = async () => {
|
|
69
|
-
if (await isPermitted()) {
|
|
70
|
-
try {
|
|
71
|
-
const fileDetails = await DocumentPicker.pick({
|
|
72
|
-
type: [DocumentPicker.types.images],
|
|
73
|
-
});
|
|
74
|
-
const { relativePath, fileName, path } = await getResolvedPath(
|
|
75
|
-
fileDetails[0].uri,
|
|
76
|
-
fileDetails[0].name,
|
|
77
|
-
);
|
|
78
|
-
let fileid_autogenerate = 123;
|
|
79
|
-
let dataset = {
|
|
80
|
-
fileid: fileid_autogenerate,
|
|
81
|
-
uri: 'file://' + path,
|
|
82
|
-
filename: fileDetails[0].name + Date(),
|
|
83
|
-
uritype: false,
|
|
84
|
-
};
|
|
85
|
-
if (Platform.OS == 'ios') {
|
|
86
|
-
props.route.params.onSelect({
|
|
87
|
-
uri: dataset.uri,
|
|
88
|
-
filename: 'image',
|
|
89
|
-
filetype: 'image/jpeg',
|
|
90
|
-
});
|
|
91
|
-
props.navigation.goBack();
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
// PhotoEditor.Edit({
|
|
95
|
-
// path: path,
|
|
96
|
-
// hiddenControls: ['sticker', 'save'],
|
|
97
|
-
// onDone: () => {
|
|
98
|
-
// setPathPE(path)
|
|
99
|
-
// Media_Upload(dataset);
|
|
100
|
-
// },
|
|
101
|
-
// });
|
|
102
|
-
}
|
|
103
|
-
} catch (error) {
|
|
104
|
-
console.log('EROOROOOROROROOROROROROOROROROOROOR', error);
|
|
105
|
-
notifyMessage(
|
|
106
|
-
DocumentPicker.isCancel(error)
|
|
107
|
-
? 'Canceled'
|
|
108
|
-
: 'Unknown Error: ' + JSON.stringify(error), 2
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
function getcontainerStyle() {
|
|
115
|
-
return {
|
|
116
|
-
...layoutstyles.container_style,
|
|
117
|
-
width: props.width != undefined ? props.width : '38%',
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Add to folder
|
|
122
|
-
const Media_Upload = async item => {
|
|
123
|
-
|
|
124
|
-
setIsLoading(true);
|
|
125
|
-
let uniquename = '.jpg';
|
|
126
|
-
var formData = new FormData();
|
|
127
|
-
formData.append('file', {
|
|
128
|
-
uri: item.uri,
|
|
129
|
-
type: 'image/jpeg',
|
|
130
|
-
name: uniquename,
|
|
131
|
-
});
|
|
132
|
-
let buttonapi = props.doctorprofile ? EMRAPI.saveDoctorProfile : APIURL + 'file/fileupload/emr/image';
|
|
133
|
-
console.log('buttonapi', buttonapi);
|
|
134
|
-
NetworkServiceCall('multiform', buttonapi, formData)
|
|
135
|
-
.then(function (response) {
|
|
136
|
-
if (response.httpstatus == 200) {
|
|
137
|
-
if (response.data.filesize > 0) {
|
|
138
|
-
setData(response.data.fileuri);
|
|
139
|
-
if (props.doctorprofile) {
|
|
140
|
-
setShowImage(props.profilelink + response.data.fileuri);
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
setShowImage(imageURL + response.data.fileuri);
|
|
144
|
-
}
|
|
145
|
-
props.callBack(response.data.fileuri);
|
|
146
|
-
setIsMsgShow(true, setMsg('Success...'));
|
|
147
|
-
setIsLoading(false);
|
|
148
|
-
setTimeout(() => {
|
|
149
|
-
setIsMsgShow(false);
|
|
150
|
-
}, 2000);
|
|
151
|
-
} else {
|
|
152
|
-
setIsLoading(false);
|
|
153
|
-
setIsMsgShow(true, setMsg('...'));
|
|
154
|
-
setTimeout(() => {
|
|
155
|
-
setIsMsgShow(false);
|
|
156
|
-
}, 2000);
|
|
157
|
-
}
|
|
158
|
-
} else {
|
|
159
|
-
setIsLoading(false);
|
|
160
|
-
setIsMsgShow(true, setMsg('..'));
|
|
161
|
-
setTimeout(() => {
|
|
162
|
-
setIsMsgShow(false);
|
|
163
|
-
}, 2000);
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
function CaptureImageWithoutEdit() {
|
|
169
|
-
// navigation.navigate('CCaptureImageWithoutEdit', {
|
|
170
|
-
// onSelect: Media_Upload
|
|
171
|
-
// });
|
|
172
|
-
|
|
173
|
-
navigation.navigate('CCaptureImageWithoutEdit', {
|
|
174
|
-
'hidebuttons': false,
|
|
175
|
-
'cameratype': 'back',
|
|
176
|
-
onSelect: (s) => s && isNU(s) ? Media_Upload(s) : null,
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
async function getPhotoEditor() {
|
|
181
|
-
console.log('SHOW IMAGE URL:', showImage);
|
|
182
|
-
|
|
183
|
-
if (!showImage) {
|
|
184
|
-
notifyMessage('Image URL is not available.');
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
try {
|
|
189
|
-
// Use NetworkServiceCall to fetch the image
|
|
190
|
-
const response = await NetworkServiceCall('get', showImage, null, null, 60000);
|
|
191
|
-
|
|
192
|
-
if (response.httpstatus === 200 && response.data) {
|
|
193
|
-
const imgData = response.data; // Must be base64 or ArrayBuffer
|
|
194
|
-
|
|
195
|
-
// Save the image locally
|
|
196
|
-
const fileName = `photo_${Math.floor(Math.random() * 10000)}.jpg`;
|
|
197
|
-
const imgPath = `${ReactNativeBlobUtil.fs.dirs.CacheDir}/${fileName}`;
|
|
198
|
-
await ReactNativeBlobUtil.fs.writeFile(imgPath, imgData, 'base64');
|
|
199
|
-
|
|
200
|
-
console.log('The file saved to', imgPath);
|
|
201
|
-
setPathPE(imgPath);
|
|
202
|
-
|
|
203
|
-
const dataset = {
|
|
204
|
-
fileid: Math.floor(Math.random() * 10),
|
|
205
|
-
uri: 'file://' + imgPath,
|
|
206
|
-
filename: '.jpg',
|
|
207
|
-
uritype: false,
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
// Uncomment to use PhotoEditor
|
|
211
|
-
// PhotoEditor.Edit({
|
|
212
|
-
// path: imgPath,
|
|
213
|
-
// hiddenControls: ['sticker', 'save'],
|
|
214
|
-
// onDone: () => {
|
|
215
|
-
// setPathPE(imgPath);
|
|
216
|
-
// Media_Upload(dataset);
|
|
217
|
-
// },
|
|
218
|
-
// });
|
|
219
|
-
} else {
|
|
220
|
-
console.log('Failed to fetch image:', response);
|
|
221
|
-
notifyMessage('Failed to fetch image');
|
|
222
|
-
}
|
|
223
|
-
} catch (error) {
|
|
224
|
-
console.log('Error fetching image:', error);
|
|
225
|
-
notifyMessage('Image download failed');
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
function getTableStyle() {
|
|
231
|
-
return {
|
|
232
|
-
width: props.width != undefined ? props.width : '38%',
|
|
233
|
-
flexDirection: 'row',
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
return (
|
|
238
|
-
<View style={props.table != undefined ? getTableStyle() : getcontainerStyle()}>
|
|
239
|
-
<View style={props.table != undefined ? { flexDirection: 'row', width: normalize(65) } : {}}>
|
|
240
|
-
<TouchableOpacity
|
|
241
|
-
onPress={() => getPhotoEditor()}
|
|
242
|
-
disabled={Platform.OS == 'ios' && isLoading ? true : false}
|
|
243
|
-
style={props.table != undefined ? { borderRadius: 10 } : layoutstyles.image_container_style}>
|
|
244
|
-
{props.table != undefined ?
|
|
245
|
-
<Image style={{ width: normalize(40), height: normalize(40), borderRadius: 10 }}
|
|
246
|
-
source={{
|
|
247
|
-
uri: showImage,
|
|
248
|
-
headers: {
|
|
249
|
-
Authorization: `Bearer ${Global.JWTToken}`,
|
|
250
|
-
},
|
|
251
|
-
}}
|
|
252
|
-
/>
|
|
253
|
-
:
|
|
254
|
-
<Image style={
|
|
255
|
-
props.customimagestyle ?
|
|
256
|
-
props.customimagestyle :
|
|
257
|
-
{
|
|
258
|
-
width: '100%',
|
|
259
|
-
height: normalize(110),
|
|
260
|
-
borderRadius: 20,
|
|
261
|
-
resizeMode: 'cover',
|
|
262
|
-
}}
|
|
263
|
-
source={{
|
|
264
|
-
uri: showImage,
|
|
265
|
-
headers: {
|
|
266
|
-
Authorization: `Bearer ${Global.JWTToken}`,
|
|
267
|
-
},
|
|
268
|
-
}}
|
|
269
|
-
/>}
|
|
270
|
-
{isLoading ?
|
|
271
|
-
<View style={{ position: 'absolute', justifyContent: 'center', alignItems: 'center' }}>
|
|
272
|
-
<LoaderIndicator
|
|
273
|
-
/>
|
|
274
|
-
</View>
|
|
275
|
-
: null}
|
|
276
|
-
</TouchableOpacity>
|
|
277
|
-
|
|
278
|
-
<View style={layoutstyles.options_row}>
|
|
279
|
-
<TouchableOpacity onPress={() => browseFromDevice()}
|
|
280
|
-
style={{ backgroundColor: 'transparent', width: '50%', alignItems: 'center' }}
|
|
281
|
-
>
|
|
282
|
-
<FontAwesome name="folder-open" color={Global.AppTheme.primary_color} size={25} />
|
|
283
|
-
</TouchableOpacity>
|
|
284
|
-
|
|
285
|
-
{props.hidephoto != undefined && props.hidephoto ? null :
|
|
286
|
-
<TouchableOpacity
|
|
287
|
-
style={{ backgroundColor: 'transparent', width: '50%', alignItems: 'center', marginLeft: 5 }}
|
|
288
|
-
onPress={() => CaptureImageWithoutEdit()}>
|
|
289
|
-
<FontAwesome name="camera" color={Global.AppTheme.primary_color} size={25} />
|
|
290
|
-
</TouchableOpacity>}
|
|
291
|
-
|
|
292
|
-
</View>
|
|
293
|
-
</View>
|
|
294
|
-
</View >
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
const layoutstyles = StyleSheet.create({
|
|
298
|
-
container_style: {
|
|
299
|
-
...ComponentStyles.View_col_center,
|
|
300
|
-
padding: normalize(5),
|
|
301
|
-
paddingBottom: 0,
|
|
302
|
-
// height: normalize(165),
|
|
303
|
-
alignItems: 'flex-start',
|
|
304
|
-
},
|
|
305
|
-
image_container_style: {
|
|
306
|
-
flexDirection: 'row',
|
|
307
|
-
justifyContent: 'center',
|
|
308
|
-
alignItems: 'center',
|
|
309
|
-
borderColor: colors.color_componentBordercolor,
|
|
310
|
-
borderWidth: 1,
|
|
311
|
-
borderRadius: 15,
|
|
312
|
-
borderColor: 'lightgrey',
|
|
313
|
-
// height:Dimensions.get('screen').height*0.1
|
|
314
|
-
},
|
|
315
|
-
image_style: {
|
|
316
|
-
width: '100%',
|
|
317
|
-
height: normalize(110),
|
|
318
|
-
// resizeMode:'stretch',
|
|
319
|
-
borderRadius: 20,
|
|
320
|
-
},
|
|
321
|
-
options_row: {
|
|
322
|
-
flexDirection: 'row',
|
|
323
|
-
justifyContent: 'space-around',
|
|
324
|
-
padding: normalize(5),
|
|
325
|
-
paddingBottom: 0,
|
|
326
|
-
},
|
|
327
|
-
option_text: {
|
|
328
|
-
fontSize: normalize(12),
|
|
329
|
-
// color: '#000059',
|
|
330
|
-
color: 'white',
|
|
331
|
-
},
|
|
332
|
-
});
|
|
333
|
-
export default memo(CSingleImage);
|
|
334
|
-
|
|
335
|
-
// Add to folder
|
|
336
|
-
// const Media_Upload = async item => {
|
|
337
|
-
// setShowImage(item.uri)
|
|
338
|
-
// var formData = new FormData();
|
|
339
|
-
// formData.append('file', {
|
|
340
|
-
// uri: item.uri,
|
|
341
|
-
// type: item.filetype,
|
|
342
|
-
// name: item.filename,
|
|
343
|
-
// });
|
|
344
|
-
// NetworkServiceCall('multiform', APIURL + 'file/fileupload/patientphoto', formData)
|
|
345
|
-
// .then(function (response) {
|
|
346
|
-
// if (response.httpstatus == 200) {
|
|
347
|
-
// if (response.data.filesize > 0) {
|
|
348
|
-
// setData(response.data.fileuri);
|
|
349
|
-
// props.callBack(response.data.fileuri)
|
|
350
|
-
// setIsMsgShow(true, setMsg('Success...'));
|
|
351
|
-
// setTimeout(() => {
|
|
352
|
-
// setIsMsgShow(false);
|
|
353
|
-
// }, 2000);
|
|
354
|
-
// } else {
|
|
355
|
-
// setIsMsgShow(true, setMsg('...'));
|
|
356
|
-
// // setIsLoading(false);
|
|
357
|
-
// setTimeout(() => {
|
|
358
|
-
// setIsMsgShow(false);
|
|
359
|
-
// }, 2000);
|
|
360
|
-
// }
|
|
361
|
-
// } else {
|
|
362
|
-
// setIsMsgShow(true, setMsg('..'));
|
|
363
|
-
// // setIsLoading(false);
|
|
364
|
-
// setTimeout(() => {
|
|
365
|
-
// setIsMsgShow(false);
|
|
366
|
-
// }, 2000);
|
|
367
|
-
// }
|
|
368
|
-
// });
|
|
369
|
-
// };
|
|
370
|
-
|
|
371
|
-
// To browse
|
|
372
|
-
// async function browseFromDevice() {
|
|
373
|
-
// try {
|
|
374
|
-
// const res = await DocumentPicker.pick({
|
|
375
|
-
// type: [DocumentPicker.types.images],
|
|
376
|
-
// });
|
|
377
|
-
// setShowImage(res.uri)
|
|
378
|
-
// let dataset = {
|
|
379
|
-
// uri: res[0].uri,
|
|
380
|
-
// filetype: res[0].type,
|
|
381
|
-
// filename: res[0].name,
|
|
382
|
-
// };
|
|
383
|
-
// Media_Upload(dataset);
|
|
384
|
-
// } catch (err) {
|
|
385
|
-
// if (DocumentPicker.isCancel(err)) {
|
|
386
|
-
// // User cancelled the picker, exit any dialogs or menus and move on
|
|
387
|
-
// } else {
|
|
388
|
-
// throw err;
|
|
389
|
-
// }
|
|
390
|
-
// }
|
|
391
|
-
// }
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { View, Text, StyleSheet } from 'react-native';
|
|
3
|
-
import SketchCanvas from '@terrylinla/react-native-sketch-canvas';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default function CSketchCanvas(props) {
|
|
7
|
-
return (
|
|
8
|
-
<View style={styles.container}>
|
|
9
|
-
{/* <View style={{ flex: 1, flexDirection: 'row' }}>
|
|
10
|
-
<SketchCanvas
|
|
11
|
-
localSourceImagePath={"https://camo.githubusercontent.com/52de4f8da02befa1677e05033d6393eab9aaf6d0a3e834e193ba54a244a180e3/68747470733a2f2f692e696d6775722e636f6d2f3471706958386d2e706e67"}
|
|
12
|
-
containerStyle={{ backgroundColor: 'transparent', flex: 1 }}
|
|
13
|
-
canvasStyle={{ backgroundColor: 'transparent', flex: 1 }}
|
|
14
|
-
defaultStrokeIndex={0}
|
|
15
|
-
defaultStrokeWidth={5}
|
|
16
|
-
closeComponent={<View style={styles.functionButton}><Text style={{ color: 'white' }}>Close</Text></View>}
|
|
17
|
-
undoComponent={<View style={styles.functionButton}><Text style={{ color: 'white' }}>Undo</Text></View>}
|
|
18
|
-
clearComponent={<View style={styles.functionButton}><Text style={{ color: 'white' }}>Clear</Text></View>}
|
|
19
|
-
eraseComponent={<View style={styles.functionButton}><Text style={{ color: 'white' }}>Eraser</Text></View>}
|
|
20
|
-
strokeComponent={color => (
|
|
21
|
-
<View style={[{ backgroundColor: color }, styles.strokeColorButton]} />
|
|
22
|
-
)}
|
|
23
|
-
strokeSelectedComponent={(color, index, changed) => {
|
|
24
|
-
return (
|
|
25
|
-
<View style={[{ backgroundColor: color, borderWidth: 2 }, styles.strokeColorButton]} />
|
|
26
|
-
)
|
|
27
|
-
}}
|
|
28
|
-
strokeWidthComponent={(w) => {
|
|
29
|
-
return (<View style={styles.strokeWidthButton}>
|
|
30
|
-
<View style={{
|
|
31
|
-
backgroundColor: 'white', marginHorizontal: 2.5,
|
|
32
|
-
width: Math.sqrt(w / 3) * 10, height: Math.sqrt(w / 3) * 10, borderRadius: Math.sqrt(w / 3) * 10 / 2
|
|
33
|
-
}} />
|
|
34
|
-
</View>
|
|
35
|
-
)
|
|
36
|
-
}}
|
|
37
|
-
saveComponent={<View style={styles.functionButton}><Text style={{ color: 'white' }}>Save</Text></View>}
|
|
38
|
-
savePreference={() => {
|
|
39
|
-
return {
|
|
40
|
-
folder: 'RNSketchCanvas',
|
|
41
|
-
filename: String(Math.ceil(Math.random() * 100000000)),
|
|
42
|
-
transparent: false,
|
|
43
|
-
imageType: 'png'
|
|
44
|
-
}
|
|
45
|
-
}}
|
|
46
|
-
/>
|
|
47
|
-
</View> */}
|
|
48
|
-
|
|
49
|
-
<View style={{ flex: 1, flexDirection: 'row' }}>
|
|
50
|
-
<SketchCanvas
|
|
51
|
-
localSourceImagePath={'file:///...'}
|
|
52
|
-
style={{ flex: 1 }}
|
|
53
|
-
strokeColor={'red'}
|
|
54
|
-
strokeWidth={7}
|
|
55
|
-
/>
|
|
56
|
-
</View>
|
|
57
|
-
</View>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const styles = StyleSheet.create({
|
|
62
|
-
container: {
|
|
63
|
-
flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF',
|
|
64
|
-
},
|
|
65
|
-
strokeColorButton: {
|
|
66
|
-
marginHorizontal: 2.5, marginVertical: 8, width: 30, height: 30, borderRadius: 15,
|
|
67
|
-
},
|
|
68
|
-
strokeWidthButton: {
|
|
69
|
-
marginHorizontal: 2.5, marginVertical: 8, width: 30, height: 30, borderRadius: 15,
|
|
70
|
-
justifyContent: 'center', alignItems: 'center', backgroundColor: '#39579A',
|
|
71
|
-
},
|
|
72
|
-
functionButton: {
|
|
73
|
-
marginHorizontal: 2.5, marginVertical: 8, height: 30, width: 60,
|
|
74
|
-
backgroundColor: '#39579A', justifyContent: 'center', alignItems: 'center', borderRadius: 5,
|
|
75
|
-
},
|
|
76
|
-
});
|
package/src/Media/CVideoPlay.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { View, StatusBar } from 'react-native';
|
|
3
|
-
import VideoPlayer from 'react-native-video-controls';
|
|
4
|
-
import { useNavigation } from '../Navigation/useNavigation';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { Global } from '../../../../../src/Common/Global';
|
|
8
|
-
|
|
9
|
-
export default function CVideoPlay(props) {
|
|
10
|
-
// console.log("videoplayer", JSON.stringify(props))
|
|
11
|
-
const navigation = useNavigation();
|
|
12
|
-
|
|
13
|
-
const [video, setVideo] = useState(props.route.params.video);
|
|
14
|
-
console.log('video',video);
|
|
15
|
-
return (
|
|
16
|
-
<View style={{ flex: 1 }}>
|
|
17
|
-
<StatusBar
|
|
18
|
-
translucent
|
|
19
|
-
backgroundColor={'transparent'}
|
|
20
|
-
barStyle="dark-content"
|
|
21
|
-
/>
|
|
22
|
-
<VideoPlayer
|
|
23
|
-
source={{
|
|
24
|
-
uri: video,
|
|
25
|
-
headers: { Authorization: `Bearer ${Global.JWTToken}` },
|
|
26
|
-
}}
|
|
27
|
-
onBack={() => navigation.goBack()}
|
|
28
|
-
/>
|
|
29
|
-
</View>
|
|
30
|
-
);
|
|
31
|
-
}
|