@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,288 @@
|
|
|
1
|
+
import React, { useState, useEffect, useContext } from 'react'
|
|
2
|
+
import { View, Text, StatusBar, Dimensions, ImageBackground, TouchableOpacity, TouchableHighlight, Image } from 'react-native'
|
|
3
|
+
import { TextInput } from 'react-native-paper'
|
|
4
|
+
import Icons from '../Common/Icons'
|
|
5
|
+
import { normalize } from '../CommonStyle/componentStyle'
|
|
6
|
+
import { getLoading, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions'
|
|
7
|
+
import NetworkServiceCall from '../Common/NetworkServiceCall'
|
|
8
|
+
import { APIURL } from '../../../../../src/Common/apiConstants'
|
|
9
|
+
import Loader from '../Custom/Loader'
|
|
10
|
+
import { Global } from '../../../../../src/Common/Global'
|
|
11
|
+
import axios from 'axios'
|
|
12
|
+
import { useNavigation } from '../Navigation/useNavigation';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const image = { uri: 'https://t4.ftcdn.net/jpg/05/19/65/81/360_F_519658132_FkvYwAjuJ8q67PGQUgYLrumVymaJtlZj.jpg' };
|
|
16
|
+
export default function ForgotPassword({ }) {
|
|
17
|
+
const Navigation = useNavigation()
|
|
18
|
+
const [stage, setStage] = useState(1)
|
|
19
|
+
const [text, setText] = useState('')
|
|
20
|
+
const [msg, setMsg] = useState('')
|
|
21
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
22
|
+
const [password, setPassword] = useState({
|
|
23
|
+
"oldpass": "",
|
|
24
|
+
"newpass": "",
|
|
25
|
+
"confirmpass": ""
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setPassword({
|
|
30
|
+
"newpass": "",
|
|
31
|
+
"confirmpass": ""
|
|
32
|
+
})
|
|
33
|
+
setMsg("")
|
|
34
|
+
}, [stage])
|
|
35
|
+
|
|
36
|
+
function actionJWT() {
|
|
37
|
+
if ((password.oldpass && text)) {
|
|
38
|
+
|
|
39
|
+
let buttonapi = APIURL + "auth/authenticate"
|
|
40
|
+
var PostArr = {
|
|
41
|
+
"username": text,
|
|
42
|
+
"password": password.oldpass,
|
|
43
|
+
}
|
|
44
|
+
console.log("FORGOT PASSWORD", JSON.stringify(buttonapi))
|
|
45
|
+
console.log("OUT", JSON.stringify(PostArr))
|
|
46
|
+
axios.post(buttonapi, PostArr)
|
|
47
|
+
.then(function (response) {
|
|
48
|
+
if (response.status == 200) {
|
|
49
|
+
console.log('success', response.data)
|
|
50
|
+
Global.JWTToken = response.data
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
notifyMessage("Please check old password", 2)
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
.catch(function (error) {
|
|
57
|
+
notifyMessage("Error", 3)
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
const [isPasswordSecure, setIsPasswordSecure] = useState(true);
|
|
64
|
+
const [isPasswordSecureTwo, setIsPasswordSecureTwo] = useState(true);
|
|
65
|
+
return (
|
|
66
|
+
<View style={{ flex: 1, marginTop: StatusBar.currentHeight, backgroundColor: "#fff" }}>
|
|
67
|
+
<StatusBar translucent backgroundColor="transparent" barStyle={'dark-content'} />
|
|
68
|
+
<ImageBackground source={image} resizeMode="cover"
|
|
69
|
+
style={{ flex: 1 }}>
|
|
70
|
+
<View style={{ height: normalize(50) }}>
|
|
71
|
+
<TouchableOpacity
|
|
72
|
+
hitSlop={{ left: 10, right: 10, top: 10, bottom: 10 }}
|
|
73
|
+
style={{ left: 30, top: 10 }}
|
|
74
|
+
onPress={() => stage == 1 ? Navigation.goBack() : setStage(stage - 1)}>
|
|
75
|
+
<Icons.FontAwesome5 name={"arrow-left"} color={"black"} size={normalize(20)} />
|
|
76
|
+
</TouchableOpacity>
|
|
77
|
+
</View>
|
|
78
|
+
|
|
79
|
+
{stage == 1 ?
|
|
80
|
+
<View style={{ flex: 1, alignItems: 'center' }}>
|
|
81
|
+
<Icons.FontAwesome5 name={"lock"} color={"black"} size={normalize(50)} />
|
|
82
|
+
<Text style={{ fontWeight: 'bold', fontSize: normalize(25) }}>CHANGE</Text>
|
|
83
|
+
<Text style={{ fontWeight: 'bold', fontSize: normalize(25) }}>PASSWORD</Text>
|
|
84
|
+
<Text style={{ textAlign: 'center', paddingVertical: normalize(10) }}>Provide your account's userid for which you want to reset password.</Text>
|
|
85
|
+
|
|
86
|
+
<TextInput
|
|
87
|
+
value={text}
|
|
88
|
+
keyboardType={'numeric'}
|
|
89
|
+
onChangeText={text => setText(text)}
|
|
90
|
+
label="Enter User ID"
|
|
91
|
+
autoFocus={true}
|
|
92
|
+
left={<TextInput.Icon icon="clock-time-five-outline" iconColor={"purple"}
|
|
93
|
+
style={{}} />}
|
|
94
|
+
mode="outlined"
|
|
95
|
+
style={{ width: Dimensions.get('screen').width * 0.9 }}
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<TouchableHighlight
|
|
99
|
+
underlayColor={'lightblue'}
|
|
100
|
+
onPress={() => ValueCheck(text) ? setStage(2) : notifyMessage("Please enter required details", 3)}
|
|
101
|
+
style={{
|
|
102
|
+
width: Dimensions.get('screen').width * 0.9, justifyContent: 'center',
|
|
103
|
+
height: normalize(40), backgroundColor: '#FADF00', marginTop: normalize(10), alignItems: 'center'
|
|
104
|
+
}}>
|
|
105
|
+
<Text style={{ fontWeight: 'bold' }}>NEXT</Text>
|
|
106
|
+
</TouchableHighlight>
|
|
107
|
+
</View> : null}
|
|
108
|
+
|
|
109
|
+
{stage == 2 ?
|
|
110
|
+
<View style={{ flex: 1, alignItems: 'center' }}>
|
|
111
|
+
<Icons.MaterialCommunityIcons name={"credit-card-lock-outline"} color={"black"} size={normalize(50)} />
|
|
112
|
+
<Text style={{ fontWeight: 'bold', fontSize: normalize(25) }}>NEW</Text>
|
|
113
|
+
<Text style={{ fontWeight: 'bold', fontSize: normalize(25) }}>CREDENTIALS</Text>
|
|
114
|
+
<Text style={{ textAlign: 'center', fontSize: normalize(13) }}>Set your new password , by confirming old password</Text>
|
|
115
|
+
|
|
116
|
+
<View style={{ marginTop: normalize(10) }}>
|
|
117
|
+
<TextInput
|
|
118
|
+
autoFocus={true}
|
|
119
|
+
value={password.oldpass}
|
|
120
|
+
secureTextEntry={isPasswordSecure}
|
|
121
|
+
onChangeText={text => setPassword({ ...password, "oldpass": text })}
|
|
122
|
+
label="Old Password"
|
|
123
|
+
onEndEditing={() => actionJWT()}
|
|
124
|
+
left={<TextInput.Icon icon="lock" iconColor={"purple"}
|
|
125
|
+
style={{}} />}
|
|
126
|
+
right={<TextInput.Icon icon={isPasswordSecure ? "eye-off" : "eye"} iconColor={"purple"}
|
|
127
|
+
onPress={() => { isPasswordSecure ? setIsPasswordSecure(false) : setIsPasswordSecure(true) }} />}
|
|
128
|
+
mode="outlined"
|
|
129
|
+
style={{ width: Dimensions.get('screen').width * 0.9 }}
|
|
130
|
+
/>
|
|
131
|
+
</View>
|
|
132
|
+
|
|
133
|
+
<View style={{ marginTop: normalize(15) }}>
|
|
134
|
+
<Text style={{ alignSelf: 'flex-end', fontWeight: 'bold', color: msg == "Easy" ? 'red' : 'darkblue' }}>{msg}</Text>
|
|
135
|
+
<TextInput
|
|
136
|
+
value={password.newpass}
|
|
137
|
+
secureTextEntry={isPasswordSecure}
|
|
138
|
+
onChangeText={text => setPassword({ ...password, "newpass": text })}
|
|
139
|
+
onEndEditing={() => checkPasswordStrength(password.newpass)}
|
|
140
|
+
label="New Password"
|
|
141
|
+
left={<TextInput.Icon icon="lock" iconColor={"purple"}
|
|
142
|
+
style={{}} />}
|
|
143
|
+
right={<TextInput.Icon icon={isPasswordSecure ? "eye-off" : "eye"} iconColor={"purple"}
|
|
144
|
+
onPress={() => { isPasswordSecure ? setIsPasswordSecure(false) : setIsPasswordSecure(true) }} />}
|
|
145
|
+
mode="outlined"
|
|
146
|
+
style={{ width: Dimensions.get('screen').width * 0.9 }}
|
|
147
|
+
/>
|
|
148
|
+
</View>
|
|
149
|
+
|
|
150
|
+
<TextInput
|
|
151
|
+
value={password.confirmpass}
|
|
152
|
+
secureTextEntry={isPasswordSecureTwo}
|
|
153
|
+
onChangeText={text => setPassword({ ...password, "confirmpass": text })}
|
|
154
|
+
label="Confirm Password"
|
|
155
|
+
left={<TextInput.Icon icon="lock" iconColor={"purple"}
|
|
156
|
+
style={{}} />}
|
|
157
|
+
right={<TextInput.Icon icon={isPasswordSecureTwo ? "eye-off" : "eye"} iconColor={"purple"}
|
|
158
|
+
onPress={() => { isPasswordSecureTwo ? setIsPasswordSecureTwo(false) : setIsPasswordSecureTwo(true) }} />}
|
|
159
|
+
mode="outlined"
|
|
160
|
+
style={{ width: Dimensions.get('screen').width * 0.9, marginTop: normalize(20) }}
|
|
161
|
+
/>
|
|
162
|
+
|
|
163
|
+
<TouchableHighlight
|
|
164
|
+
underlayColor={'lightblue'}
|
|
165
|
+
onPress={() => getUpdate()}
|
|
166
|
+
style={{
|
|
167
|
+
width: Dimensions.get('screen').width * 0.9, justifyContent: 'center',
|
|
168
|
+
height: normalize(40), backgroundColor: '#FADF00', marginTop: normalize(10), alignItems: 'center'
|
|
169
|
+
}}>
|
|
170
|
+
<Text style={{ fontWeight: 'bold' }}>UPDATE</Text>
|
|
171
|
+
</TouchableHighlight>
|
|
172
|
+
</View> : null}
|
|
173
|
+
|
|
174
|
+
{stage == 3 ?
|
|
175
|
+
<View style={{ flex: 1, backgroundColor: "#fff", alignItems: 'center' }}>
|
|
176
|
+
|
|
177
|
+
<Icons.EvilIcons name={"check"} color={"green"} size={normalize(100)} />
|
|
178
|
+
<Text style={{ fontWeight: 'bold', fontSize: normalize(20), color: "green" }}>Password Updated</Text>
|
|
179
|
+
<Text style={{ textAlign: 'center', fontSize: normalize(14), color: "black", paddingVertical: normalize(5) }}>Your password changed successfully ! Use your new password to log in</Text>
|
|
180
|
+
|
|
181
|
+
<TouchableHighlight
|
|
182
|
+
underlayColor={'lightblue'}
|
|
183
|
+
onPress={() => { setStage(1), Navigation.goBack() }}
|
|
184
|
+
style={{
|
|
185
|
+
width: Dimensions.get('screen').width * 0.9, justifyContent: 'center',
|
|
186
|
+
height: normalize(40), backgroundColor: '#FADF00', marginTop: normalize(10), alignItems: 'center'
|
|
187
|
+
}}>
|
|
188
|
+
<Text style={{ fontWeight: 'bold' }}>LOGIN</Text>
|
|
189
|
+
</TouchableHighlight>
|
|
190
|
+
</View>
|
|
191
|
+
: null}
|
|
192
|
+
</ImageBackground>
|
|
193
|
+
|
|
194
|
+
{isLoading ?
|
|
195
|
+
<Loader displaytext={true} />
|
|
196
|
+
: null}
|
|
197
|
+
</View>
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
function getUpdate() {
|
|
201
|
+
if (password.newpass != ""
|
|
202
|
+
&& password.confirmpass != "") {
|
|
203
|
+
if (password.newpass == password.confirmpass) {
|
|
204
|
+
|
|
205
|
+
var ReqJson = {
|
|
206
|
+
"groups": {
|
|
207
|
+
"procedurename": "suuserforgetpassword1",
|
|
208
|
+
"userid": text,
|
|
209
|
+
...password
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
console.log("Add Component>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", JSON.stringify(ReqJson))
|
|
213
|
+
let buttonapi = APIURL + 'commontemplatesave/RnCommonTemplateSave';
|
|
214
|
+
console.log("**************************************", JSON.stringify(buttonapi))
|
|
215
|
+
setIsLoading(true)
|
|
216
|
+
NetworkServiceCall('post', buttonapi, ReqJson, Global.JWTToken).then(function (response) {
|
|
217
|
+
console.log("REPOSNEEEEEEE", JSON.stringify(response))
|
|
218
|
+
if (response.httpstatus == 200
|
|
219
|
+
&& response.data != undefined && response.data != null
|
|
220
|
+
&& response.data.code != undefined && response.data.code > 0) {
|
|
221
|
+
notifyMessage('Password Updated !!!', 1);
|
|
222
|
+
setStage(3)
|
|
223
|
+
console.log("Password Updated !!!", password.newpass)
|
|
224
|
+
setIsLoading(false);
|
|
225
|
+
|
|
226
|
+
} else {
|
|
227
|
+
notifyMessage('Password Not Updated !!! Please check old password', 2);
|
|
228
|
+
setIsLoading(false);
|
|
229
|
+
}
|
|
230
|
+
})
|
|
231
|
+
|
|
232
|
+
getLoading(v => setIsLoading(false))
|
|
233
|
+
|
|
234
|
+
} else {
|
|
235
|
+
notifyMessage("Oops...Passwords does not match each other", 4)
|
|
236
|
+
}
|
|
237
|
+
} else {
|
|
238
|
+
notifyMessage("Please fill out passwords", 3)
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function checkPasswordStrength(password) {
|
|
243
|
+
// Initialize variables
|
|
244
|
+
var strength = 0;
|
|
245
|
+
var tips = "";
|
|
246
|
+
|
|
247
|
+
// Check password length
|
|
248
|
+
if (password.length < 8) {
|
|
249
|
+
tips += "Make the password longer. ";
|
|
250
|
+
} else {
|
|
251
|
+
strength += 1;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Check for mixed case
|
|
255
|
+
if (password.match(/[a-z]/) && password.match(/[A-Z]/)) {
|
|
256
|
+
strength += 1;
|
|
257
|
+
} else {
|
|
258
|
+
tips += "Use both lowercase and uppercase letters. ";
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// Check for numbers
|
|
262
|
+
if (password.match(/\d/)) {
|
|
263
|
+
strength += 1;
|
|
264
|
+
} else {
|
|
265
|
+
tips += "Include at least one number. ";
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Check for special characters
|
|
269
|
+
if (password.match(/[^a-zA-Z\d]/)) {
|
|
270
|
+
strength += 1;
|
|
271
|
+
} else {
|
|
272
|
+
tips += "Include at least one special character. ";
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
// Return results
|
|
278
|
+
if (strength < 2) {
|
|
279
|
+
return setMsg("Easy", notifyMessage(tips, 5));
|
|
280
|
+
} else if (strength === 2) {
|
|
281
|
+
return setMsg("Medium Difficulty", notifyMessage(tips, 5));
|
|
282
|
+
} else if (strength === 3) {
|
|
283
|
+
return setMsg("Difficult", notifyMessage(tips, 5));
|
|
284
|
+
} else {
|
|
285
|
+
return setMsg("Extremely difficult");
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
StyleSheet,
|
|
4
|
+
Text,
|
|
5
|
+
View,
|
|
6
|
+
StatusBar,
|
|
7
|
+
Image,
|
|
8
|
+
TouchableOpacity,
|
|
9
|
+
Alert,
|
|
10
|
+
Modal,
|
|
11
|
+
Dimensions,
|
|
12
|
+
ScrollView
|
|
13
|
+
} from 'react-native';
|
|
14
|
+
import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
15
|
+
import Feather from 'react-native-vector-icons/Feather';
|
|
16
|
+
import { Global } from '../../../../../src/Common/Global';
|
|
17
|
+
import CSliderMenu from '../Custom/CSliderMenu';
|
|
18
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
19
|
+
import NotificationContext from '../../../../../src/Handlers/NoticationsContext';
|
|
20
|
+
import moment from 'moment';
|
|
21
|
+
import { ValueCheck, isNUQZ } from '../CommonStyle/ComponentFunctions';
|
|
22
|
+
import ABlink from '../Alerts/ABlink';
|
|
23
|
+
import COverlay from '../CustomComponents/COverlay';
|
|
24
|
+
import OUserView from '../Custom/OUserView';
|
|
25
|
+
import CBackHandler from '../CustomComponents/CBackHandler';
|
|
26
|
+
import InsureResponseComponentContext from '../../../../../src/Handlers/insureResponseComponentContext';
|
|
27
|
+
import CNetworkStatus from '../CustomComponents/CNetworkStatus';
|
|
28
|
+
import { useNavigation } from '../Navigation/useNavigation';
|
|
29
|
+
|
|
30
|
+
const HeaderBlock = (props) => {
|
|
31
|
+
const { responseJSON, setResponseJSON } = useContext(InsureResponseComponentContext);
|
|
32
|
+
const [isShowSlidermenu, setIsShowSlidermenu] = useState(false);
|
|
33
|
+
const [backHandler, setBackHandler] = useState(false);
|
|
34
|
+
const [backHandlerLogOut, setBackHandlerLogOut] = useState(false);
|
|
35
|
+
const [refresh, setRefresh] = useState(0);
|
|
36
|
+
const [overlay, setOverlay] = useState(false);
|
|
37
|
+
const [jsonoverlay, setJsonOverlay] = useState(false);
|
|
38
|
+
const navigation = useNavigation()
|
|
39
|
+
|
|
40
|
+
const OverlayHOCComponent = COverlay(OUserView);
|
|
41
|
+
|
|
42
|
+
const NoticationData = React.useContext(NotificationContext);
|
|
43
|
+
|
|
44
|
+
const result = NoticationData.filter(obj => obj.status === true);
|
|
45
|
+
|
|
46
|
+
const styles = StyleSheet.create({
|
|
47
|
+
container: {
|
|
48
|
+
display: 'flex',
|
|
49
|
+
backgroundColor: Global.AppTheme.primary_color,
|
|
50
|
+
justifyContent: 'center',
|
|
51
|
+
paddingLeft: normalize(3),
|
|
52
|
+
marginTop: StatusBar.currentHeight,
|
|
53
|
+
},
|
|
54
|
+
headerContent: {
|
|
55
|
+
flexDirection: 'row',
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
marginBottom: normalize(6),
|
|
58
|
+
paddingBottom: normalize(0),
|
|
59
|
+
},
|
|
60
|
+
backButton: {
|
|
61
|
+
flexDirection: 'row',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
borderWidth: 0,
|
|
64
|
+
},
|
|
65
|
+
logoContainer: {
|
|
66
|
+
width: normalize(100),
|
|
67
|
+
height: normalize(40),
|
|
68
|
+
},
|
|
69
|
+
betaContainer: {
|
|
70
|
+
position: 'absolute',
|
|
71
|
+
bottom: normalize(-4),
|
|
72
|
+
right: normalize(-70),
|
|
73
|
+
},
|
|
74
|
+
betaText: {
|
|
75
|
+
color: '#ffffff',
|
|
76
|
+
fontSize: normalize(20),
|
|
77
|
+
letterSpacing: 5,
|
|
78
|
+
fontWeight: 'bold',
|
|
79
|
+
textShadowColor: '#000000',
|
|
80
|
+
textShadowOffset: { width: 0.5, height: 0.5 },
|
|
81
|
+
textShadowRadius: 0.5,
|
|
82
|
+
},
|
|
83
|
+
versionText: {
|
|
84
|
+
color: 'white',
|
|
85
|
+
fontSize: normalize(8),
|
|
86
|
+
},
|
|
87
|
+
userInfoButton: {
|
|
88
|
+
flexDirection: 'row',
|
|
89
|
+
borderWidth: 0,
|
|
90
|
+
flex: 1,
|
|
91
|
+
justifyContent: 'flex-start',
|
|
92
|
+
},
|
|
93
|
+
userInfoContainer: {
|
|
94
|
+
borderWidth: 0,
|
|
95
|
+
},
|
|
96
|
+
userNameText: {
|
|
97
|
+
fontWeight: 'bold',
|
|
98
|
+
fontSize: normalize(13),
|
|
99
|
+
marginLeft: 5,
|
|
100
|
+
color: 'white',
|
|
101
|
+
},
|
|
102
|
+
departmentText: {
|
|
103
|
+
fontFamily: Global.fontNormal,
|
|
104
|
+
fontSize: normalize(11),
|
|
105
|
+
marginLeft: 5,
|
|
106
|
+
color: 'white',
|
|
107
|
+
},
|
|
108
|
+
rightIconsContainer: {
|
|
109
|
+
flexDirection: 'row',
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
justifyContent: 'flex-end',
|
|
112
|
+
borderWidth: 0,
|
|
113
|
+
},
|
|
114
|
+
notificationButton: {
|
|
115
|
+
marginRight: normalize(5),
|
|
116
|
+
},
|
|
117
|
+
notificationBadge: {
|
|
118
|
+
position: 'absolute',
|
|
119
|
+
right: normalize(-5),
|
|
120
|
+
top: normalize(-8),
|
|
121
|
+
backgroundColor: 'white',
|
|
122
|
+
alignItems: 'center',
|
|
123
|
+
borderRadius: 20,
|
|
124
|
+
width: normalize(15),
|
|
125
|
+
},
|
|
126
|
+
notificationCount: {
|
|
127
|
+
fontSize: normalize(7),
|
|
128
|
+
fontWeight: 'bold',
|
|
129
|
+
},
|
|
130
|
+
menuButton: {
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
justifyContent: 'center',
|
|
133
|
+
},
|
|
134
|
+
loginTimeText: {
|
|
135
|
+
fontSize: normalize(9),
|
|
136
|
+
marginLeft: 0,
|
|
137
|
+
color: 'white',
|
|
138
|
+
},
|
|
139
|
+
jsonModalContainer: {
|
|
140
|
+
backgroundColor: 'white',
|
|
141
|
+
borderWidth: 1,
|
|
142
|
+
height: Dimensions.get('screen').height * 0.9,
|
|
143
|
+
alignSelf: 'center',
|
|
144
|
+
width: Dimensions.get('screen').width * 0.9,
|
|
145
|
+
},
|
|
146
|
+
closeButton: {
|
|
147
|
+
textAlign: 'right',
|
|
148
|
+
fontWeight: 'bold',
|
|
149
|
+
color: 'black',
|
|
150
|
+
},
|
|
151
|
+
jsonText: {
|
|
152
|
+
fontSize: normalize(10),
|
|
153
|
+
color: 'black',
|
|
154
|
+
fontFamily: 'Courier New',
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const OnPressGoBack = () => {
|
|
159
|
+
if (props.callback) {
|
|
160
|
+
props.callback(true);
|
|
161
|
+
} else {
|
|
162
|
+
if (ValueCheck(props.backhandler)) {
|
|
163
|
+
if (ValueCheck(props.consultation) && Global.EditStatus == 1) {
|
|
164
|
+
setBackHandler(true);
|
|
165
|
+
} else {
|
|
166
|
+
navigation.goBack(); // 👈 works
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
navigation.goBack(); // 👈 works
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const renderJsonModal = () => (
|
|
175
|
+
<Modal
|
|
176
|
+
onRequestClose={() => setJsonOverlay(false)}
|
|
177
|
+
style={{
|
|
178
|
+
height: Dimensions.get('screen').height,
|
|
179
|
+
width: Dimensions.get('screen').width,
|
|
180
|
+
backgroundColor: 'transparent',
|
|
181
|
+
justifyContent: 'center',
|
|
182
|
+
alignItems: 'center',
|
|
183
|
+
}}
|
|
184
|
+
transparent={true}
|
|
185
|
+
>
|
|
186
|
+
<View style={styles.jsonModalContainer}>
|
|
187
|
+
<TouchableOpacity onPress={() => setJsonOverlay(false)}>
|
|
188
|
+
<Text style={styles.closeButton}>Close</Text>
|
|
189
|
+
</TouchableOpacity>
|
|
190
|
+
<ScrollView>
|
|
191
|
+
<Text selectable={true} style={styles.jsonText}>
|
|
192
|
+
{JSON.stringify(responseJSON, null, 2)}
|
|
193
|
+
</Text>
|
|
194
|
+
</ScrollView>
|
|
195
|
+
</View>
|
|
196
|
+
</Modal>
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
const renderBetaVersion = () => (
|
|
200
|
+
<View style={styles.betaContainer}>
|
|
201
|
+
<ABlink duration={500}>
|
|
202
|
+
<View style={{ justifyContent: 'center', alignItems: 'center' }}>
|
|
203
|
+
<Text style={styles.betaText}>BETA TESTING</Text>
|
|
204
|
+
<Text style={styles.versionText}>
|
|
205
|
+
{Global.version ? `V ${Global.version}` : null}
|
|
206
|
+
</Text>
|
|
207
|
+
</View>
|
|
208
|
+
</ABlink>
|
|
209
|
+
</View>
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
const renderUserInfo = () => (
|
|
213
|
+
<TouchableOpacity
|
|
214
|
+
onPress={() => props.webview != undefined ? null : setOverlay(true)}
|
|
215
|
+
style={styles.userInfoButton}
|
|
216
|
+
>
|
|
217
|
+
<View style={styles.userInfoContainer}>
|
|
218
|
+
<Text
|
|
219
|
+
adjustsFontSizeToFit
|
|
220
|
+
numberOfLines={2}
|
|
221
|
+
style={styles.userNameText}
|
|
222
|
+
>
|
|
223
|
+
{props.webview != undefined ? "" : Global.userData && Global.userData.department != undefined && Global.userData.department != "" ? Global.userData.username : ''}
|
|
224
|
+
</Text>
|
|
225
|
+
{Global.userData && Global.userData.department != undefined && Global.userData.department != "" && props.webview == undefined ? (
|
|
226
|
+
<Text
|
|
227
|
+
adjustsFontSizeToFit
|
|
228
|
+
style={styles.departmentText}
|
|
229
|
+
>
|
|
230
|
+
{Global.userData.department}
|
|
231
|
+
</Text>
|
|
232
|
+
) : null}
|
|
233
|
+
</View>
|
|
234
|
+
</TouchableOpacity>
|
|
235
|
+
);
|
|
236
|
+
|
|
237
|
+
const renderRightIcons = () => (
|
|
238
|
+
<View style={styles.rightIconsContainer}>
|
|
239
|
+
<CNetworkStatus />
|
|
240
|
+
<TouchableOpacity
|
|
241
|
+
onPress={() => navigation.navigate('Notifications')}
|
|
242
|
+
style={styles.notificationButton}
|
|
243
|
+
>
|
|
244
|
+
<View style={styles.notificationBadge}>
|
|
245
|
+
<ABlink>
|
|
246
|
+
<Text
|
|
247
|
+
numberOfLines={1}
|
|
248
|
+
adjustsFontSizeToFit
|
|
249
|
+
style={[
|
|
250
|
+
styles.notificationCount,
|
|
251
|
+
{ color: result.length > 0 ? "red" : 'black' }
|
|
252
|
+
]}
|
|
253
|
+
>
|
|
254
|
+
{result.length}
|
|
255
|
+
</Text>
|
|
256
|
+
</ABlink>
|
|
257
|
+
</View>
|
|
258
|
+
<Ionicons name={'notifications-outline'} color="white" size={normalize(15)} />
|
|
259
|
+
</TouchableOpacity>
|
|
260
|
+
<View style={{ paddingLeft: normalize(2) }}>
|
|
261
|
+
<TouchableOpacity
|
|
262
|
+
onPress={() => setIsShowSlidermenu(true)}
|
|
263
|
+
style={styles.menuButton}
|
|
264
|
+
>
|
|
265
|
+
<Feather name={'menu'} color="white" size={normalize(25)} />
|
|
266
|
+
<View>
|
|
267
|
+
{Global.LoginTime != undefined ? (
|
|
268
|
+
<Text style={styles.loginTimeText}>
|
|
269
|
+
{(moment.duration(moment().diff(Global.LoginTime)).asMinutes()).toFixed(0) + " Min."}
|
|
270
|
+
</Text>
|
|
271
|
+
) : null}
|
|
272
|
+
</View>
|
|
273
|
+
</TouchableOpacity>
|
|
274
|
+
</View>
|
|
275
|
+
</View>
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
return (
|
|
279
|
+
<View style={[styles.container, props.style]} key={refresh}>
|
|
280
|
+
<StatusBar
|
|
281
|
+
translucent
|
|
282
|
+
backgroundColor={Global.AppTheme.primary_color}
|
|
283
|
+
barStyle="light-content"
|
|
284
|
+
/>
|
|
285
|
+
|
|
286
|
+
{jsonoverlay && renderJsonModal()}
|
|
287
|
+
|
|
288
|
+
<View style={styles.headerContent}>
|
|
289
|
+
<TouchableOpacity
|
|
290
|
+
style={styles.backButton}
|
|
291
|
+
onPress={OnPressGoBack}
|
|
292
|
+
>
|
|
293
|
+
<Ionicons
|
|
294
|
+
name={'chevron-back'}
|
|
295
|
+
color='white'
|
|
296
|
+
size={normalize(25)}
|
|
297
|
+
/>
|
|
298
|
+
<View style={styles.logoContainer}>
|
|
299
|
+
{Global.betaversion ? (
|
|
300
|
+
<View style={styles.logoContainer} />
|
|
301
|
+
) : (
|
|
302
|
+
<Image
|
|
303
|
+
style={{
|
|
304
|
+
width: normalize(100),
|
|
305
|
+
height: normalize(40),
|
|
306
|
+
resizeMode: 'contain',
|
|
307
|
+
borderRadius: 8,
|
|
308
|
+
}}
|
|
309
|
+
source={{ uri: Global?.HospitalData?.hospitallogo3 ? Global.HospitalData.hospitallogo3 : null }}
|
|
310
|
+
/>
|
|
311
|
+
)}
|
|
312
|
+
</View>
|
|
313
|
+
{Global.betaversion && renderBetaVersion()}
|
|
314
|
+
</TouchableOpacity>
|
|
315
|
+
|
|
316
|
+
{renderUserInfo()}
|
|
317
|
+
|
|
318
|
+
{props.webview != undefined ? null : renderRightIcons()}
|
|
319
|
+
</View>
|
|
320
|
+
|
|
321
|
+
{overlay && (
|
|
322
|
+
<OverlayHOCComponent
|
|
323
|
+
visibility={val => (val == undefined ? null : setOverlay(val))}
|
|
324
|
+
/>
|
|
325
|
+
)}
|
|
326
|
+
{isShowSlidermenu && (
|
|
327
|
+
<CSliderMenu
|
|
328
|
+
navigation={navigation.navigate}
|
|
329
|
+
isShow={isShowSlidermenu}
|
|
330
|
+
visibility={(val) => (val == undefined ? null : setIsShowSlidermenu(val))}
|
|
331
|
+
/>
|
|
332
|
+
)}
|
|
333
|
+
|
|
334
|
+
{backHandler && (
|
|
335
|
+
<CBackHandler
|
|
336
|
+
type={5}
|
|
337
|
+
callBack={(val) => (val == undefined ? null : (setBackHandler(val), navigation.goBack()))}
|
|
338
|
+
close={(val) => (val == undefined ? null : setBackHandler(val))}
|
|
339
|
+
/>
|
|
340
|
+
)}
|
|
341
|
+
|
|
342
|
+
{backHandlerLogOut && (
|
|
343
|
+
<CBackHandler
|
|
344
|
+
type={6}
|
|
345
|
+
callBack={(val) => (val == undefined ? null : (setBackHandlerLogOut(val), navigation.goBack()))}
|
|
346
|
+
close={(val) => (val == undefined ? null : setBackHandlerLogOut(val))}
|
|
347
|
+
/>
|
|
348
|
+
)}
|
|
349
|
+
</View>
|
|
350
|
+
);
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
export default HeaderBlock;
|