@jescon-technologies/react-native-ui-kit 0.0.4 → 0.0.6
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 +3 -7
- package/package.json +3 -2
- package/src/Alerts/AAlert.js +4 -4
- 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/RecordAudio.js +1 -1
- 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,246 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
4
|
+
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
5
|
+
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
6
|
+
import { Global } from '../../../../../src/Common/Global';
|
|
7
|
+
import { CButtonShadow, isNUQ } from '../CommonStyle/ComponentFunctions';
|
|
8
|
+
import { SwipeRow } from 'react-native-swipe-list-view';
|
|
9
|
+
|
|
10
|
+
const SwipableProductCard = ({
|
|
11
|
+
data,
|
|
12
|
+
argumentname,
|
|
13
|
+
renderLeftActions,
|
|
14
|
+
renderRightActions,
|
|
15
|
+
navigation,
|
|
16
|
+
type,
|
|
17
|
+
}) => (
|
|
18
|
+
<SwipeRow
|
|
19
|
+
disableLeftSwipe={false}
|
|
20
|
+
disableRightSwipe={false}
|
|
21
|
+
leftOpenValue={190}
|
|
22
|
+
rightOpenValue={-190}
|
|
23
|
+
swipeToClosePercent={10}
|
|
24
|
+
swipeToOpenPercent={10}
|
|
25
|
+
>
|
|
26
|
+
{/* Hidden Row (Swipe Actions) */}
|
|
27
|
+
<View style={{
|
|
28
|
+
borderWidth: 0,
|
|
29
|
+
flexDirection: 'row',
|
|
30
|
+
justifyContent: 'space-between',
|
|
31
|
+
minHeight: normalize(70),
|
|
32
|
+
}}>
|
|
33
|
+
<View style={{ flex: 1, alignItems: 'flex-start' }}>
|
|
34
|
+
{renderLeftActions && renderLeftActions(data)}
|
|
35
|
+
</View>
|
|
36
|
+
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
|
37
|
+
{renderRightActions && renderRightActions(data)}
|
|
38
|
+
</View>
|
|
39
|
+
</View>
|
|
40
|
+
|
|
41
|
+
{/* Main Content */}
|
|
42
|
+
<TouchableOpacity
|
|
43
|
+
onLongPress={() => {
|
|
44
|
+
const pdfUrl =
|
|
45
|
+
argumentname == 3
|
|
46
|
+
? `${APIURL}fljrcommonbill/jrcommonbreport/AMAGDBI01.dbo.rnjrinsuproductdetail(${data.code || data?.insuproduct},${Global.userData.suuser})/0/ProductDetail`
|
|
47
|
+
: `${APIURL}fljrcommonbill/jrcommonbreport/AMAGDBI01.dbo.rnjrinsusupplier(${data.code},${Global.userData.suuser})/0/SupplierDetail`;
|
|
48
|
+
|
|
49
|
+
isNUQ(type) ? navigation.navigate('CProductPhysicalQuantityScreen', {
|
|
50
|
+
productCode: data?.insuproduct || 0,
|
|
51
|
+
}) : navigation.navigate('PDFScreen', { pdfSource: pdfUrl });
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<View
|
|
55
|
+
style={{
|
|
56
|
+
backgroundColor: '#faeeeb',
|
|
57
|
+
marginHorizontal: normalize(10),
|
|
58
|
+
marginBottom: normalize(10),
|
|
59
|
+
borderRadius: normalize(5),
|
|
60
|
+
shadowColor: Global.AppTheme.primary_color,
|
|
61
|
+
shadowOffset: { width: 4, height: 4 },
|
|
62
|
+
shadowOpacity: 0.6,
|
|
63
|
+
shadowRadius: 10,
|
|
64
|
+
elevation: 8,
|
|
65
|
+
...CButtonShadow(),
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<View style={{ flexDirection: 'row', minHeight: normalize(40) }}>
|
|
69
|
+
<View
|
|
70
|
+
style={{
|
|
71
|
+
backgroundColor: isNUQ(data?.color) ? data?.color : '#870808',
|
|
72
|
+
width: normalize(10),
|
|
73
|
+
height: '100%',
|
|
74
|
+
borderStartStartRadius: normalize(5),
|
|
75
|
+
borderStartEndRadius: normalize(5),
|
|
76
|
+
}}
|
|
77
|
+
/>
|
|
78
|
+
<View
|
|
79
|
+
style={{
|
|
80
|
+
padding: normalize(3),
|
|
81
|
+
flexDirection: 'row',
|
|
82
|
+
justifyContent: 'space-between',
|
|
83
|
+
alignItems: 'flex-start',
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
<View style={{ width: '80%', justifyContent: 'center' }}>
|
|
87
|
+
{/* Product/Supplier name and code */}
|
|
88
|
+
{isNUQ(argumentname == 3 ? data.productname : data.suppliername) && data.code ? (
|
|
89
|
+
<Text
|
|
90
|
+
numberOfLines={3}
|
|
91
|
+
style={{
|
|
92
|
+
fontSize: normalize(12.5),
|
|
93
|
+
paddingLeft: normalize(5),
|
|
94
|
+
fontWeight: 'bold',
|
|
95
|
+
color: Global.AppTheme.primary_color,
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
{data.code} - {argumentname == 3 ? data.productname : data.suppliername}
|
|
99
|
+
{argumentname == 3 && data.classificationname ? ` (${data.classificationname})` : ''}
|
|
100
|
+
</Text>
|
|
101
|
+
) : null}
|
|
102
|
+
|
|
103
|
+
{isNUQ(argumentname == 3 ? data.productname : data.suppliername) && type ? (
|
|
104
|
+
<Text
|
|
105
|
+
numberOfLines={3}
|
|
106
|
+
style={{
|
|
107
|
+
fontSize: normalize(12.5),
|
|
108
|
+
paddingLeft: normalize(5),
|
|
109
|
+
fontWeight: 'bold',
|
|
110
|
+
color: Global.AppTheme.primary_color,
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
{data.code} - {argumentname == 3 ? data.productname : data.suppliername}
|
|
114
|
+
{argumentname == 3 && data.classificationname ? ` (${data.classificationname})` : ''}
|
|
115
|
+
</Text>
|
|
116
|
+
) : null}
|
|
117
|
+
|
|
118
|
+
{/* Marketing division */}
|
|
119
|
+
{isNUQ(argumentname == 3 && data.marketingdivisionname) ? (
|
|
120
|
+
<Text
|
|
121
|
+
numberOfLines={3}
|
|
122
|
+
style={{
|
|
123
|
+
fontSize: normalize(10),
|
|
124
|
+
paddingLeft: normalize(5),
|
|
125
|
+
color: Global.AppTheme.primary_color,
|
|
126
|
+
}}
|
|
127
|
+
>
|
|
128
|
+
{argumentname == 3 && data.marketingdivisionname}
|
|
129
|
+
</Text>
|
|
130
|
+
) : null}
|
|
131
|
+
{/* Tax name */}
|
|
132
|
+
{isNUQ(argumentname == 3 && data.taxname) ? (
|
|
133
|
+
<Text
|
|
134
|
+
numberOfLines={3}
|
|
135
|
+
style={{
|
|
136
|
+
fontSize: normalize(10),
|
|
137
|
+
paddingLeft: normalize(5),
|
|
138
|
+
color: Global.AppTheme.primary_color,
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
{argumentname == 3 && data.taxname}
|
|
142
|
+
</Text>
|
|
143
|
+
) : null}
|
|
144
|
+
{/* Designation and gst no */}
|
|
145
|
+
{argumentname == 8 ? (
|
|
146
|
+
<View style={{ flexDirection: 'row' }}>
|
|
147
|
+
{isNUQ(data.designation) ? (
|
|
148
|
+
<View
|
|
149
|
+
style={{
|
|
150
|
+
flexDirection: 'row',
|
|
151
|
+
alignItems: 'center',
|
|
152
|
+
paddingLeft: normalize(5),
|
|
153
|
+
}}
|
|
154
|
+
>
|
|
155
|
+
<Icons.FontAwesome5 name={'user-tie'} size={normalize(11)} color={'#094485'} />
|
|
156
|
+
<Text
|
|
157
|
+
numberOfLines={1}
|
|
158
|
+
style={{
|
|
159
|
+
fontSize: 10,
|
|
160
|
+
color: '#555',
|
|
161
|
+
marginLeft: normalize(5),
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
{data.designation}
|
|
165
|
+
</Text>
|
|
166
|
+
</View>
|
|
167
|
+
) : null}
|
|
168
|
+
{isNUQ(data.gstno) ? (
|
|
169
|
+
<View
|
|
170
|
+
style={{
|
|
171
|
+
flexDirection: 'row',
|
|
172
|
+
alignItems: 'center',
|
|
173
|
+
paddingLeft: normalize(5),
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
<Icons.FontAwesome5 name={'mobile'} size={normalize(11)} color={'#094485'} />
|
|
177
|
+
<Text
|
|
178
|
+
numberOfLines={1}
|
|
179
|
+
style={{
|
|
180
|
+
fontSize: 10,
|
|
181
|
+
color: '#555',
|
|
182
|
+
marginLeft: normalize(5),
|
|
183
|
+
}}
|
|
184
|
+
>
|
|
185
|
+
{data.gstno}
|
|
186
|
+
</Text>
|
|
187
|
+
</View>
|
|
188
|
+
) : null}
|
|
189
|
+
</View>
|
|
190
|
+
) : null}
|
|
191
|
+
{/* Email and phone number */}
|
|
192
|
+
{argumentname == 8 ? (
|
|
193
|
+
<View style={{ flexDirection: 'row' }}>
|
|
194
|
+
{isNUQ(data.email) ? (
|
|
195
|
+
<View
|
|
196
|
+
style={{
|
|
197
|
+
flexDirection: 'row',
|
|
198
|
+
alignItems: 'center',
|
|
199
|
+
paddingLeft: normalize(5),
|
|
200
|
+
}}
|
|
201
|
+
>
|
|
202
|
+
<Icons.FontAwesome5 name={'envelope'} size={normalize(11)} color={'#094485'} />
|
|
203
|
+
<Text
|
|
204
|
+
numberOfLines={1}
|
|
205
|
+
style={{
|
|
206
|
+
fontSize: 10,
|
|
207
|
+
color: '#555',
|
|
208
|
+
marginLeft: normalize(5),
|
|
209
|
+
}}
|
|
210
|
+
>
|
|
211
|
+
{data.email}
|
|
212
|
+
</Text>
|
|
213
|
+
</View>
|
|
214
|
+
) : null}
|
|
215
|
+
{isNUQ(data.phoneno) ? (
|
|
216
|
+
<View
|
|
217
|
+
style={{
|
|
218
|
+
flexDirection: 'row',
|
|
219
|
+
alignItems: 'center',
|
|
220
|
+
paddingLeft: normalize(5),
|
|
221
|
+
}}
|
|
222
|
+
>
|
|
223
|
+
<Icons.FontAwesome5 name={'mobile'} size={normalize(11)} color={'#094485'} />
|
|
224
|
+
<Text
|
|
225
|
+
numberOfLines={1}
|
|
226
|
+
style={{
|
|
227
|
+
fontSize: 10,
|
|
228
|
+
color: '#555',
|
|
229
|
+
marginLeft: normalize(5),
|
|
230
|
+
}}
|
|
231
|
+
>
|
|
232
|
+
{data.phoneno}
|
|
233
|
+
</Text>
|
|
234
|
+
</View>
|
|
235
|
+
) : null}
|
|
236
|
+
</View>
|
|
237
|
+
) : null}
|
|
238
|
+
</View>
|
|
239
|
+
</View>
|
|
240
|
+
</View>
|
|
241
|
+
</View>
|
|
242
|
+
</TouchableOpacity>
|
|
243
|
+
</SwipeRow>
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
export default SwipableProductCard;
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import React, { useContext, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
Dimensions,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
Image as RNImage,
|
|
9
|
+
ActivityIndicator,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
12
|
+
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
13
|
+
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
14
|
+
import { Global } from '../../../../../src/Common/Global';
|
|
15
|
+
import { CButtonShadow, isNUQ, notifyMessage } from '../CommonStyle/ComponentFunctions';
|
|
16
|
+
import { SwipeRow } from 'react-native-swipe-list-view';
|
|
17
|
+
import STextInputNew from '../Components/STextInputNew';
|
|
18
|
+
import ContextBio from '../ContextAPI/ContextBio';
|
|
19
|
+
|
|
20
|
+
const SwipableProductImageCard = ({
|
|
21
|
+
data,
|
|
22
|
+
argumentname,
|
|
23
|
+
renderLeftActions,
|
|
24
|
+
renderRightActions,
|
|
25
|
+
navigation,
|
|
26
|
+
type,
|
|
27
|
+
}) => {
|
|
28
|
+
const [uploading, setUploading] = useState(false);
|
|
29
|
+
const [refreshKey, setRefreshKey] = useState(Date.now()); // used for forcing image refresh
|
|
30
|
+
const { invoiceData, setInvoiceData } = useContext(ContextBio);
|
|
31
|
+
|
|
32
|
+
const handlePress = () => {
|
|
33
|
+
const pdfUrl =
|
|
34
|
+
argumentname == 3
|
|
35
|
+
? `${APIURL}fljrcommonbill/jrcommonbreport/AMAGDBI01.dbo.rnjrinsuproductdetail(${data.code || data?.insuproduct
|
|
36
|
+
},${Global.userData.suuser})/0/ProductDetail`
|
|
37
|
+
: `${APIURL}fljrcommonbill/jrcommonbreport/AMAGDBI01.dbo.rnjrinsusupplier(${data.code},${Global.userData.suuser})/0/SupplierDetail`;
|
|
38
|
+
|
|
39
|
+
isNUQ(type)
|
|
40
|
+
? navigation.navigate('CProductPhysicalQuantityScreen', {
|
|
41
|
+
productCode: data?.insuproduct || 0,
|
|
42
|
+
})
|
|
43
|
+
: navigation.navigate('PDFScreen', { pdfSource: pdfUrl });
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<SwipeRow
|
|
48
|
+
disableLeftSwipe={false}
|
|
49
|
+
disableRightSwipe={false}
|
|
50
|
+
leftOpenValue={190}
|
|
51
|
+
rightOpenValue={-190}
|
|
52
|
+
swipeToClosePercent={10}
|
|
53
|
+
swipeToOpenPercent={10}
|
|
54
|
+
>
|
|
55
|
+
{/* Hidden Row (Swipe Actions) */}
|
|
56
|
+
<View style={{
|
|
57
|
+
borderWidth: 0,
|
|
58
|
+
flexDirection: 'row',
|
|
59
|
+
justifyContent: 'space-between',
|
|
60
|
+
minHeight: normalize(70),
|
|
61
|
+
}}>
|
|
62
|
+
<View style={{ flex: 1, alignItems: 'flex-start' }}>
|
|
63
|
+
{renderLeftActions && renderLeftActions(data)}
|
|
64
|
+
</View>
|
|
65
|
+
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
|
66
|
+
{renderRightActions && renderRightActions(data)}
|
|
67
|
+
</View>
|
|
68
|
+
</View>
|
|
69
|
+
|
|
70
|
+
{/* Main Content */}
|
|
71
|
+
<TouchableOpacity onPress={handlePress} activeOpacity={0.8}>
|
|
72
|
+
<View style={styles.cardContainer}>
|
|
73
|
+
<View style={styles.cardContent}>
|
|
74
|
+
{/* Left color indicator */}
|
|
75
|
+
<View
|
|
76
|
+
style={[
|
|
77
|
+
styles.colorIndicator,
|
|
78
|
+
{ backgroundColor: isNUQ(data?.color) ? data?.color : '#870808' },
|
|
79
|
+
]}
|
|
80
|
+
/>
|
|
81
|
+
|
|
82
|
+
{/* Main content */}
|
|
83
|
+
<View style={styles.textContainer}>
|
|
84
|
+
{isNUQ(
|
|
85
|
+
argumentname == 3 ? data.productname : data.suppliername,
|
|
86
|
+
) &&
|
|
87
|
+
data.code && (
|
|
88
|
+
<Text style={styles.titleText} numberOfLines={3}>
|
|
89
|
+
{data.code} -{' '}
|
|
90
|
+
{argumentname == 3 ? data.productname : data.suppliername}
|
|
91
|
+
{argumentname == 3 && data.classificationname
|
|
92
|
+
? ` (${data.classificationname})`
|
|
93
|
+
: ''}
|
|
94
|
+
</Text>
|
|
95
|
+
)}
|
|
96
|
+
|
|
97
|
+
{/* HSN Code input */}
|
|
98
|
+
<View style={styles.hsnContainer}>
|
|
99
|
+
<STextInputNew
|
|
100
|
+
data={{
|
|
101
|
+
borderWidth: 1,
|
|
102
|
+
value: data.hsncode,
|
|
103
|
+
borderColor: 'lightgrey',
|
|
104
|
+
elevation: 0,
|
|
105
|
+
borderRadius: 5,
|
|
106
|
+
fontWeight: 'normal',
|
|
107
|
+
color: 'black',
|
|
108
|
+
itemwidth: Dimensions.get('screen').width * 0.5,
|
|
109
|
+
paddingTop: 5,
|
|
110
|
+
paddingBottom: 5,
|
|
111
|
+
height: Dimensions.get('screen').height * 0.03,
|
|
112
|
+
textAlign: 'center',
|
|
113
|
+
marginTop: normalize(2),
|
|
114
|
+
marginHorizontal: normalize(2),
|
|
115
|
+
fontSize: normalize(10),
|
|
116
|
+
placeholder: 'hsncode',
|
|
117
|
+
}}
|
|
118
|
+
callBack={val => {
|
|
119
|
+
data.hsncode = val;
|
|
120
|
+
data.flag = 2;
|
|
121
|
+
setInvoiceData(prevData => ({
|
|
122
|
+
...prevData,
|
|
123
|
+
EditStatus: true,
|
|
124
|
+
}));
|
|
125
|
+
}}
|
|
126
|
+
/>
|
|
127
|
+
</View>
|
|
128
|
+
</View>
|
|
129
|
+
|
|
130
|
+
{/* Image upload button */}
|
|
131
|
+
<TouchableOpacity
|
|
132
|
+
style={styles.imageContainer}
|
|
133
|
+
onPress={() => {
|
|
134
|
+
navigation.navigate('FileExplorer', {
|
|
135
|
+
data: [{ savedimages: '' }],
|
|
136
|
+
visibility: 1, // only image
|
|
137
|
+
eventData: null,
|
|
138
|
+
callBack: updated => {
|
|
139
|
+
if (updated.savedimages) {
|
|
140
|
+
const fileName = updated.savedimages.toLowerCase();
|
|
141
|
+
console.log('jjjjjjj',JSON.stringify(fileName));
|
|
142
|
+
if (!fileName.endsWith('.png')) {
|
|
143
|
+
notifyMessage('Only PNG images are allowed.');
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
setUploading(true);
|
|
148
|
+
data.productimage = updated.savedimages;
|
|
149
|
+
data.flag = 2;
|
|
150
|
+
setInvoiceData(prevData => ({
|
|
151
|
+
...prevData,
|
|
152
|
+
EditStatus: true,
|
|
153
|
+
}));
|
|
154
|
+
setTimeout(() => {
|
|
155
|
+
setUploading(false);
|
|
156
|
+
setRefreshKey(Date.now()); // bust cache
|
|
157
|
+
}, 400);
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
}}>
|
|
162
|
+
{uploading ? (
|
|
163
|
+
<ActivityIndicator size="small" color="#094485" />
|
|
164
|
+
) : isNUQ(data?.productimage) ? (
|
|
165
|
+
<RNImage
|
|
166
|
+
key={refreshKey}
|
|
167
|
+
style={styles.productImage}
|
|
168
|
+
source={{
|
|
169
|
+
uri: `${APIURL}invfile/getFile/image/${data.productimage}?t=${refreshKey}`,
|
|
170
|
+
}}
|
|
171
|
+
resizeMode="cover"
|
|
172
|
+
/>
|
|
173
|
+
) : (
|
|
174
|
+
<View style={styles.cameraIcon}>
|
|
175
|
+
<Icons.FontAwesome5
|
|
176
|
+
name="camera"
|
|
177
|
+
color="#094485"
|
|
178
|
+
size={normalize(20)}
|
|
179
|
+
/>
|
|
180
|
+
<Text style={{ fontSize: normalize(5), fontWeight: 'bold' }}>
|
|
181
|
+
PNG ONLY
|
|
182
|
+
</Text>
|
|
183
|
+
</View>
|
|
184
|
+
)}
|
|
185
|
+
</TouchableOpacity>
|
|
186
|
+
|
|
187
|
+
</View>
|
|
188
|
+
</View>
|
|
189
|
+
</TouchableOpacity>
|
|
190
|
+
</SwipeRow>
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const styles = StyleSheet.create({
|
|
195
|
+
cardContainer: {
|
|
196
|
+
backgroundColor: '#faeeeb',
|
|
197
|
+
marginHorizontal: normalize(10),
|
|
198
|
+
marginBottom: normalize(10),
|
|
199
|
+
borderRadius: normalize(5),
|
|
200
|
+
shadowColor: Global.AppTheme.primary_color,
|
|
201
|
+
shadowOffset: { width: 4, height: 4 },
|
|
202
|
+
shadowOpacity: 0.6,
|
|
203
|
+
shadowRadius: 10,
|
|
204
|
+
elevation: 8,
|
|
205
|
+
...CButtonShadow(),
|
|
206
|
+
},
|
|
207
|
+
cardContent: {
|
|
208
|
+
flexDirection: 'row',
|
|
209
|
+
minHeight: normalize(40),
|
|
210
|
+
},
|
|
211
|
+
colorIndicator: {
|
|
212
|
+
width: normalize(10),
|
|
213
|
+
height: '100%',
|
|
214
|
+
borderTopLeftRadius: normalize(5),
|
|
215
|
+
borderBottomLeftRadius: normalize(5),
|
|
216
|
+
},
|
|
217
|
+
textContainer: {
|
|
218
|
+
flex: 1,
|
|
219
|
+
paddingVertical: normalize(8),
|
|
220
|
+
paddingHorizontal: normalize(5),
|
|
221
|
+
justifyContent: 'center',
|
|
222
|
+
},
|
|
223
|
+
titleText: {
|
|
224
|
+
fontSize: normalize(12.5),
|
|
225
|
+
fontWeight: 'bold',
|
|
226
|
+
color: Global.AppTheme.primary_color,
|
|
227
|
+
marginBottom: normalize(4),
|
|
228
|
+
},
|
|
229
|
+
hsnContainer: {
|
|
230
|
+
flexDirection: 'row',
|
|
231
|
+
marginTop: normalize(2),
|
|
232
|
+
},
|
|
233
|
+
imageContainer: {
|
|
234
|
+
width: normalize(50),
|
|
235
|
+
height: normalize(50),
|
|
236
|
+
backgroundColor: 'white',
|
|
237
|
+
borderRadius: normalize(35),
|
|
238
|
+
alignItems: 'center',
|
|
239
|
+
justifyContent: 'center',
|
|
240
|
+
margin: normalize(5),
|
|
241
|
+
borderWidth: 1,
|
|
242
|
+
borderColor: '#e0e0e0',
|
|
243
|
+
},
|
|
244
|
+
productImage: {
|
|
245
|
+
width: '100%',
|
|
246
|
+
height: '100%',
|
|
247
|
+
borderRadius: normalize(35),
|
|
248
|
+
},
|
|
249
|
+
cameraIcon: {
|
|
250
|
+
padding: normalize(10),
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
export default SwipableProductImageCard;
|