@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,289 +0,0 @@
|
|
|
1
|
-
import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
TouchableOpacity,
|
|
4
|
-
View,
|
|
5
|
-
Text,
|
|
6
|
-
Image,
|
|
7
|
-
FlatList,
|
|
8
|
-
Dimensions,
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
import Carousel, { Pagination } from 'react-native-snap-carousel';
|
|
11
|
-
import ImageZoom from 'react-native-image-pan-zoom';
|
|
12
|
-
import Overlay from 'react-native-modal-overlay';
|
|
13
|
-
import CDetailView from '../CustomComponents/CDetailView';
|
|
14
|
-
import CContainerView from '../CustomComponents/CContainerView';
|
|
15
|
-
import HeaderBlock from '../Screens/HeaderBlock';
|
|
16
|
-
import { normalize } from '../CommonStyle/componentStyle';
|
|
17
|
-
import { imageURL } from '../../../../../src/Common/apiConstants';
|
|
18
|
-
import FastImage from 'react-native-fast-image';
|
|
19
|
-
import { Global } from '../../../../../src/Common/Global';
|
|
20
|
-
import { ArrayCheck, ValueCheck } from '../CommonStyle/ComponentFunctions';
|
|
21
|
-
const { width } = Dimensions.get('window');
|
|
22
|
-
const { height } = Dimensions.get('window');
|
|
23
|
-
const SPACING = normalize(10);
|
|
24
|
-
const THUMB_SIZE = normalize(80);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const CImageGallery = (props) => {
|
|
28
|
-
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
setTimeout(() => {
|
|
31
|
-
onSelectUseEffect(props.route.params.index);
|
|
32
|
-
onTouchThumbnailUseEffect(props.route.params.index);
|
|
33
|
-
//onSelect(props.route.params.index)
|
|
34
|
-
}, 1000);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, []);
|
|
38
|
-
|
|
39
|
-
// console.log("props of cimagegallery",JSON.stringify(props))
|
|
40
|
-
//console.log("indexxxxxxxxxxxxx",props.route.params.index)
|
|
41
|
-
const mappedimages = ValueCheck(props.route.params) && ArrayCheck(props.route.params.savedimages) ? props.route.params.savedimages.map(item => {
|
|
42
|
-
return {
|
|
43
|
-
uri: item.filename,
|
|
44
|
-
};
|
|
45
|
-
}) : [];
|
|
46
|
-
// console.log("mappedimages",JSON.stringify(mappedimages));
|
|
47
|
-
const IMAGES = {
|
|
48
|
-
image1: 'https://i.ibb.co/7nPcjFN/amalalogo.jpg',
|
|
49
|
-
image2: 'https://i.ibb.co/7nPcjFN/amalalogo.jpg',
|
|
50
|
-
image3: 'https://i.ibb.co/7nPcjFN/amalalogo.jpg',
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const carouselRef = useRef();
|
|
55
|
-
//console.log("carouselref",carouselRef)
|
|
56
|
-
const flatListRef = useRef();
|
|
57
|
-
//console.log("flatlistref",flatListRef)
|
|
58
|
-
const [images, setImages] = useState(props.route.params.savedimages);
|
|
59
|
-
//console.log("imagessssss",JSON.stringify(images))
|
|
60
|
-
const [indexSelected, setIndexSelected] = useState(props.route.params.index);
|
|
61
|
-
const [isloading, setIsLoading] = useState(true);
|
|
62
|
-
//const firstitem = props.route.params.index - 1;
|
|
63
|
-
//console.log("firstitem",firstitem)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const onSelectUseEffect = (indexSelected) => {
|
|
67
|
-
console.log('onselectuseeffect', indexSelected);
|
|
68
|
-
setIndexSelected(indexSelected);
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* if you want to position the thumbnail in * the middle of the screen on selection
|
|
72
|
-
* do the following
|
|
73
|
-
* Calculation done by awesome Catalin Miron
|
|
74
|
-
* Source: https://www.youtube.com/watch?v=gjC2oUJhePE&t=1097s
|
|
75
|
-
*/
|
|
76
|
-
// if (indexSelected * (THUMB_SIZE + 10) - THUMB_SIZE / 2 > width / 2) {
|
|
77
|
-
// flatListRef?.current?.scrollToOffset({
|
|
78
|
-
// offset: indexSelected * (THUMB_SIZE + 10) - width / 2 + THUMB_SIZE / 2,
|
|
79
|
-
// animated: true,
|
|
80
|
-
// });
|
|
81
|
-
// } else {
|
|
82
|
-
// flatListRef?.current?.scrollToOffset({
|
|
83
|
-
// offset: 0,
|
|
84
|
-
// animated: true,
|
|
85
|
-
// });
|
|
86
|
-
// }
|
|
87
|
-
|
|
88
|
-
// my initial solution
|
|
89
|
-
flatListRef?.current?.scrollToOffset({
|
|
90
|
-
// offset: indexSelected * (normalize(50) + 10) - normalize(50) / 2 + normalize(50) / 2,
|
|
91
|
-
//offset: indexSelected * (normalize(60)+ normalize(10)),
|
|
92
|
-
|
|
93
|
-
offset: indexSelected * (normalize(50) + normalize(10)),
|
|
94
|
-
//offset:indexSelected * (normalize(50)),
|
|
95
|
-
animated: true,
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const onSelect = (indexSelected) => {
|
|
100
|
-
console.log('onselect', indexSelected);
|
|
101
|
-
setIndexSelected(indexSelected);
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* if you want to position the thumbnail in * the middle of the screen on selection
|
|
105
|
-
* do the following
|
|
106
|
-
* Calculation done by awesome Catalin Miron
|
|
107
|
-
* Source: https://www.youtube.com/watch?v=gjC2oUJhePE&t=1097s
|
|
108
|
-
*/
|
|
109
|
-
// if (indexSelected * (THUMB_SIZE + 10) - THUMB_SIZE / 2 > width / 2) {
|
|
110
|
-
// flatListRef?.current?.scrollToOffset({
|
|
111
|
-
// offset: indexSelected * (THUMB_SIZE + 10) - width / 2 + THUMB_SIZE / 2,
|
|
112
|
-
// animated: true,
|
|
113
|
-
// });
|
|
114
|
-
// } else {
|
|
115
|
-
// flatListRef?.current?.scrollToOffset({
|
|
116
|
-
// offset: 0,
|
|
117
|
-
// animated: true,
|
|
118
|
-
// });
|
|
119
|
-
// }
|
|
120
|
-
|
|
121
|
-
// my initial solution
|
|
122
|
-
// flatListRef?.current?.scrollToOffset({
|
|
123
|
-
// //offset: indexSelected * (images.length) - width / 2 + images.length / 2,
|
|
124
|
-
// offset: normalize(indexSelected) * normalize(57),
|
|
125
|
-
// //offset:indexSelected * THUMB_SIZE,
|
|
126
|
-
// animated: true,
|
|
127
|
-
// });
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const onTouchThumbnail = (touched) => {
|
|
131
|
-
carouselRef?.current?.snapToItem(touched);
|
|
132
|
-
//setIndexSelected(touched);
|
|
133
|
-
//onSelect(touched)
|
|
134
|
-
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const onTouchThumbnailUseEffect = (touched) => {
|
|
140
|
-
console.log('toucheduseeffect', touched),
|
|
141
|
-
|
|
142
|
-
carouselRef?.current?.snapToItem(touched);
|
|
143
|
-
|
|
144
|
-
// [1,2,3,4].map(number => {
|
|
145
|
-
|
|
146
|
-
// setTimeout(() => {
|
|
147
|
-
// carouselRef?.current?.snapToItem(touched)
|
|
148
|
-
// console.log("n",number)
|
|
149
|
-
// }, 500)
|
|
150
|
-
// })
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
function getOverlayContainerStyle() {
|
|
156
|
-
return (
|
|
157
|
-
{
|
|
158
|
-
// ...ComponentStyles.View_col_center,
|
|
159
|
-
backgroundColor: '#fff',
|
|
160
|
-
height: height, width: width,
|
|
161
|
-
}
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
function logOutZoomState(event, gestureState, zoomableViewEventObject) {
|
|
165
|
-
//console.log('');
|
|
166
|
-
// console.log('');
|
|
167
|
-
//console.log('-------------');
|
|
168
|
-
//console.log('Event: ', event);
|
|
169
|
-
//console.log('GestureState: ', gestureState);
|
|
170
|
-
//console.log('ZoomableEventObject: ', zoomableViewEventObject);
|
|
171
|
-
//console.log('');
|
|
172
|
-
// console.log(
|
|
173
|
-
// `Zoomed from ${zoomableViewEventObject.lastZoomLevel} to ${zoomableViewEventObject.zoomLevel}`,
|
|
174
|
-
//);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return (
|
|
178
|
-
// <Overlay
|
|
179
|
-
// visible={isloading}
|
|
180
|
-
// //onClose={() => props.visibility(false)}
|
|
181
|
-
// //transparent={true}
|
|
182
|
-
// //containerStyle={getOverlayContainerStyle()}
|
|
183
|
-
// //animationDuration={500}
|
|
184
|
-
// //closeOnTouchOutside={true}
|
|
185
|
-
// >
|
|
186
|
-
<CContainerView>
|
|
187
|
-
<HeaderBlock/>
|
|
188
|
-
<CDetailView>
|
|
189
|
-
<View style={{ flex: 1, backgroundColor: 'white', alignItems: 'center' }}>
|
|
190
|
-
<View style={{ flex: 2, marginTop: 1 }}>
|
|
191
|
-
<View>
|
|
192
|
-
<Carousel
|
|
193
|
-
ref={carouselRef}
|
|
194
|
-
layout={'default'}
|
|
195
|
-
data={props.route.params.savedimages}
|
|
196
|
-
sliderWidth={width * 10}
|
|
197
|
-
itemWidth={width}
|
|
198
|
-
//initialScrollIndex={props.route.params.index}
|
|
199
|
-
//firstItem={indexSelected}
|
|
200
|
-
onSnapToItem={(index) => onSelect(index)}
|
|
201
|
-
renderItem={({ item, index }) => (
|
|
202
|
-
<ImageZoom
|
|
203
|
-
cropWidth={width * 1}
|
|
204
|
-
cropHeight={height * 0.8}
|
|
205
|
-
imageWidth={width * 1}
|
|
206
|
-
imageHeight={height * 0.8}
|
|
207
|
-
enableSwipeDown={false}
|
|
208
|
-
panToMove={true}
|
|
209
|
-
>
|
|
210
|
-
<FastImage
|
|
211
|
-
key={index}
|
|
212
|
-
style={{ width: '100%', height: '80%' }}
|
|
213
|
-
resizeMode="contain"
|
|
214
|
-
source={{
|
|
215
|
-
uri: item && item.filename && item.filename != null && item.filename != undefined && item.filename.length > 0 && typeof item.filename === 'string' ? imageURL + item.filename : 'https://icon-library.com/images/no-image-icon/no-image-icon-0.jpg',
|
|
216
|
-
headers: {
|
|
217
|
-
Authorization: `Bearer ${Global.JWTToken}`,
|
|
218
|
-
},
|
|
219
|
-
}}
|
|
220
|
-
/>
|
|
221
|
-
</ImageZoom>
|
|
222
|
-
)}
|
|
223
|
-
/>
|
|
224
|
-
</View>
|
|
225
|
-
|
|
226
|
-
{/* <Pagination
|
|
227
|
-
inactiveDotColor="grey"
|
|
228
|
-
dotColor={'darkblue'}
|
|
229
|
-
activeDotIndex={indexSelected}
|
|
230
|
-
dotsLength={images.length}
|
|
231
|
-
animatedDuration={150}
|
|
232
|
-
inactiveDotScale={0.5}
|
|
233
|
-
/> */}
|
|
234
|
-
</View>
|
|
235
|
-
<View
|
|
236
|
-
style={{
|
|
237
|
-
marginTop: 20,
|
|
238
|
-
paddingHorizontal: 32,
|
|
239
|
-
alignSelf: 'flex-end',
|
|
240
|
-
}}
|
|
241
|
-
>
|
|
242
|
-
<Text style={{ color: 'black', fontSize: normalize(25), fontWeight: 'bold' }}>
|
|
243
|
-
{indexSelected + 1}/{images.length}
|
|
244
|
-
</Text>
|
|
245
|
-
</View>
|
|
246
|
-
{/* Thumbnail component using FlatList */}
|
|
247
|
-
<FlatList
|
|
248
|
-
ref={flatListRef}
|
|
249
|
-
initialNumToRender={50}
|
|
250
|
-
maxToRenderPerBatch={50}
|
|
251
|
-
horizontal={true}
|
|
252
|
-
data={props.route.params.savedimages}
|
|
253
|
-
style={{ position: 'absolute', bottom: normalize(30) }}
|
|
254
|
-
showsHorizontalScrollIndicator={false}
|
|
255
|
-
contentContainerStyle={{
|
|
256
|
-
//paddingHorizontal: SPACING,
|
|
257
|
-
}}
|
|
258
|
-
keyExtractor={(item, index) => 'key' + index}
|
|
259
|
-
renderItem={({ item, index }) => (
|
|
260
|
-
<TouchableOpacity
|
|
261
|
-
onPress={() => onTouchThumbnail(index)}
|
|
262
|
-
activeOpacity={0.3}
|
|
263
|
-
>
|
|
264
|
-
<FastImage
|
|
265
|
-
style={{
|
|
266
|
-
width: normalize(50),
|
|
267
|
-
height: normalize(50),
|
|
268
|
-
marginRight: normalize(10),
|
|
269
|
-
borderRadius: 16,
|
|
270
|
-
borderWidth: index === indexSelected ? 4 : 0.75,
|
|
271
|
-
borderColor: index === indexSelected ? 'darkblue' : 'grey',
|
|
272
|
-
}}
|
|
273
|
-
source={{
|
|
274
|
-
uri: item.filename && item.filename != null && item.filename != undefined && item.filename.length > 0 && typeof item.filename === 'string' ? imageURL + item.filename : 'https://icon-library.com/images/no-image-icon/no-image-icon-0.jpg',
|
|
275
|
-
headers: {
|
|
276
|
-
Authorization: `Bearer ${Global.JWTToken}`,
|
|
277
|
-
},
|
|
278
|
-
}}
|
|
279
|
-
/>
|
|
280
|
-
</TouchableOpacity>
|
|
281
|
-
)}
|
|
282
|
-
/>
|
|
283
|
-
</View>
|
|
284
|
-
</CDetailView>
|
|
285
|
-
</CContainerView>
|
|
286
|
-
);
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
export default CImageGallery;
|
package/src/Media/CImageZoom.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
// import { useDimensions } from '@react-native-community/hooks'
|
|
3
|
-
import { View, Image, TouchableOpacity, StyleSheet, Dimensions} from 'react-native';
|
|
4
|
-
// import ImageZoom from 'react-native-image-pan-zoom';
|
|
5
|
-
import ComponentStyles from '../CommonStyle/componentStyle';
|
|
6
|
-
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
7
|
-
import CModalOverlay from '../CustomComponents/CModalOverlay';
|
|
8
|
-
|
|
9
|
-
export default function CustomImageZoom(props) {
|
|
10
|
-
const [isloading, setIsLoading] = useState(true);
|
|
11
|
-
const { width, height } = Dimensions.get('window');
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<CModalOverlay
|
|
15
|
-
visible={isloading}
|
|
16
|
-
onClose={() => props.visibility(false)}
|
|
17
|
-
transparent={true}
|
|
18
|
-
containerStyle={getOverlayContainerStyle()}
|
|
19
|
-
animationDuration={500}
|
|
20
|
-
closeOnTouchOutside={true}
|
|
21
|
-
>
|
|
22
|
-
<View style={getCloseButtonContainer()}>
|
|
23
|
-
<TouchableOpacity onPress={() => props.visibility(false)}
|
|
24
|
-
style={{ width: '100%', alignItems: 'flex-end' }}>
|
|
25
|
-
<AntDesign name="close" size={30} />
|
|
26
|
-
</TouchableOpacity>
|
|
27
|
-
</View>
|
|
28
|
-
<View style={layoutstyles.zoom_image_container}>
|
|
29
|
-
{/* <ImageZoom
|
|
30
|
-
cropWidth={width * 0.90}
|
|
31
|
-
cropHeight={height * 0.85}
|
|
32
|
-
imageWidth={width}
|
|
33
|
-
imageHeight={height}
|
|
34
|
-
> */}
|
|
35
|
-
<Image
|
|
36
|
-
style={getZoomImageStyle()}
|
|
37
|
-
source={{ uri: props.image }}
|
|
38
|
-
/>
|
|
39
|
-
{/* </ImageZoom> */}
|
|
40
|
-
</View>
|
|
41
|
-
</CModalOverlay>
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
function getZoomImageStyle() {
|
|
46
|
-
return (
|
|
47
|
-
{
|
|
48
|
-
width: width, height: height * 0.90, resizeMode: 'contain',
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
function getOverlayContainerStyle() {
|
|
53
|
-
return (
|
|
54
|
-
{
|
|
55
|
-
...ComponentStyles.View_col_center,
|
|
56
|
-
backgroundColor: '#fff',
|
|
57
|
-
height: height, width: width,
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
function getCloseButtonContainer() {
|
|
62
|
-
return (
|
|
63
|
-
{
|
|
64
|
-
width: width * 0.90,
|
|
65
|
-
...ComponentStyles.View_col_flexend,
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
const layoutstyles = StyleSheet.create({
|
|
71
|
-
close_button_style: {
|
|
72
|
-
height: '10%', width: 30, alignItems: 'flex-end', backgroundColor: 'black',
|
|
73
|
-
},
|
|
74
|
-
zoom_image_container: {
|
|
75
|
-
justifyContent: 'center',
|
|
76
|
-
alignItems: 'center', height: '95%',
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
{/**
|
|
81
|
-
url is passed from parent component
|
|
82
|
-
*/}
|