@jescon-technologies/react-native-ui-kit 0.0.3 → 0.0.5
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/index.d.ts +66 -0
- package/index.js +0 -4
- package/package.json +3 -34
- package/src/Alerts/AAlert.js +3 -3
- package/src/Alerts/AAlertIOS.js +3 -3
- package/src/{common → Common}/NetworkServiceCall.js +1 -1
- package/src/CommonStyle/CommonTheme.js +11 -0
- package/src/CommonStyle/ComponentFunctions.js +632 -0
- package/src/CommonStyle/PopupStyle.js +146 -0
- package/src/CommonStyle/commonStyle.js +93 -0
- package/src/CommonStyle/componentStyle.js +545 -0
- package/src/CommonStyle/optionListStyles.js +175 -0
- package/src/Components/ByProductPage.js +200 -0
- package/src/Components/CDropDownListNew.js +153 -0
- package/src/Components/CSupplierList.js +88 -0
- package/src/Components/CVerificationCard.js +2822 -0
- package/src/Components/CustomButton.js +67 -0
- package/src/Components/CustomCard.js +127 -0
- package/src/Components/CustomTextInput.js +47 -0
- package/src/Components/EquipmentPage.js +313 -0
- package/src/Components/FilterInput.Copy.js +723 -0
- package/src/Components/FilterInput.js +569 -0
- package/src/Components/HSubHeading.js +68 -0
- package/src/Components/HeaderCard.js +40 -0
- package/src/Components/MoreOptionsScreen.js +251 -0
- package/src/Components/NonSwipableProductCard.js +226 -0
- package/src/Components/NonSwipableSupplierCard.js +348 -0
- package/src/Components/ProductCard.js +1336 -0
- package/src/Components/QualityProductCard.js +1059 -0
- package/src/Components/RateProductCard.js +1452 -0
- package/src/Components/RawMaterial.js +261 -0
- package/src/Components/SDropDownEdited.js +549 -0
- package/src/Components/SDropDownNew.js +529 -0
- package/src/Components/SHelpDescription.js +147 -0
- package/src/Components/STextInputNew.js +510 -0
- package/src/Components/SearchProductCard.js +470 -0
- package/src/Components/StageByProduct.js +199 -0
- package/src/Components/SupplierCard.js +243 -0
- package/src/Components/SupplierInvoiceCard.js +405 -0
- package/src/Components/SwipableSupplierCard.js +136 -0
- package/src/Components/TagTemplate.js +74 -0
- package/src/Components/WrappedComponent.js +25 -0
- package/src/Custom/CBooking.js +944 -0
- package/src/Custom/CBookingPostpone.js +1822 -0
- package/src/Custom/CCalendar.js +560 -0
- package/src/Custom/CCard.js +880 -0
- package/src/Custom/CDetailCard.js +205 -0
- package/src/Custom/CHelpImage.js +52 -0
- package/src/Custom/CReport.js +569 -0
- package/src/Custom/CScrollView.js +73 -0
- package/src/Custom/CSignature.js +112 -0
- package/src/Custom/CSliderMenu.js +339 -0
- package/src/Custom/CSupplierCard.js +99 -0
- package/src/Custom/CTemplateCard.js +438 -0
- package/src/Custom/CTokenAllocation.js +1402 -0
- package/src/Custom/CTokenListOverlay.js +122 -0
- package/src/Custom/CWardStatus.js +444 -0
- package/src/Custom/Charts/CBarChart.js +218 -0
- package/src/Custom/Charts/CDashBoardList.js +133 -0
- package/src/Custom/Charts/CDashBoardTable.js +172 -0
- package/src/Custom/Charts/CLineChart.js +193 -0
- package/src/Custom/Charts/CPieChart.js +186 -0
- package/src/Custom/Loader.js +182 -0
- package/src/Custom/OUserView.js +1121 -0
- package/src/Custom/PreviewDosage.js +115 -0
- package/src/Custom/SearchLoader.js +32 -0
- package/src/Custom/TableComponent/CActivityTable.js +707 -0
- package/src/Custom/TableComponent/CMoreButtonTable.js +197 -0
- package/src/Custom/TableComponent/CTable.js +185 -0
- package/src/Custom/TableComponent/CTextBody.js +40 -0
- package/src/Custom/TableComponent/CTextHeader.js +17 -0
- package/src/Custom/TableComponent/PreviewPrescriptionNew.js +1011 -0
- package/src/Custom/TableComponent/SDropdownTable.js +491 -0
- package/src/Custom/TableComponent/TagTable.js +1200 -0
- package/src/CustomComponents/CAddColumn.js +140 -0
- package/src/CustomComponents/CAssessmentDelete.js +307 -0
- package/src/CustomComponents/CAwesomeButton.js +83 -0
- package/src/CustomComponents/CAwesomeMoreButton.js +54 -0
- package/src/CustomComponents/CBackHandler.js +273 -0
- package/src/CustomComponents/CCalendar.js +243 -0
- package/src/CustomComponents/CCommentOverlay.js +202 -0
- package/src/CustomComponents/CComments.js +162 -0
- package/src/CustomComponents/CContainerView.js +24 -0
- package/src/CustomComponents/CCustomTextInput.js +336 -0
- package/src/CustomComponents/CDetailView.js +40 -0
- package/src/CustomComponents/CDropDownList.js +153 -0
- package/src/CustomComponents/CDropdownSelect.js +555 -0
- package/src/CustomComponents/CFooterView.js +42 -0
- package/src/CustomComponents/CImagePickerSave.js +316 -0
- package/src/CustomComponents/CModalOverlay.js +91 -0
- package/src/CustomComponents/CNetworkStatus.js +327 -0
- package/src/CustomComponents/CNotesInstructions.js +1000 -0
- package/src/CustomComponents/COverlay.js +81 -0
- package/src/CustomComponents/CRemarks.js +176 -0
- package/src/CustomComponents/CRowAdd.js +143 -0
- package/src/CustomComponents/CSummaryDropDown.js +327 -0
- package/src/CustomComponents/CText.js +9 -0
- package/src/CustomComponents/CVectorIcon.js +34 -0
- package/src/CustomComponents/HtmlContentViewer.js +65 -0
- package/src/CustomComponents/PdfContentViewer.js +90 -0
- package/src/CustomComponents/SDropDownDosage.js +1087 -0
- package/src/CustomComponents/SwipableProductCard.js +246 -0
- package/src/CustomComponents/SwipableProductImageCard.js +254 -0
- package/src/CustomComponents/WorkOrderDetails.js +1216 -0
- package/src/CustomComponents/WorkOrderDetailsPage.js +1213 -0
- package/src/HOC/ConfirmOverlay.js +2 -2
- package/src/HOC/HMoreButton.js +1 -1
- package/src/HOC/HNatureHeading.js +1 -1
- package/src/HOC/HShadowButton.js +1 -1
- package/src/HOC/HShadowCountButton.js +1 -1
- package/src/Json/Chart.json +818 -0
- package/src/Json/Consultation.json +622 -0
- package/src/Json/CreditBill.json +490 -0
- package/src/Json/Dropdown.json +216 -0
- package/src/Json/DropdownConsultation.json +228 -0
- package/src/Json/DynamicReports.json +623 -0
- package/src/Json/Footer.json +79 -0
- package/src/Media/AudioScreen.js +2 -7
- package/src/Media/CCaptureImageWithoutEdit.js +1 -1
- package/src/Media/CImageGallery.js +2 -2
- package/src/Media/CSingleImage.js +2 -2
- package/src/Media/CVideoPlay.js +1 -1
- package/src/Media/DocumentScreen.js +2 -7
- package/src/Media/DrawingScreen.js +2 -6
- package/src/Media/ImageScreen.js +2 -6
- package/src/Media/VideoScreen.js +2 -7
- package/src/Navigation/PageNavigation.js +224 -0
- package/src/Navigation/useFocusEffect.js +2 -0
- package/src/Navigation/useFocusEffect.native.js +1 -0
- package/src/Navigation/useFocusEffect.web.js +1 -0
- package/src/Navigation/useIsFocused.js +1 -0
- package/src/Navigation/useIsFocused.native.js +1 -0
- package/src/Navigation/useIsFocused.web.js +1 -0
- package/src/Navigation/useNavigation.js +2 -0
- package/src/Navigation/useNavigation.native.js +1 -0
- package/src/Navigation/useNavigation.web.js +1 -0
- package/src/Screens/CMedications.js +528 -0
- package/src/Screens/CWebViewGallery.js +203 -0
- package/src/Screens/ChartScan.js +279 -0
- package/src/Screens/ChartScreenNew.js +1579 -0
- package/src/Screens/Consultation.js +1500 -0
- package/src/Screens/Dashboard.js +778 -0
- package/src/Screens/FileExplorer.js +288 -0
- package/src/Screens/Footer.js +340 -0
- package/src/Screens/ForgotPassword.js +288 -0
- package/src/Screens/HeaderBlock.js +353 -0
- package/src/Screens/Login.js +328 -0
- package/src/Screens/Notification.js +149 -0
- package/src/Screens/OcrScreen.js +20 -0
- package/src/Screens/PdfPreview.js +507 -0
- package/src/Screens/RegistrationDetails.js +467 -0
- package/src/Screens/SearchScreen.js +582 -0
- package/src/Screens/Splash.js +788 -0
- package/src/Screens/SwipeLeftView.js +1867 -0
- package/src/StaticComponents/SDatePickerLabel.js +1 -1
- package/src/StaticComponents/SDatePickerNew.js +1 -1
- package/src/StaticComponents/SDateTimePickerNew.js +2 -2
- package/src/StaticComponents/SDropDownGenerate.js +3 -3
- package/src/StaticComponents/SDropDownHoc.js +4 -4
- package/src/StaticComponents/SDropDownIcon.js +1 -1
- package/src/StaticComponents/SMenuBox.js +2 -2
- package/src/StaticComponents/SSearch.js +2 -2
- package/src/StaticComponents/STextInput.js +1 -1
- package/src/StaticComponents/STimePicker.js +1 -1
- package/src/StaticComponents/STimingDropDownNew.js +2 -6
- package/src/StaticComponents/STimingSwitch.js +1 -1
- package/src/layout/CContainerView.js +1 -1
- package/src/layout/CDetailView.js +3 -3
- package/src/layout/HeaderBlock.js +5 -5
- package/src/layout/INVLoginLayout.js +3 -4
- package/src/layout/Loader.js +2 -2
- package/src/HOC/HAbsolute.js +0 -56
- package/src/HOC/HDiscontinue.js +0 -105
- package/src/HOC/HOverlay.js +0 -99
- package/src/layout/FooterBlock.js +0 -821
- /package/src/{common → Common}/ErrorBoundary.tsx +0 -0
- /package/src/{common → Common}/Icons.js +0 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import React, { useEffect, useState, useRef, memo, useCallback, useMemo } from 'react';
|
|
2
|
+
import { Text, View, Image, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback, StyleSheet, ImageBackground, FlatList, ActivityIndicator, Platform, TextInput, Alert, ScrollView } from 'react-native';
|
|
3
|
+
import { SwipeListView, SwipeRow } from 'react-native-swipe-list-view';
|
|
4
|
+
import ComponentStyles, { normalize } from '../CommonStyle/componentStyle';
|
|
5
|
+
import { CButtonShadow , ArrayCheck, getLoading, getProfilecardOnlineStatusBadgeContainer, isBNU, isBNUL, isNU, isNUQ, isNUQZ, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
|
|
6
|
+
import { APIURL, EMRAPI } from '../../../../../src/Common/apiConstants';
|
|
7
|
+
import { Global } from '../../../../../src/Common/Global';
|
|
8
|
+
import CVectorIcon from '../CustomComponents/CVectorIcon';
|
|
9
|
+
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
10
|
+
import HOverlay from '../HOC/HOverlay';
|
|
11
|
+
import Loader from './Loader';
|
|
12
|
+
import { Loader as LoaderLocal } from '../CommonStyle/ComponentFunctions';
|
|
13
|
+
import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
|
|
14
|
+
import moment from 'moment';
|
|
15
|
+
import ABlink from '../Alerts/ABlink';
|
|
16
|
+
import HOCIcons from '../HOC/HOCIcons';
|
|
17
|
+
import FastImage from 'react-native-fast-image';
|
|
18
|
+
import { Menu, MenuOptions, MenuTrigger } from 'react-native-popup-menu';
|
|
19
|
+
import { useNavigation } from '../Navigation/useNavigation';
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
export default function CDetailCard(props) {
|
|
25
|
+
|
|
26
|
+
const val = props.val;
|
|
27
|
+
const blockData = props.blockData;
|
|
28
|
+
const admissiontype = props.admissiontype;
|
|
29
|
+
const [iconsArr, setIconsArr] = useState([
|
|
30
|
+
{ 'iconname': 'pills', 'stage': 1, 'color': '#F5EEE6', 'selected': false, 'displaytext': 'Prescription' },
|
|
31
|
+
{ 'iconname': 'heartbeat', 'stage': 5, 'color': '#FFF8E3', 'selected': false, 'displaytext': 'Vitals' },
|
|
32
|
+
{ 'iconname': 'user-injured', 'stage': 4, 'color': '#F3D7CA', 'selected': false, 'displaytext': 'Services' },
|
|
33
|
+
{ 'iconname': 'file-medical', 'stage': 0, 'color': '#E6A4B4', 'selected': false, 'displaytext': 'Chart' }]
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
function BackGroundView() {
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<View style={{
|
|
40
|
+
borderRadius: 10,
|
|
41
|
+
backgroundColor: 'white',
|
|
42
|
+
height: normalize(35),
|
|
43
|
+
flexDirection: 'row',
|
|
44
|
+
borderWidth: 1,
|
|
45
|
+
borderColor: 'lightgrey',
|
|
46
|
+
elevation: 5,
|
|
47
|
+
}}>
|
|
48
|
+
{isNU(val.item.consultationdate) ?
|
|
49
|
+
<>
|
|
50
|
+
<View style={{ borderWidth: 0, borderRadius: 10, width: '50%' }}>
|
|
51
|
+
<View>
|
|
52
|
+
{ValueCheck(blockData.item.leftcontent) ?
|
|
53
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
|
|
54
|
+
{isBNUL(iconsArr) ? iconsArr.map((iconsFoot, i) => {
|
|
55
|
+
|
|
56
|
+
// console.log('iconsArr', val.item.consultationdate)
|
|
57
|
+
return (
|
|
58
|
+
<TouchableOpacity key={i}
|
|
59
|
+
onPress={() =>
|
|
60
|
+
props.NavigateToPatientChart(blockData, iconsFoot.stage, true, moment(val.item.consultationdate).format('YYYY-MM-DD'), moment(val.item.consultationdate).format('YYYY-MM-DD'))
|
|
61
|
+
// moment().format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')
|
|
62
|
+
}
|
|
63
|
+
style={{ backgroundColor: iconsFoot.color, alignItems: 'center', justifyContent: 'center', width: normalize(40), height: normalize(35), borderTopLeftRadius: (i == 0) ? 10 : 0, borderBottomLeftRadius: (i == 0) ? 10 : 0 }} >
|
|
64
|
+
<View style={{ alignItems: 'center', justifyContent: 'center' }}>
|
|
65
|
+
<Icons.FontAwesome5 name={iconsFoot.iconname} size={normalize(15)} color={Global.AppTheme.primary_color} style={{}} />
|
|
66
|
+
<Text style={{ fontSize: normalize(7), fontWeight: 'bold' }}>{iconsFoot.displaytext}</Text>
|
|
67
|
+
</View>
|
|
68
|
+
</TouchableOpacity>
|
|
69
|
+
);
|
|
70
|
+
}) : null}
|
|
71
|
+
</View>
|
|
72
|
+
: null}
|
|
73
|
+
</View>
|
|
74
|
+
</View>
|
|
75
|
+
<View style={{ borderWidth: 0, width: '50%', alignItems: 'center', justifyContent: 'flex-end', flexDirection: 'row' }}>
|
|
76
|
+
<TouchableOpacity
|
|
77
|
+
disabled={false}
|
|
78
|
+
onPress={() => { props.getXRay(blockData); }}
|
|
79
|
+
style={{ height: normalize(35), width: normalize(45), backgroundColor: '#FFC374', alignItems: 'center', justifyContent: 'center', padding: normalize(7), borderWidth: 0 }}
|
|
80
|
+
>
|
|
81
|
+
<View style={{ alignItems: 'center', justifyContent: 'center' }}>
|
|
82
|
+
<Icons.FontAwesome5 name={'x-ray'} size={normalize(15)} color={Global.AppTheme.primary_color} style={{}} />
|
|
83
|
+
<Text style={{ fontSize: normalize(7), fontWeight: 'bold' }}>{'X-Ray'}</Text>
|
|
84
|
+
</View>
|
|
85
|
+
</TouchableOpacity>
|
|
86
|
+
|
|
87
|
+
<TouchableOpacity
|
|
88
|
+
disabled={blockData.item.hopapatient > 0 ? false : true}
|
|
89
|
+
onPress={() => props.getLabResults(blockData, false)}
|
|
90
|
+
style={{ height: normalize(45), width: normalize(40), backgroundColor: '#E1F0DA', alignItems: 'center', justifyContent: 'center', borderTopRightRadius: 10, borderBottomRightRadius: 10 }}
|
|
91
|
+
>
|
|
92
|
+
<View style={{ alignItems: 'center', justifyContent: 'center' }}>
|
|
93
|
+
<Icons.MaterialCommunityIcons name={'test-tube'} size={normalize(20)} color={Global.AppTheme.primary_color} style={{}} />
|
|
94
|
+
<Text adjustsFontSizeToFit style={{ fontSize: normalize(8), fontWeight: 'bold' }}>{'Lab Results'}</Text>
|
|
95
|
+
</View>
|
|
96
|
+
</TouchableOpacity>
|
|
97
|
+
|
|
98
|
+
</View>
|
|
99
|
+
</>
|
|
100
|
+
: null}
|
|
101
|
+
</View>
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function ForeGroundView() {
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<TouchableWithoutFeedback>
|
|
110
|
+
<View style={{
|
|
111
|
+
...CButtonShadow(),
|
|
112
|
+
borderRadius: 10,
|
|
113
|
+
backgroundColor: admissiontype == 'IP' ? '#fff6f6' : '#f0f8ff',
|
|
114
|
+
height: normalize(35),
|
|
115
|
+
flexDirection: 'row',
|
|
116
|
+
}}>
|
|
117
|
+
<View style={{
|
|
118
|
+
borderTopLeftRadius: 10,
|
|
119
|
+
borderBottomLeftRadius: 10,
|
|
120
|
+
width: '5%',
|
|
121
|
+
backgroundColor: admissiontype == 'IP' ? 'darkred' : Global.AppTheme.primary_color,
|
|
122
|
+
justifyContent: 'space-evenly',
|
|
123
|
+
alignItems: 'center',
|
|
124
|
+
}}>
|
|
125
|
+
<View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center', width: '100%' }}>
|
|
126
|
+
{isNU(val.item.consultationdate) ?
|
|
127
|
+
<HOCIcons.FontAwesome5
|
|
128
|
+
name={'calendar-alt'}
|
|
129
|
+
size={normalize(10)}
|
|
130
|
+
color={'white'}
|
|
131
|
+
/>
|
|
132
|
+
: null}
|
|
133
|
+
</View>
|
|
134
|
+
<View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center', width: '100%' }}>
|
|
135
|
+
{isNU(val.item.consultantdoctor) ?
|
|
136
|
+
<HOCIcons.FontAwesome5
|
|
137
|
+
name={'user-md'}
|
|
138
|
+
size={normalize(10)}
|
|
139
|
+
color={'white'}
|
|
140
|
+
/>
|
|
141
|
+
: null}
|
|
142
|
+
</View>
|
|
143
|
+
</View>
|
|
144
|
+
<View style={{
|
|
145
|
+
width: '95%',
|
|
146
|
+
justifyContent: 'space-evenly',
|
|
147
|
+
}}>
|
|
148
|
+
<View style={{ flexDirection: 'row', width: '100%' }}>
|
|
149
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', width: '50%' }}>
|
|
150
|
+
{/* {isNU(val.item.consultationdate) ?
|
|
151
|
+
<HOCIcons.FontAwesome5
|
|
152
|
+
name={'calendar-alt'}
|
|
153
|
+
size={normalize(10)}
|
|
154
|
+
color={'black'}
|
|
155
|
+
style={{ marginHorizontal: normalize(7) }}
|
|
156
|
+
/>
|
|
157
|
+
: null} */}
|
|
158
|
+
<Text style={{ color: 'black', fontWeight: 'bold', fontSize: normalize(12) }}>{' '}{isNU(val.item.consultationdate) ? moment(val.item.consultationdate).format('DD-MM-YYYY') : null}</Text>
|
|
159
|
+
</View>
|
|
160
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', width: '50%', borderWidth: 0 }}>
|
|
161
|
+
{isNU(val.item.department) ?
|
|
162
|
+
<HOCIcons.FontAwesome5
|
|
163
|
+
name={'hospital'}
|
|
164
|
+
size={normalize(10)}
|
|
165
|
+
color={'darkblue'}
|
|
166
|
+
style={{ marginHorizontal: normalize(7) }}
|
|
167
|
+
/>
|
|
168
|
+
: null}
|
|
169
|
+
<Text adjustsFontSizeToFit style={{ color: '#494949', fontWeight: 'bold', fontSize: normalize(10) }}>{isNU(val.item.department) ? val.item.department : null}</Text>
|
|
170
|
+
</View>
|
|
171
|
+
</View>
|
|
172
|
+
<View style={{ flexDirection: 'row', width: '100%', marginTop: normalize(2) }}>
|
|
173
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', width: '50%', borderWidth: 0 }}>
|
|
174
|
+
{/* {isNU(val.item.consultantdoctor) ?
|
|
175
|
+
<HOCIcons.FontAwesome5
|
|
176
|
+
name={'user-md'}
|
|
177
|
+
size={normalize(10)}
|
|
178
|
+
color={'darkblue'}
|
|
179
|
+
style={{ marginHorizontal: normalize(7) }}
|
|
180
|
+
/>
|
|
181
|
+
: null} */}
|
|
182
|
+
<Text style={{ color: 'darkblue', fontWeight: 'bold', fontSize: normalize(10) }}>{' '}{isNU(val.item.consultantdoctor) ? val.item.consultantdoctor : null}</Text>
|
|
183
|
+
</View>
|
|
184
|
+
|
|
185
|
+
</View>
|
|
186
|
+
</View>
|
|
187
|
+
</View>
|
|
188
|
+
</TouchableWithoutFeedback>
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return (
|
|
194
|
+
<SwipeRow
|
|
195
|
+
swipeToOpenPercent={1}
|
|
196
|
+
swipeToClosePercent={1}
|
|
197
|
+
leftOpenValue={normalize(190)}
|
|
198
|
+
rightOpenValue={normalize(-190)}
|
|
199
|
+
style={{ borderRadius: 10, margin: normalize(5) }}
|
|
200
|
+
>
|
|
201
|
+
{BackGroundView()}
|
|
202
|
+
{ForeGroundView()}
|
|
203
|
+
</SwipeRow>
|
|
204
|
+
);
|
|
205
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { FlatList, Image, StyleSheet, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export default function CHelpImage() {
|
|
5
|
+
const [viewHeight, setHeight] = useState(null);
|
|
6
|
+
return (
|
|
7
|
+
<View
|
|
8
|
+
style={styles.container}
|
|
9
|
+
onLayout={(e) => setHeight(e.nativeEvent.layout.height)}
|
|
10
|
+
>
|
|
11
|
+
{viewHeight && (
|
|
12
|
+
<FlatList
|
|
13
|
+
data={data}
|
|
14
|
+
pagingEnabled
|
|
15
|
+
keyExtractor={(item) => item}
|
|
16
|
+
decelerationRate="fast"
|
|
17
|
+
renderItem={({ item }) => (
|
|
18
|
+
<View style={[styles.item, { height: viewHeight }]}>
|
|
19
|
+
<Image style={styles.img} source={{ uri: item }} />
|
|
20
|
+
</View>
|
|
21
|
+
)}
|
|
22
|
+
/>
|
|
23
|
+
)}
|
|
24
|
+
</View>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const styles = StyleSheet.create({
|
|
29
|
+
container: {
|
|
30
|
+
flex: 1,
|
|
31
|
+
},
|
|
32
|
+
item: {
|
|
33
|
+
backgroundColor: 'transparent',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
alignItems:'center',
|
|
36
|
+
},
|
|
37
|
+
img: {
|
|
38
|
+
height: '100%',
|
|
39
|
+
width: '80%',
|
|
40
|
+
// resizeMode:''
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const data = [
|
|
45
|
+
'https://i.ibb.co/7VCPP9D/Screenshot-20210926-161457.jpg',
|
|
46
|
+
'https://i.ibb.co/hFCBX19/Screenshot-20210926-224423.jpg',
|
|
47
|
+
'https://i.ibb.co/0njktBc/Screenshot-20210926-224719.jpg',
|
|
48
|
+
'https://i.ibb.co/ZYqDVjt/Screenshot-20210926-224651.jpg',
|
|
49
|
+
'https://i.ibb.co/smF0n6c/Screenshot-20210926-225608.jpg',
|
|
50
|
+
'https://i.ibb.co/sw6FMLR/Screenshot-20210926-224702.jpg',
|
|
51
|
+
'https://i.ibb.co/g4sQrM6/Screenshot-20210926-224748.jpg',
|
|
52
|
+
];
|