diff --git a/app/components/elements.js b/app/components/elements.js index 868bf4a6..61701f12 100644 --- a/app/components/elements.js +++ b/app/components/elements.js @@ -1,6 +1,6 @@ import * as React from 'react'; import {useEffect, useState, useRef} from 'react'; -import { Platform, View, Text, Image, TouchableOpacity, ScrollView, StyleSheet, TextInput, Modal, TouchableWithoutFeedback, ActivityIndicator, Alert } from 'react-native' +import { Platform, View, Text, Image, TouchableOpacity, ScrollView, StyleSheet, TextInput, Modal, TouchableWithoutFeedback, ActivityIndicator, Alert, KeyboardAvoidingView } from 'react-native' import { Card, ListItem, Button, Icon, Divider, Input, Overlay, CheckBox } from 'react-native-elements' import {ActionSheet} from 'native-base'; import DateTimePicker from '@react-native-community/datetimepicker'; @@ -161,22 +161,18 @@ const loyaltycard = function(props){ } const card = function(props){ - let h = props.height ? props.height : 200 + let h = props.height ? props.height : 130 return ( - - + + @@ -302,30 +298,31 @@ const custominput = function(props){ let activeborderwidth = props.activeborderwidth || 1.5 const input = () => { return ( - - {props.title} - - {props.bottomText ? {props.bottomText} : null} - {props.bottomOption ? - If you wish to change this, please contact - - Unioil Customer Service - : null } - {props.hasError ? {props.errorMessage} : null} - ) + + {props.title} + + {props.bottomText ? {props.bottomText} : null} + {props.bottomOption ? + If you wish to change this, please contact + + Unioil Customer Service + : null } + {props.hasError ? {props.errorMessage} : null} + + ) } const select = () => { return ( @@ -710,6 +707,49 @@ const nointernet2 = function(){ ); } +const customAlert = function(props) { + const { + open, + yesCB, + noCB, + title, + body, + yesText, + noText + } = props; + + if(!open) return null; + + return ( + + + {title} + {body} + + + {noText ? noText : "Cancel"} + {yesText ? yesText : "Yes"} + + + + + ) +} + const bottomselectmodal = function(props){ let color = Theme.colors.textPrimary let items = props.items || [] @@ -952,5 +992,6 @@ export default { CustomMonthPicker, ActionOption, ModalDialogContainer, - loaderView + loaderView, + customAlert } diff --git a/app/components/paymaya/form.js b/app/components/paymaya/form.js index e82d64f6..6a5c384d 100644 --- a/app/components/paymaya/form.js +++ b/app/components/paymaya/form.js @@ -63,12 +63,10 @@ class RegisterCardFrom extends React.Component { expiry: "MM/YY", cvc: "CVC" }} onChange={this._onChange}/> - - - Full Name - this.setState({ name: value })} /> - - + + Full Name + this.setState({ name: value })} /> + this.send()} style={{padding: 15}}> diff --git a/app/components/safeArea.component.js b/app/components/safeArea.component.js index 8192b279..a7533cff 100644 --- a/app/components/safeArea.component.js +++ b/app/components/safeArea.component.js @@ -1,10 +1,20 @@ import React, { useEffect, useState } from 'react'; -import { StyleSheet, SafeAreaView,Platform} from 'react-native'; +import { + Platform, + SafeAreaView, + StyleSheet, + View, + NativeModules +} from 'react-native'; import { Dimensions } from 'react-native' +import Theme from '../components/theme.style.js'; const { height } = Dimensions.get('window'); -const CustomSafeArea = ({children}) => { +const { StatusBarManager } = NativeModules; +const statusBarHeight = StatusBarManager.HEIGHT; +const OS = Platform.OS; +const CustomSafeArea = ({customStatusBar, children}) => { const [isIphone11,setIsIphone11] = useState(false); useEffect(() =>{ @@ -17,6 +27,14 @@ const CustomSafeArea = ({children}) => { } },[]) + if(customStatusBar && OS === "ios") { + return ( + + + {children} + + ) + } return ( @@ -26,10 +44,13 @@ const CustomSafeArea = ({children}) => { }; const styles = StyleSheet.create({ - customSafeArea:{ flex: 1 - + }, + statusBarHeight: { + height: statusBarHeight, + backgroundColor: Theme.colors.primary, + width: '100%' } }); export default CustomSafeArea; \ No newline at end of file diff --git a/app/screens/apply/index.js b/app/screens/apply/index.js index 6ca2e437..9df1d881 100644 --- a/app/screens/apply/index.js +++ b/app/screens/apply/index.js @@ -157,36 +157,34 @@ class ActivateAccountCard extends React.PureComponent { color={this.props.app_theme?.theme.colors.text} visible={this.state.loading} /> - - - - + + + + + + Enroll Card + + Have a new card? + + + Please enter your card number. + + + { + this.setState({ cardnumber: val, valid: val.length == 16 ? true : false }) + }} + /> - - Enroll Card - - Have a new card? - - - Please enter your card number. - - - { - this.setState({ cardnumber: val, valid: val.length == 16 ? true : false }) - }} - /> - - - this.onSubmit()} disabled={!this.state.valid} style={{padding: 20, paddingTop: 15, width: Theme.screen.w - 80, paddingBottom: 15, borderRadius: 10, backgroundColor: this.state.valid ? Theme.colors.primary : this.props.app_theme?.theme.dark ? this.props.app_theme?.theme.colors.border : Theme.colors.primary + "15"}}> - Next - - + + this.onSubmit()} disabled={!this.state.valid} style={{padding: 20, paddingTop: 15, width: Theme.screen.w - 80, paddingBottom: 15, borderRadius: 10, backgroundColor: this.state.valid ? Theme.colors.primary : this.props.app_theme?.theme.dark ? this.props.app_theme?.theme.colors.border : Theme.colors.primary + "15"}}> + Next + - + ); } diff --git a/app/screens/login/apply/details.js b/app/screens/login/apply/details.js index c9cbe58c..9d644135 100644 --- a/app/screens/login/apply/details.js +++ b/app/screens/login/apply/details.js @@ -131,53 +131,55 @@ class ApplyCardDetails extends React.Component { - + {this.card.name} - + {this.card.description} - - - Enter ID Number - - - {this.card.id_number_description ? this.card.id_number_description : ""} - - Alert.alert("Information", this.state.info ? this.state.info.value : "")} style={{padding: 10, paddingLeft: 0}}> - - + + + + Enter ID Number + {/* + + {this.card.id_number_description ? this.card.id_number_description : ""} + + Alert.alert("Information", this.state.info ? this.state.info.value : "")} style={{padding: 10, paddingLeft: 0}}> + + + */} + + + + + ID Number + { + this.setState({ cardid: value }) + if(value != "") this.setState({ valid: true }) + else this.setState({ valid: false }) + }} + /> + + + { + this.state.canProceed ? + this.onNext()} style={{backgroundColor: !this.handleShowForm() ? Theme.colors.primary : this.props.app_theme?.theme.dark ? this.props.app_theme?.theme.colors.border : Theme.colors.primary, padding: 15, marginTop: 20, width: '100%', borderRadius: 10, elevation: 3}}> + Next + : + this.onNext()} style={{backgroundColor: this.state.valid ? Theme.colors.primary : this.props.app_theme?.theme.dark ? this.props.app_theme?.theme.colors.border : Theme.colors.primary + "15", padding: 15, marginTop: 20, width: '100%', borderRadius: 10, elevation: this.state.valid ? 3 : 0}}> + Next + + } - - - - - ID Number - { - this.setState({ cardid: value }) - if(value != "") this.setState({ valid: true }) - else this.setState({ valid: false }) - }} - /> - - - { - this.state.canProceed ? - this.onNext()} style={{backgroundColor: !this.handleShowForm() ? Theme.colors.primary : this.props.app_theme?.theme.dark ? this.props.app_theme?.theme.colors.border : Theme.colors.primary, padding: 15, marginTop: 20, width: '100%', borderRadius: 10, elevation: 3}}> - Next - : - this.onNext()} style={{backgroundColor: this.state.valid ? Theme.colors.primary : this.props.app_theme?.theme.dark ? this.props.app_theme?.theme.colors.border : Theme.colors.primary + "15", padding: 15, marginTop: 20, width: '100%', borderRadius: 10, elevation: this.state.valid ? 3 : 0}}> - Next - - } diff --git a/app/screens/login/index.js b/app/screens/login/index.js index c387df9d..70eb5fb4 100644 --- a/app/screens/login/index.js +++ b/app/screens/login/index.js @@ -21,6 +21,7 @@ import REQUEST from '../../components/api/'; import DB from '../../components/storage/'; import CustomInput from '../../components/custominput'; import CustomSafeArea from '../../components/safeArea.component'; +import { StatusBar } from 'native-base'; class AddAccountCard extends React.PureComponent { @@ -135,87 +136,85 @@ class AddAccountCard extends React.PureComponent { render() { let version = `v${DeviceInfo.getReadableVersion()}` return ( - - - - - - - - - - Make Life Rewarding - - Enter your mobile number. - - - { - let value = val.includes(".") ? val.replace(".", "") : val - this.setState({ mobilenumber: value, valid: value.length == 13 ? true : false, agree: false }) - }} - /> - - this.state.valid ? this.onAgree() : null} style={{flex: 0, padding: 8}}> - {!this.state.agree || !this.state.valid ? : } - - - I agree to Unioil's - this.props.navigation.navigate("TermsConditions")}> - Data Privacy Policy. + + + + + + + + + + Make Life Rewarding + + Enter your mobile number. + + + { + let value = val.includes(".") ? val.replace(".", "") : val + this.setState({ mobilenumber: value, valid: value.length == 13 ? true : false, agree: false }) + }} + /> + + this.state.valid ? this.onAgree() : null} style={{flex: 0, padding: 8}}> + {!this.state.agree || !this.state.valid ? : } + + I agree to Unioil's + this.props.navigation.navigate("TermsConditions")}> + Data Privacy Policy. + + - - - - this.onSubmit()} disabled={(!this.state.agree || !this.state.valid)} style={{padding: 20, paddingTop: 15, width: Theme.screen.w - 80, paddingBottom: 15, borderRadius: 10, backgroundColor: (this.state.agree && this.state.valid) ? Theme.colors.primary : Theme.colors.darkGray + "40"}}> - Log In - - + + + this.onSubmit()} disabled={(!this.state.agree || !this.state.valid)} style={{padding: 20, paddingTop: 15, width: Theme.screen.w * .73, paddingBottom: 15, borderRadius: 10, backgroundColor: (this.state.agree && this.state.valid) ? Theme.colors.primary : Theme.colors.darkGray + "40"}}> + Log In + + - - or - - - - this.props.navigation.navigate("EnrollActivate", {screen: "Login"}) } style={{padding: 15, paddingTop: 12, width: Theme.screen.w - 80, paddingBottom: 12, borderRadius: 10, borderWidth: 2, borderColor: Theme.colors.white}}> - Activate your Card - - - - this.props.navigation.navigate("ApplySelectCard") } style={{padding: 15, paddingTop: 12, width: Theme.screen.w - 80, paddingBottom: 12, borderRadius: 10, borderWidth: 2, borderColor: Theme.colors.white}}> - Apply for a Card - - - - this.props.navigation.navigate("TermsConditions") } style={{padding: 15, paddingTop: 12, width: Theme.screen.w - 80, paddingBottom: 12}}> + + or + + + + this.props.navigation.navigate("EnrollActivate", {screen: "Login"}) } style={{padding: 15, paddingTop: 12, width: Theme.screen.w * .65, paddingBottom: 12, borderRadius: 10, borderWidth: 2, borderColor: Theme.colors.white}}> + Activate your Card + + + + this.props.navigation.navigate("ApplySelectCard") } style={{padding: 15, paddingTop: 12, width: Theme.screen.w * .65, paddingBottom: 12, borderRadius: 10, borderWidth: 2, borderColor: Theme.colors.white}}> + Apply for a Card + + + this.props.navigation.navigate("TermsConditions") } style={{paddingHorizontal: 15, width: Theme.screen.w - 80, paddingBottom: 12}}> Enter as Guest - - - {ContactOptions()}} style={{padding: 15, alignItems: 'flex-start', flex: 1}}> - Contact Us - - {}} style={{padding: 15, justifyContent: 'flex-end', flex: 1}}> - {version} - - - - + + {ContactOptions()}} style={{padding: 15, alignItems: 'flex-start', flex: 1}}> + Contact Us + + {}} style={{padding: 15, justifyContent: 'flex-end', flex: 1}}> + {version} + + + + ) } } diff --git a/app/screens/login/t&c.js b/app/screens/login/t&c.js index da95b366..5b590924 100644 --- a/app/screens/login/t&c.js +++ b/app/screens/login/t&c.js @@ -116,7 +116,7 @@ class TermsConditions extends React.PureComponent { {this.state.connection && !this.sender ? this.setGuest() }> - I Agree + I Accept : null } diff --git a/app/screens/main/home.js b/app/screens/main/home.js index d5f7bd66..4a8dd506 100644 --- a/app/screens/main/home.js +++ b/app/screens/main/home.js @@ -473,873 +473,4 @@ const mapDispatchToProps = { saveUserInfo } -export default connect(mapStateToProps, mapDispatchToProps)(Home) - -// const Home = (props) => { - -// const navigate = (screen, params) => { props.navigation.navigate(screen, params) } -// const whats_hot = (props.whats_hot != undefined && props.whats_hot.length > 0) ? props.whats_hot : [] -// const whats_promos = (props.promos != undefined && props.promos.length > 0) ? props.promos : [] -// const [loading, setloading] = useState(true) -// const [refresh, setRefresh] = useState(false) -// const [connected, setconnection] = useState(false) -// const [infodialog, setinfodialog] = useState(true) -// const [promos, setpromos] = useState(whats_promos) -// const [promogps, setpromogps] = useState([]) -// const [showpromogps, setshowpromogps] = useState(false) -// const [promogpsindex, setpromogpsindex] = useState(null) -// const [_carousel, setcarousel] = useState("") -// const [whatsHot, setwhatsHot] = useState(whats_hot) -// const [activeSlide, setactiveSlide] = useState(0) -// const [session, setsession] = useState(null) -// const [userProfile, setUserProfile] = useState({}) -// const [notifications, setnotifications] = useState([]) -// const [isGuest, setisGuest] = useState(false) -// var backPressCount = 0 -// var backPressDuration = 0 - -// const loadUserProfile = async () => { -// const SESSION = await DB.session() -// props.saveUserInfo({ token: SESSION.token, card_number: SESSION.user.card_number }).then(res => { -// setUserProfile(res) -// }) -// } - -// const load = async () => { -// const SESSION = await DB.session() -// const USERPROFILE = await DB.profile() -// const isGuest = await DB.get('is_guest') - -// if(isGuest == 'true'){ -// loadIsGuest() -// return -// } - -// try{ -// await setsession(SESSION) -// await setUserProfile(USERPROFILE) -// props.saveWhatshot({ token: SESSION.token, lcard_uuid: `lcard_uuid=${SESSION.user.lcard_uuid}` }).then(res => { -// setwhatsHot(res) -// }) -// props.savePromos({ token: SESSION.token, lcard_uuid: `lcard_uuid=${SESSION.user.lcard_uuid}` }).then(res => { -// setpromos(res) -// }) - -// Geolocation.getCurrentPosition( -// info => { -// REQUEST("promo_gps", "post", { -// Authorization: SESSION.token -// }, {}, { -// lcard_uuid: SESSION.user.lcard_uuid, -// longitude: info.coords.longitude, -// latitude: info.coords.latitude -// }, function(res){ -// setpromogps(res.data) -// setshowpromogps(true) -// }, function(error){ -// console.log(error) -// }) -// }, -// error => console.log(error) -// ) -// await setloading(false) - -// } catch(error) { -// setloading(false) -// } -// loadNotifications() -// } - -// const loadIsGuest = async () => { -// setisGuest(true) -// setloading(false) -// await REQUEST("promos", "get", {}, {}, {}, -// function(res){ -// if(res.status == 1 && res.data.length > 0){ -// let wh = [] -// for(var x=0;x 0){ -// setpromos(res.data) -// }else{ -// console.log(res.message, res.data) -// } -// }, function(error){ -// console.log(error) -// }) -// await setUserProfile({}) -// } - -// const init = () => { -// NetInfo.netstatus(isConnected => { -// if(isConnected) { -// if(refresh) { -// load() -// setRefresh(false) -// } else { -// if(props.userinfo == undefined && props.userinfo == null) { -// loadUserProfile() -// } else { -// setUserProfile(props.userinfo) -// } -// if(props.whats_hot == undefined && props.promos == undefined) { -// load() -// } else { -// setloading(false) -// } -// } -// } else { -// setloading(false) -// Elements.nointernet2() -// } -// }) -// } - -// const onBackPress = () => { -// let listener = setInterval(() => { -// backPressDuration += 1 -// if(backPressDuration >= 15){ -// backPressCount = 0 -// backPressDuration = 0 -// clearInterval(listener) -// } -// }, 100) -// backPressCount += 1 -// console.log("Back Press Count", backPressCount, typeof backPressCount) -// if(backPressCount == 2){ -// backPressCount = 0 -// backPressDuration = 0 -// BackHandler.exitApp() -// return false -// }else{ -// ToastAndroid.show("Press back again to exit.", ToastAndroid.SHORT) -// return true -// } -// } - -// useEffect(() => { -// BackHandler.addEventListener('hardwareBackPress', onBackPress) -// return () => { -// BackHandler.removeEventListener('hardwareBackPress', onBackPress) -// } -// }, []) - -// const softLoad = async () => { -// NetInfo.fetch().then(async state => { -// console.log("Connection type", state.type); -// console.log("Is connected?", state.isConnected); -// if(state.isConnected){ -// setloading(true) -// if(isGuest == 'true'){ -// loadIsGuest() -// return -// } -// const SESSION = await DB.session() -// await REQUEST("user_profile", "get", { -// Authorization: SESSION.token, -// card_number: SESSION.user.card_number -// }, {}, {}, function(data){ -// console.log("FETCH USER PROFILE"); -// if(data.status == 1){ -// DB.updateProfile(data, function(){ -// console.log("USER PROFILE SAVED! ") -// setUserProfile(data) -// }, function(error){ -// console.log("Error saving profile", error) -// }) -// } -// setloading(false) -// }, function(error){ -// setloading(false) -// console.log(error) -// }) -// }else{ -// setloading(false) -// Elements.nointernet2() -// } -// }) -// } - -// useEffect(() => { -// init() -// console.log("LOAD DATA"); -// }, []) - - -// const loadNotifications = async () => { -// let allnotifs = await DB.get("notifications") -// let notifs = allnotifs ? JSON.parse(allnotifs) : notifications -// await setnotifications(notifs) -// } - -// useEffect(() => { -// const unsubscribe = messaging().onMessage(async remoteMessage => { -// setTimeout(async () => { -// if(Platform.OS == 'ios'){ -// let allnotifs = await DB.get("notifications") -// let notifs = allnotifs ? JSON.parse(allnotifs) : notifications -// await setnotifications(notifs) -// console.log("A new notification has recieved on home page", notifications, allnotifs) -// }else{ -// let allnotifs = await DB.get("notifications") -// let notifs = allnotifs ? JSON.parse(allnotifs) : notifications -// await setnotifications(notifs) -// console.log("A new notification has recieved on home page", notifications) -// } -// }, 300); -// }) -// return unsubscribe; -// }, []); - -// const validate = async (tkn) => { -// const SESSION = await DB.session() -// if(!SESSION.token){ -// alert("You are not logged in!"); -// setloading(false) -// props.navigation.navigate("Login") -// } -// } - -// const renderwhatsHot = ({item, index}) => { -// return ( -// -// -// ) -// } - -// const renderPromos = () => { -// return promos.map((promo, index) => { -// return ( -// { -// console.log("CLICKED!!!") -// navigate('PromoDetails', {data: promo, type: "promo", onBackPress: softLoad}); -// }} -// image={{uri: promo.image}} />) -// }) -// } - -// const renderPromoGPS = () => { -// if(!promogps || promogps.length == 0) return null -// return promogps.map((promo, i) => { -// return { -// setpromogpsindex(i) -// setshowpromogps(false) -// }} -// onOpen={() => { -// setshowpromogps(false) -// navigate('PromoDetails', {data: promo, type: "promogps", onBackPress: softLoad}); -// }} -// /> -// }) -// } - -// const renderNotifications = () => { -// return notifications.map((notif, index) => { -// return { -// let nfcopy = notifications -// nfcopy[index].visible = false -// await setnotifications([]) -// await setnotifications(nfcopy) -// await DB.set("notifications", JSON.stringify(nfcopy), (res) => console.log(res), (e) => console.log(e)) -// console.log("Close notification triggered") -// }} -// onDismiss={async () => { -// let nfcopy = notifications -// nfcopy[index].visible = false -// await setnotifications([]) -// await setnotifications(nfcopy) -// console.log("Dismissed") -// }} -// /> -// }) -// } - -// return ( -// -// -// {renderNotifications()} -// - -// {isGuest ? : null} - -// {loading && !isGuest ? : !isGuest ? -// : null } - -// { -// setRefresh(true) -// init() -// }} /> -// }> -// WHAT'S HOT? -// -// -// -// PROMOS -// -// {renderPromos()} -// -// {renderPromoGPS()} -// -// -// -// ); -// } - -// const mapStateToProps = (state) => { -// console.log(state); -// return { -// userinfo: state.appUserInfoReducer.userinfo, -// whats_hot: state.appWhatshotAndPromosReducer.whats_hot, -// promos: state.appWhatshotAndPromosReducer.promos -// } -// } - -// const mapDispatchToProps = { -// saveWhatshot, -// savePromos, -// saveUserInfo -// } - -// export default connect(mapStateToProps, mapDispatchToProps)(Home) - - - - -// export default function Home(navigation) { - -// const navigate = (screen, params) => { navigation.navigation.navigate(screen, params) } -// const [loading, setloading] = useState(true); -// const [connected, setconnection] = useState(false); -// const [infodialog, setinfodialog] = useState(true); -// const [promos, setpromos] = useState([]); -// const [promogps, setpromogps] = useState([]); -// const [showpromogps, setshowpromogps] = useState(false) -// const [promogpsindex, setpromogpsindex] = useState(null) -// const [_carousel, setcarousel] = useState(""); -// const [whatsHot, setwhatsHot] = useState([]); -// const [activeSlide, setactiveSlide] = useState(0); -// const [session, setsession] = useState(null); -// const [userProfile, setUserProfile] = useState({}); -// const [notifications, setnotifications] = useState([]); -// const [isGuest, setisGuest] = useState(false) -// var backPressCount = 0 -// var backPressDuration = 0 - -// var sampledata = {} -// // var sampledata = {"data": {"address": "", "birthdate": "January 01, 1990", "card_bg_image": "https://s3-ap-southeast-1.amazonaws.com/unioil.mobiletestbucket/mobileapp/cardTypes_bg_image/1582093000.jpg", "card_black_label": 0, "card_code": "PUVCARD", "card_image": "https://s3-ap-southeast-1.amazonaws.com/unioil.mobiletestbucket/mobileapp/cardTypes/1582093256.jpg", "card_number": "1119000000000020", "card_type": "PASADANG UNIOIL VALUE CARD", "city_name": "", "civilstatus_code": "SE", "email": "bry.rnr@gmail.com", "expiry_date": "2023-02-07", "firstname": "RNR", "fueltype_code": "0", "gender_code": "F", "lastname": "PUV", "lcard_uuid": "5fd8f34c-49ca-11ea-9ba4-02189255205c", "middlename": "", "mobile": "639957951241", "photo": "https://s3-ap-southeast-1.amazonaws.com/unioil.mobiletestbucket/mobileapp/memberPhoto/1581094497.jpg", "pin": "03444748", "points": 1600, "vo_code": "0"}, "message": "Success", "retrieved": {"address": "", "card_number": "1119000000000020", "card_type_code": "PUVCARD", "card_type_desc": "PASADANG UNIOIL VALUE CARD", "civil_status_code": "SE", "civil_status_desc": "SEPARATED", "email": "bry.rnr@gmail.com", "first_name": "RNR", "fuel_type_code": "0", "fuel_type_desc": "NO DATA ENTERED", "gender_code": "F", "gender_desc": "FEMALE", "is_bdo": "0", "is_caltex": "0", "is_cebupacific": "0", "is_flyingv": "0", "is_happy": "0", "is_jetti": "0", "is_mabuhay": "0", "is_mercury": "0", "is_national": "0", "is_petron": "0", "is_petronv": "0", "is_phoenix": "0", "is_ptt": "0", "is_robinson": "0", "is_s&r": "0", "is_seaoil": "0", "is_shell": "0", "is_sm": "0", "is_starbucks": "0", "is_total": "0", "last_name": "PUV", "middle_initial": "", "mobile": "639957951241", "number_cars": "0", "occupation": "0", "vehicle_own_code": "0", "vehicle_own_desc": "NO DATA ENTERED"}, "status": 1} - -// // async function requestUserPermission() { -// // const authStatus = await messaging().requestPermission(); - -// // if (authStatus) { -// // console.log('Permission status:', authStatus); -// // } -// // // const enabled = -// // // authStatus === AuthorizationStatus.AUTHORIZED || authStatus === AuthorizationStatus.PROVISIONAL; - -// // // if (enabled) { -// // // console.log('Firebase Notification Authorization status:', authStatus); -// // // } -// // } - -// const load = async () => { - -// const SESSION = await DB.session() -// const USERPROFILE = await DB.profile() -// const isGuest = await DB.get('is_guest') - -// if(isGuest == 'true'){ -// loadIsGuest() -// return -// } - -// try{ - -// setloading(true) -// await setsession(SESSION) -// await setUserProfile(USERPROFILE) -// // await validate() -// await REQUEST("user_profile", "get", { -// Authorization: SESSION.token, -// card_number: SESSION.user.card_number -// }, {}, {}, function(data){ -// console.log("FETCH USER PROFILE"); -// if(data.status == 1){ -// DB.updateProfile(data, function(){ -// console.log("USER PROFILE SAVED! ", data) -// setUserProfile(data) -// }, function(error){ -// console.log("Error saving profile", error) -// }) -// } -// }, function(error){ -// console.log(error) -// }) -// await REQUEST("whats_hot", "get", { -// Authorization: SESSION.token, -// }, `lcard_uuid=${SESSION.user.lcard_uuid}`, {}, -// function(res){ -// if(res.status == 1 && res.data.length > 0){ -// let wh = [] -// for(var x=0;x 0){ -// setpromos(res.data) -// }else{ -// console.log(res.message, res.data) -// } -// }, function(error){ -// console.log(error) -// }) -// Geolocation.getCurrentPosition( -// info => { -// REQUEST("promo_gps", "post", { -// Authorization: SESSION.token -// }, {}, { -// lcard_uuid: SESSION.user.lcard_uuid, -// longitude: info.coords.longitude, -// latitude: info.coords.latitude -// }, function(res){ -// setpromogps(res.data) -// setshowpromogps(true) -// }, function(error){ -// console.log(error) -// }) -// }, -// error => { -// console.log(error) -// } -// ) -// await setloading(false) - -// }catch(error){ -// console.log(error) -// setloading(false) -// } - -// loadNotifications() - -// } - -// const loadIsGuest = async () => { -// setisGuest(true) -// setloading(false) -// await REQUEST("promos", "get", {}, {}, {}, -// function(res){ -// if(res.status == 1 && res.data.length > 0){ -// let wh = [] -// for(var x=0;x 0){ -// setpromos(res.data) -// }else{ -// console.log(res.message, res.data) -// } -// }, function(error){ -// console.log(error) -// }) -// await setUserProfile({}) -// } - -// const init = () => { -// NetInfo.fetch().then(state => { -// console.log("Connection type", state.type); -// console.log("Is connected?", state.isConnected); -// if(state.isConnected){ -// load() -// }else{ -// setloading(false) -// Elements.nointernet2() -// } -// }); -// } - -// const onBackPress = () => { -// let listener = setInterval(() => { -// backPressDuration += 1 -// if(backPressDuration >= 15){ -// backPressCount = 0 -// backPressDuration = 0 -// clearInterval(listener) -// } -// }, 100) -// backPressCount += 1 -// console.log("Back Press Count", backPressCount, typeof backPressCount) -// if(backPressCount == 2){ -// backPressCount = 0 -// backPressDuration = 0 -// BackHandler.exitApp() -// return false -// }else{ -// ToastAndroid.show("Press back again to exit.", ToastAndroid.SHORT) -// return true -// } -// } - -// useEffect(() => { -// BackHandler.addEventListener('hardwareBackPress', onBackPress) -// return () => { -// BackHandler.removeEventListener('hardwareBackPress', onBackPress) -// } -// }, []) - -// const softLoad = async () => { -// NetInfo.fetch().then(async state => { -// console.log("Connection type", state.type); -// console.log("Is connected?", state.isConnected); -// if(state.isConnected){ -// setloading(true) -// if(isGuest == 'true'){ -// loadIsGuest() -// return -// } -// const SESSION = await DB.session() -// await REQUEST("user_profile", "get", { -// Authorization: SESSION.token, -// card_number: SESSION.user.card_number -// }, {}, {}, function(data){ -// console.log("FETCH USER PROFILE"); -// if(data.status == 1){ -// DB.updateProfile(data, function(){ -// console.log("USER PROFILE SAVED! ") -// setUserProfile(data) -// }, function(error){ -// console.log("Error saving profile", error) -// }) -// } -// setloading(false) -// }, function(error){ -// setloading(false) -// console.log(error) -// }) -// }else{ -// setloading(false) -// Elements.nointernet2() -// } -// }) -// } - -// useEffect(() => { -// init() -// console.log("LOAD DATA"); -// }, []) - - -// const loadNotifications = async () => { - -// //RESET NOTIFICATIONS -// // await DB.remove("notifications") - -// let allnotifs = await DB.get("notifications") -// let notifs = allnotifs ? JSON.parse(allnotifs) : notifications -// await setnotifications(notifs) -// // console.log("Notifications", notifs) -// } - -// useEffect(() => { -// const unsubscribe = messaging().onMessage(async remoteMessage => { -// setTimeout(async () => { -// if(Platform.OS == 'ios'){ -// let allnotifs = await DB.get("notifications") -// let notifs = allnotifs ? JSON.parse(allnotifs) : notifications -// await setnotifications(notifs) -// console.log("A new notification has recieved on home page", notifications, allnotifs) -// }else{ -// let allnotifs = await DB.get("notifications") -// let notifs = allnotifs ? JSON.parse(allnotifs) : notifications -// await setnotifications(notifs) -// console.log("A new notification has recieved on home page", notifications) -// } -// }, 300); -// }) -// return unsubscribe; -// }, []); - -// const validate = async (tkn) => { -// const SESSION = await DB.session() -// if(!SESSION.token){ -// alert("You are not logged in!"); -// setloading(false) -// navigation.navigation.navigate("Login") -// } -// } - -// const renderwhatsHot = ({item, index}) => { -// return ( -// -// -// ) -// } - -// const renderPromos = () => { -// return promos.map((promo, index) => { -// return ( -// { -// console.log("CLICKED!!!") -// navigate('PromoDetails', {data: promo, type: "promo", onBackPress: softLoad}); -// }} -// image={{uri: promo.image}} />) -// }) -// } - -// const renderPromoGPS = () => { -// if(!promogps || promogps.length == 0) return null -// return promogps.map((promo, i) => { -// return { -// setpromogpsindex(i) -// setshowpromogps(false) -// }} -// onOpen={() => { -// setshowpromogps(false) -// navigate('PromoDetails', {data: promo, type: "promogps", onBackPress: softLoad}); -// }} -// /> -// }) -// } - -// const renderNotifications = () => { -// return notifications.map((notif, index) => { -// return { -// let nfcopy = notifications -// nfcopy[index].visible = false -// await setnotifications([]) -// await setnotifications(nfcopy) -// await DB.set("notifications", JSON.stringify(nfcopy), (res) => console.log(res), (e) => console.log(e)) -// console.log("Close notification triggered") -// // console.log("tried to close notification", notifications) -// }} -// onDismiss={async () => { -// let nfcopy = notifications -// nfcopy[index].visible = false -// await setnotifications([]) -// await setnotifications(nfcopy) -// console.log("Dismissed") -// }} -// /> -// }) -// } - -// return ( -// -// -// {renderNotifications()} -// - -// {isGuest ? : null} - -// {loading && !isGuest ? : !isGuest ? -// : null } - -// -// }> -// WHAT'S HOT? -// -// -// -// PROMOS -// -// {renderPromos()} -// -// {renderPromoGPS()} -// -// -// -// ); -// } - -// // useEffect(() => { -// // setnotifications([{ -// // title: "Unioil", -// // body: "Welcome to Unioil Loyalty App", -// // visible: true -// // },{ -// // title: "Membership", -// // body: "Redeem points and use your points to buy our products", -// // visible: true -// // }]) -// // }, []) - -// /* -// // await setpromos([ -// // { -// // title: 'Dixie Ganda', -// // image: Assets.test.dixie[Math.floor(Math.random() * Assets.test.dixie.length - 1)], -// // description: 'asd asd' -// // }, -// // { -// // title: 'Ganda Dixie', -// // image: Assets.test.dixie[Math.floor(Math.random() * Assets.test.dixie.length - 1)], -// // description: 'asd asdasdasd' -// // } -// // ]) -// // await setwhatsHot([ -// // { -// // title: 'Dixie Ganda', -// // image: Assets.test.zuvapit[Math.floor(Math.random() * Assets.test.zuvapit.length - 1)], -// // description: 'asd asd' -// // }, -// // { -// // title: 'Ganda Dixie', -// // image: Assets.test.mina[Math.floor(Math.random() * Assets.test.mina.length - 1)], -// // description: 'asd asdasdasd' -// // }, -// // { -// // title: 'Ganda Dixie', -// // image: Assets.test.zuvapit[Math.floor(Math.random() * Assets.test.zuvapit.length - 1)], -// // description: 'asd asdasdasd' -// // }, -// // { -// // title: 'Ganda Dixie', -// // image: Assets.test.mina[Math.floor(Math.random() * Assets.test.mina.length - 1)], -// // description: 'asd asdasdasd' -// // } -// // ]) - -// {/* { -// navigate('PromoDetails', promos[0]); -// }} -// image={promos[0]?.image || Assets.dixie} /> - -// { -// navigate('PromoDetails', promos[1]); -// }} -// image={promos[1]?.image || Assets.dixie} /> } - -// */ \ No newline at end of file +export default connect(mapStateToProps, mapDispatchToProps)(Home) \ No newline at end of file diff --git a/app/screens/main/rewards.js b/app/screens/main/rewards.js index a4789551..8e603653 100644 --- a/app/screens/main/rewards.js +++ b/app/screens/main/rewards.js @@ -70,7 +70,7 @@ class Rewards extends React.Component { } } - render = () => { + toRender = () => { if(!this.state.connection){ return ( - + { !this.state.guest ? - {this.render()} + {this.toRender()} : @@ -157,141 +161,4 @@ export const styles = StyleSheet.create({ alignItems: 'center', textAlign: 'center', } -}) - -// export default function Rewards(navigation) { - -// const [data, setdata] = useState("") -// const [connection, setconnection] = useState(false) -// const netInfo = useNetInfo(); -// const [guest, setGuest] = useState(false) - -// const init = async () => { -// let isGuest = await DB.get("is_guest"); -// setGuest(isGuest) -// setconnection(true) -// const SESSION = await DB.session() -// try{ -// await REQUEST("shared_treats", "get", { -// Authorization: SESSION.token -// }, {}, {}, -// async (res) => { -// if(res.status == 1 && res.data){ -// await setdata(await res.data) -// }else{ -// console.log(res.message, res.data) -// } -// }, function(error){ -// console.log(error) -// } -// ) -// }catch(error){ -// console.log(error) -// } -// } - -// const styles = StyleSheet.create({ -// enrollBtn: { -// backgroundColor: '#e74610', -// height: Theme.screen.h / 19, -// marginHorizontal: 15, -// borderRadius: 10, -// alignItems: 'center', -// justifyContent: 'center', -// marginVertical: 15, -// paddingHorizontal: 15, -// elevation: 2 -// }, -// enrollBtnTxt: { -// textAlign: 'center', -// alignItems: 'center', -// color: '#fff', -// fontWeight: '600', -// fontSize: 14 -// }, -// viewStyle: { -// height: Theme.screen.h, -// flex: 1, -// flexDirection: 'row', -// justifyContent: 'center' -// }, -// viewStyle1: { -// justifyContent: 'center', -// alignItems: 'center', -// textAlign: 'center', -// } -// }) - -// useEffect(() => { -// NetInfo.fetch().then(state => { -// console.log("Connection type", state.type); -// console.log("Is connected?", state.isConnected); -// if(state.isConnected){ - -// // Alert.alert("System Advisory", "We're working on more exciting rewards for you! Redemption of points will be temporarily unavailable. A notification will be sent once this feature has been restored. \nWe apologize for the inconvenience."); -// init() - -// }else{ -// Elements.nointernet2() -// } -// }); -// }, []) - -// console.log(data.site) - -// const render = () => { -// if(!connection){ -// return ( -// { -// NetInfo.fetch().then(state => { -// console.log("Connection type", state.type); -// console.log("Is connected?", state.isConnected); -// if(state.isConnected){ -// init() -// }else{ -// Elements.nointernet2() -// } -// }) -// }} -// /> -// ) -// } -// return ( -// ) -// } - -// return ( -// -// -// { -// !guest ? -// -// {render()} -// -// : -// -// -// -// You won't be able to access some of the pages unless you will enroll your card or login. -// -// { navigation.navigation.navigate('Login') }}> -// Enroll Card -// -// -// -// } -// -// ); -// } \ No newline at end of file +}) \ No newline at end of file diff --git a/app/screens/myprofile/profile/edit.js b/app/screens/myprofile/profile/edit.js index 0c1ab423..2d2422e5 100644 --- a/app/screens/myprofile/profile/edit.js +++ b/app/screens/myprofile/profile/edit.js @@ -3,7 +3,6 @@ import { SafeAreaView, ScrollView, TouchableOpacity, View, Text, Alert } from 'r import { Avatar } from 'react-native-elements'; import { connect } from "react-redux"; import { saveUserInfo, savePlainUserInfo } from "../../../redux/actions/AppUserInfoActions"; -import { StackActions } from '@react-navigation/native'; import CustomHeader from '../../../components/header.js'; import Assets from '../../../components/assets.manager.js'; import Theme from '../../../components/theme.style.js'; @@ -25,6 +24,7 @@ class EditProfile extends React.PureComponent { } state = { + openModal: false, loading: false, userProfile: null, focused: false, @@ -150,7 +150,13 @@ class EditProfile extends React.PureComponent { } if(!this.state.fuelType && this.state.userProfile.fueltype_code == "0"){ res = Object.assign(this.state.errors, {fuelType : ["This field is required"]}) - } + } + if(this.state.maritalStatus === null) { + res = Object.assign(this.state.errors, {maritalStatus : ["This field is required"]}) + } + if(this.state.gender === null) { + res = Object.assign(this.state.errors, {gender : ["This field is required"]}) + } this.setState({ errors: res, loading: false }) return Object.keys(this.state.errors).length > 0 ? false : true } @@ -301,10 +307,7 @@ class EditProfile extends React.PureComponent { } else { this.responseHandler(success, handler => { this.props.route.params.onGoBack(success.data); - this.props.navigation.dispatch({ - routName: "MenuTab", - type: "GoToRoute" - }); + this.props.navigation.pop(2); }) } }, error => { @@ -329,28 +332,18 @@ class EditProfile extends React.PureComponent { }) } - onSubmit = () => { - this.setState({ focused: false }) + onSubmit = async () => { + this.setState({ focused: false, openModal: false }) if(this.hasChanges()){ - Alert.alert( - "Update Profile", - '\nAre you sure you want to save changes to your profile?\n', - [{ - text: 'Cancel', - style: 'cancel', - },{ - text: 'OK', onPress: async () => { - let validation = await this.FormValidate() - if(!validation) return - if(this.state.newmobile != "" && this.state.newmobile.replace("+", "") != this.state.userProfile.mobile){ - this.SaveWithOtp() - }else{ - this.SaveNoOtp() - } - } - }], - {cancelable: true} - ); + let validation = await this.FormValidate(); + + if(!validation) return + + if(this.state.newmobile != "" && this.state.newmobile.replace("+", "") != this.state.userProfile.mobile){ + this.SaveWithOtp() + }else{ + this.SaveNoOtp() + } }else{ this.props.navigation.goBack() } @@ -384,6 +377,7 @@ class EditProfile extends React.PureComponent { render() { return ( + <> { this.onInputFocus(9) this.onSelectPress(3) + delete this.state.errors["maritalStatus"] }} - error={"This field is required"} /> + hasError={this.state.errors && this.state.errors.maritalStatus ? true : false} + errorMessage={"This field is required"} /> { this.onInputFocus(10) this.onSelectPress(4) + delete this.state.errors["gender"] }} - error={"This field is required"} /> + hasError={this.state.errors && this.state.errors.gender ? true : false} + errorMessage={"This field is required"} /> - this.onSubmit()} style={{width: '92%', padding: 15, borderRadius: 10, backgroundColor: Theme.colors.primary}}> + this.setState({ openModal: true })} style={{width: '92%', padding: 15, borderRadius: 10, backgroundColor: Theme.colors.primary}}> Save Changes + this.setState({ openModal: false })} + yesCB={this.onSubmit} + /> + ) } } @@ -654,501 +660,4 @@ const mapDispatchToProps = { saveUserInfo } -export default connect(mapStateToProps, mapDispatchToProps)(EditProfile) - - -// export default function EditProfile(navigation) { - -// const [loading, setloading] = useState(false) -// const [userProfile, setUserProfile] = useState(null) -// const [focused, setfocused] = useState(false); -// const [editprofileselect, seteditprofileselect] = useState(false) -// const [customerserviceselect, setcustomerserviceselect] = useState(false) -// const [currentFocus, setCurrentFocus] = useState(null); - -// const [opendialog, setopendialog] = useState(false); -// const [currentDialog, setCurrentDialog] = useState(null); - -// const [currentphoto, setcurrentphoto] = useState(null) -// const [newphoto, setnewphoto]= useState(null) -// const [newmobile, setnewmobile]= useState("") -// const [newemail, setnewemail]= useState(null) -// const [newaddress, setnewaddress]= useState(null) -// const [newcity, setnewcity]= useState(null) - -// const [vehicleType, setVehicleTyle] = useState(null); -// const [fuelType, setFuelType] = useState(null); -// const [maritalStatus, setMaritalStatus] = useState(null); -// const [gender, setGender] = useState(null); -// const [is_deleted, setdeleted] = useState(false); - -// const [errors, seterrors] = useState({}); - - -// useEffect(() => { -// // navigation.route.params.data.photo = '' -// setloading(true) -// setUserProfile(navigation.route?.params.data) -// setloading(false) -// console.log("PROFILE", navigation.route?.params.data) -// }, []) - -// const onInputFocus = (index) => { -// setfocused(true) -// setCurrentFocus(index) -// } -// const onSelectPress = (index) => { -// setopendialog(true) -// setCurrentDialog(index) -// } - -// const getFT = (type) => { -// let types = Assets.fueltypes -// for(var x=0;x { -// let types = Assets.vehicletypes -// for(var x=0;x { -// let types = Assets.civilstatus -// for(var x=0;x { -// let types = Assets.gender -// for(var x=0;x { - -// } - -// const onDeletePhoto = () => { -// setdeleted(true) -// setcurrentphoto(Assets.logo.profileHolder) -// } - -// const onEditPhoto = () => { -// ImagePicker.launchImageLibrary({}, (response) => { -// // let b64 = response.data -// // response.data = '' -// if(!response.didCancel){ -// if(is_deleted){ -// setdeleted(false) -// setcurrentphoto(null) -// } -// setnewphoto(response) -// } -// // console.log(response) -// }); -// } - -// const FormValidate = async () => { -// let res = {} -// setloading(true) -// if(newemail == ""){ -// res = Object.assign(errors, {email: ["This field is required"]}) -// } -// if(newaddress == "" || newaddress == null && userProfile.address == ""){ -// // seterrors(Object.assign(errors, {address: ["This field is required"]})) -// res = Object.assign(errors, {address: ["This field is required"]}) -// } -// if(!vehicleType && userProfile.vo_code == "0"){ -// // seterrors(Object.assign(errors, {vehicleType: ["This field is required"]})) -// res = Object.assign(errors, {vehicleType: ["This field is required"]}) -// } -// if(!fuelType && userProfile.fueltype_code == "0"){ -// // seterrors(Object.assign(errors, {fuelType : ["This field is required"]})) -// res = Object.assign(errors, {fuelType : ["This field is required"]}) -// } -// seterrors(res) -// setloading(false) -// return Object.keys(errors).length > 0 ? false : true -// } - -// const Body = function(){ -// return { -// image: newphoto ? newphoto.uri : null, -// mobile: newmobile, -// email: newemail, -// address: newaddress, -// city: newcity, -// vo_code: vehicleType ? vehicleType.value : null, -// fueltype_code: fuelType ? fuelType.value : null, -// civilstatus_code: maritalStatus ? maritalStatus.value : null, -// gender_code: gender ? gender.value : null, -// is_deleted: is_deleted -// } -// } - -// const SaveNoOtp = async () => { - -// let SESSION = await DB.session() -// if(newphoto){ -// // console.log("BLOB BODY", blobBody.image.uri) -// setloading(true) -// RNFETCHBLOB("update_profile_no_otp", "POST", -// {Authorization: SESSION.token}, {}, Utils.blobBody({newphoto, userProfile, newmobile, newemail, newaddress, newcity, vehicleType, fuelType, maritalStatus, gender, is_deleted}), -// function(res){ -// console.log(res) -// setloading(false) -// Utils.responseHandler(res, () => { -// navigation.route.params.onGoBack() -// navigation.navigation.goBack() -// }, (errors) => { -// seterrors(errors) -// }) -// }, function(err){ -// setloading(false) -// setTimeout(() => { -// if(newphoto) Alert.alert("Error", "Failed to upload image") -// }, 300) -// }) - -// }else{ -// setloading(true) -// await REQUEST("update_profile_no_otp", "post", { -// Authorization: SESSION.token, -// "Content-Type": "multipart/form-data", -// }, {}, Utils.formData({userProfile, newmobile, newemail, newaddress, newcity, vehicleType, fuelType, maritalStatus, gender, is_deleted}), -// function(res){ -// setloading(false) -// console.log("Update Res", res) -// Utils.responseHandler(res, () => { -// navigation.route.params.onGoBack() -// navigation.navigation.goBack() -// }, (errors) => { -// seterrors(errors) -// }) -// }, function(error){ -// console.log("Failed", error) -// setloading(false) -// setTimeout(() => { -// if(newphoto) Alert.alert("Error", "Failed to upload image") -// }, 300) -// }) -// } - -// } - -// const SaveWithOtp = () => { - -// navigation.navigation.navigate("AccountSendOtp", { -// data: { -// lcard_uuid: userProfile.lcard_uuid, -// mobile_number: newmobile.replace("+", "") -// }, -// type: 'edit', -// callback: (res) => { -// if(res == "valid") SaveNoOtp() -// }, -// }) -// } - -// const onSubmit = () => { -// setfocused(false) -// if(hasChanges()){ -// Alert.alert( -// "Update Profile", -// '\nAre you sure you want to save changes to your profile?\n', -// [{ -// text: 'Cancel', -// style: 'cancel', -// },{ -// text: 'OK', onPress: async () => { -// let validation = await FormValidate() -// if(!validation) return -// if(newmobile != "" && newmobile.replace("+", "") != userProfile.mobile){ -// SaveWithOtp() -// }else{ -// SaveNoOtp() -// } -// } -// }], -// {cancelable: true} -// ); -// }else{ -// navigation.navigation.goBack() -// } -// } - -// const hasChanges = () => { -// let values = Object.values(Body()) -// for(var x=0;x { -// Elements.ActionOption({ -// options: ['Edit Photo', 'Delete Photo', 'Cancel'], -// functions: [{ -// execute: () => onEditPhoto() -// }, { -// execute: () => onDeletePhoto() -// }] -// }) -// } - -// const renderProfilePhoto = () => { -// if(currentphoto) return Assets.logo.profileHolder -// else if(!currentphoto && newphoto || newphoto) return {uri: newphoto.uri} -// else if(!currentphoto && !newphoto && userProfile && userProfile.photo) return {uri: userProfile.photo} -// else return Assets.logo.profileHolder -// } - -// return ( -// -// -// setopendialog(!opendialog)} -// onSelect={(value, string) => { -// setVehicleTyle({ -// value: value, -// string: string -// }) -// setopendialog(!opendialog) -// }} -// items={Assets.vehicletypes} -// /> -// setopendialog(!opendialog)} -// onSelect={(value, string) => { -// setFuelType({ -// value: value, -// string: string -// }) -// setopendialog(!opendialog) -// }} -// items={Assets.fueltypes} -// /> -// setopendialog(!opendialog)} -// onSelect={(value, string) => { -// setMaritalStatus({ -// value: value, -// string: string -// }) -// setopendialog(!opendialog) -// }} -// items={Assets.civilstatus} -// /> -// setopendialog(!opendialog)} -// onSelect={(value, string) => { -// setGender({ -// value: value, -// string: string -// }) -// setopendialog(!opendialog) -// }} -// items={Assets.gender} -// /> - -// { -// if(hasChanges()){ -// Alert.alert( -// null, -// 'You have an unsaved profile information, are you sure you want to navigate back?\n', -// [{ -// text: 'Cancel', -// style: 'cancel', -// }, -// { -// text: 'OK', onPress: () => navigation.navigation.navigate("MyProfile") -// }, -// ], -// {cancelable: true} -// ); -// }else{ -// navigation.navigation.navigate("MyProfile") -// } -// }} -// navigation={navigation} -// /> - -// - -// -// -// {/* */} -// -// -// -// {userProfile && userProfile.photo && !is_deleted || userProfile && !userProfile.photo && newphoto && !is_deleted ? -// -// Edit Photo -// : -// onEditPhoto()}> -// Add Photo -// -// } -// -// -// -// -// - -// - -// - -// { -// setnewmobile(value) -// console.log(value) -// }} -// focused={focused && currentFocus == 3 ? true : false} -// onFocus={() => onInputFocus(3)} -// error={"This field is required"} /> - -// onInputFocus(4)} -// onChangeText={(value) => { -// setnewemail(value) -// delete errors["email"] -// }} -// hasError={errors && errors.email ? true : false} -// errorMessage={errors && errors.email ? errors.email[0] : "Invalid email"} -// /> - -// onInputFocus(5)} -// onChangeText={(value) => { -// setnewaddress(value) -// delete errors["address"] -// }} -// hasError={errors && errors.address ? true : false} -// errorMessage={errors && errors.address ? errors.address[0] : "Invalid address"} -// /> - -// {/* onInputFocus(6)} -// onChangeText={(value) => setnewcity(value)} -// error={"This field is required"} /> */} - -// { -// onInputFocus(7) -// onSelectPress(1) -// delete errors["vehicleType"] -// }} -// hasError={errors && errors.vehicleType ? true : false} -// errorMessage={errors && errors.vehicleType ? errors.vehicleType[0] : "Invalid vehicle type"} -// /> - -// { -// onInputFocus(8) -// onSelectPress(2) -// delete errors["fuelType"] -// }} -// hasError={errors && errors.fuelType ? true : false} -// errorMessage={errors && errors.fuelType ? errors.fuelType[0] : "Invalid fuel type"} -// /> - -// { -// onInputFocus(9) -// onSelectPress(3) -// }} -// error={"This field is required"} /> - -// { -// onInputFocus(10) -// onSelectPress(4) -// }} -// error={"This field is required"} /> - -// -// -// -// -// Save Changes -// -// -// -// -// ); -// } \ No newline at end of file +export default connect(mapStateToProps, mapDispatchToProps)(EditProfile); diff --git a/app/screens/route.js b/app/screens/route.js index e35df087..a8f1af38 100644 --- a/app/screens/route.js +++ b/app/screens/route.js @@ -14,7 +14,7 @@ import Theme from '../components/theme.style.js'; import Notch from '../components/notch.js'; import REQUEST from '../components/api'; -import MainMenu from './main/'; +import MainMenu from './main/drawer.js'; import Login from './login/'; import Splash from './splash/'; diff --git a/app/screens/topup/form.js b/app/screens/topup/form.js index 5b271d73..5553d425 100644 --- a/app/screens/topup/form.js +++ b/app/screens/topup/form.js @@ -128,7 +128,7 @@ class TokenizationForm extends React.Component { let addedCard = await Tokenization.initNewAddCard(this.props.customerId, merchant) if(addedCard.status == 'failed') { this.setState({ loading: false, isVisibleModal: false }) - let message = addedCard?.result?.merchant?.parameters != undefined ? addedCard?.result?.merchant?.parameters[0].description : checkout?.card != undefined ? checkout?.card.parameters[0].description : "Invalid card" + let message = addedCard?.result?.merchant?.parameters != undefined ? addedCard?.result?.merchant?.parameters[0].description : addedCard?.card != undefined ? addedCard?.card.parameters[0].description : "Invalid card" Platform.OS == 'ios' ? setTimeout(() => { Alert.alert("Top Up", message) }, 800) : Alert.alert("Top Up", message) @@ -276,154 +276,4 @@ const mapStateToProps = (state) => { } } -export default connect(mapStateToProps, null)(TokenizationForm) - -// export default function TokenizerForm(props){ -// let { -// isVisible, -// onGoBack, -// amount, -// onSuccess, -// } = props; -// const [loading, setloading] = useState(false) - -// const onCreateVault = async (card) => { - -// setloading(true) -// let merchant = await UTILS.createMerchantDetails() -// merchant.card = {card: {name: card.name, number: card.credit_card, expMonth: card.expmonth, expYear: card.expyear, cvc: card.cvv}} -// console.log(merchant) - -// let checkout = await Tokenization.initCheckOut("", "", merchant, amount) -// if(checkout.status == 'failed'){ - -// if(checkout.result.merchant.parameters){ -// Platform.OS == 'ios' ? setTimeout(() => { -// Alert.alert("Top Up", "\nUpdate your profile first before using this feature.") -// }, 300) : Alert.alert("Top Up", "\nUpdate your profile first before using this feature.") -// } - -// // alert(JSON.stringify(checkout.result, null, '\t')) -// console.log("RESULT CARD", checkout.result.card) -// console.log("RESULT MERCHANT", checkout.result.merchant) -// setloading(false) -// }else if(checkout.status == 'success'){ -// console.log("RESULT", checkout) -// setloading(false) -// onGoBack(); -// onSuccess({ -// amount: amount, -// data: {redirectUrl: checkout.verificationUrl, card_number: checkout.card_number, type: 'create'}, -// // onBack: (res, msg) => props.route.params.onReload(res, msg) -// onBack: (res, msg) => alert(msg) -// }); -// } - -// setloading(false) -// props.onGoBack() - -// // let client = {} -// // client.card = { -// // card: { -// // number: card.card_number, -// // expMonth: card.expmonth, -// // expYear: card.expyear, -// // cvc: card.cvv -// // } -// // } - -// } - -// const onAddVault = async (card) => { -// setloading(true) -// let ccard = {card: {name: card.name, number: card.credit_card, expMonth: card.expmonth, expYear: card.expyear, cvc: card.cvv}} -// let checkout = await Tokenization.initAdd(ccard, props.customerId) -// if(checkout.status == 'failed'){ -// setTimeout(() => { -// alert(JSON.stringify(checkout, null, '\t')) -// }, 700) -// console.log("RESULT CARD", checkout) -// setloading(false) -// }else if(checkout.status == 'success'){ -// console.log("RESULT", checkout.link.maskedPan) -// console.log("CUST ID", props.customerId) - -// if(checkout.link.code){ -// console.log(props.customerId) -// }else{ -// onSuccess({ -// amount: amount, -// data: {redirectUrl: checkout.link.verificationUrl, card_number: checkout.link.maskedPan, type: 'add'}, -// // onBack: (res, msg) => props.route.params.onReload(res, msg) -// onBack: (res, msg) => { -// Platform.OS == 'ios' ? setTimeout(() => { -// Alert.alert( -// 'Add Card', -// `\nYour new credit card has successfully added to your account.`, -// [ -// { -// text: "OK", -// onPress: async () => { -// await props.onDone() -// } -// }, -// ] -// ) -// }, 700) : -// null -// } -// }); -// } -// } - -// setloading(false) -// props.onGoBack() -// } - -// const handleJustu = async (card) => { -// if(props.type == "create"){ -// Platform.OS == 'ios' ? setTimeout(() => { -// Alert.alert( -// 'Confirm Top Up', -// `\nYour credit card will be used to pay ${parseFloat(props.amount).toFixed(2)} points.`, -// [ -// { -// text: "NO", -// style: "cancel" -// }, -// { -// text: "YES", -// onPress: () => { -// onCreateVault(card) -// } -// }, -// ] -// ) -// }, 700) : -// null -// }else if(props.type == 'add'){ -// onAddVault(card) -// } -// } - -// return ( -// -// -// -// -// -//
-// -// -// -// ) -// } \ No newline at end of file +export default connect(mapStateToProps, null)(TokenizationForm); diff --git a/app/screens/topup/index.js b/app/screens/topup/index.js index f82826e9..750b8cb1 100644 --- a/app/screens/topup/index.js +++ b/app/screens/topup/index.js @@ -342,7 +342,6 @@ class TopUp extends React.Component { } render() { - if(!this.state.connected){ return ( @@ -418,7 +417,7 @@ class TopUp extends React.Component { - {this.state.creditcards.length > 0 ? + {/* {this.state.creditcards.length > 0 ? @@ -442,7 +441,7 @@ class TopUp extends React.Component { - } + } */} {this.state.creditcards.length <= 5 && ( this.initAddCard()} style={{flexDirection: 'row', alignItems: 'center', padding: 15, borderBottomWidth: 0.5, borderColor: 'lightgray'}}> @@ -453,7 +452,7 @@ class TopUp extends React.Component { )} - {this.state.creditcards.length > 0 && this.state.creditcards.map((card, index) => { + {/* {this.state.creditcards.length > 0 && this.state.creditcards.map((card, index) => { return ( @@ -487,7 +486,7 @@ class TopUp extends React.Component { ) - })} + })} */} {this.state.topupCount >= 5 ? null : @@ -515,494 +514,4 @@ const mapDispatchToProps = { saveUserInfo } -export default connect(mapStateToProps, mapDispatchToProps)(TopUp) - -// export default function TopUp(navigation) { - -// const [connected, setconnected] = useState(false); -// const [isCardFormVisible, setCardFormVisibility] = useState(false); -// const [loading, setloading] = useState(false); -// const [popup, setpopup] = useState(false); -// const [Task, setTask] = useState(""); -// const [DisplayAmount, setDisplayAmount] = useState(""); -// const [amount, setAmount] = useState(0); -// const [focused, setfocused] = useState(false); -// const [checkoutResult, setCheckOutResult] = useState(""); -// const [userProfile, setUserProfile] = useState(null); -// const [topupCount, setTopupCount] = useState(0); -// const [merchant, setmerchant] = useState({}); -// const [creditcards, setcreditcards] = useState([]); -// const [activeIndex, setActiveIndex] = useState(0); - -// const init = async () => { -// setconnected(true) -// setloading(true) -// await countTransactions() -// let User = await DB.profile() -// let ses = await DB.session() -// console.log("tkn", ses.token) -// await getMerchant() -// await setUserProfile(User) -// setloading(false) -// } - -// const countTransactions = async () => { -// const SESSION = await DB.session() -// const USERPROFILE = await DB.profile() -// await REQUEST("transactions", "get", { -// Authorization: SESSION.token, -// card_number: SESSION.user.card_number -// }, {}, {}, function(res){ -// let count = 0 -// if(res.data.length > 0){ -// for(var x=0;x 5){ -// setloading(false) -// Platform.OS == 'ios' ? setTimeout(() => { -// Alert.alert("Top Up", "\nYou have reached your maximum top up for this day.") -// }, 700) -// : -// Alert.alert("Top Up", "\nYou have reached your maximum top up for this day.") -// } -// }, function(error){ -// console.log(error) -// }) -// } - -// const handleDelete = (id, token, uuid) => { -// Alert.alert( -// "Delete Payment Card", -// "Are you sure you want to delete this card?", -// [ -// { -// text: "NO", -// style: "cancel" -// }, -// { -// text: "YES", -// onPress: () => { -// setloading(true) -// Tokenization.initRemove(id, token, uuid).then((res) => { -// setloading(false) -// if(res.result == 'OK'){ -// Platform.OS == 'ios' ? -// setTimeout(() => { -// Alert.alert("Deleted Successfully", "\nYour credit card has successfully deleted.", [{text: "OK", onPress: async () => await init()}]) -// }, 700) -// : -// Alert.alert("Deleted Successfully", "\nYour credit card has successfully deleted.", [{text: "OK", onPress: async () => await init()}]) -// } -// }) -// } -// }, -// ] -// ) -// } - -// const getMerchant = async () => { -// const SESSION = await DB.session() -// const USERPROFILE = await DB.profile() -// await REQUEST("paymaya_tokens", "get", {'Authorization': SESSION.token}, {noID: true, value: SESSION.user.card_number}, {}, async (res) => { -// console.log("MERCHANT", res) -// if(res.data && res.data.cards){ -// setmerchant(res.data) -// console.log("MERCHANT", res.data.cards) -// // let accounts = await Tokenization.getAccounts(res.data[0].customer_id) -// setActiveIndex(0) -// for(var x=0;x { -// NetInfo.fetch().then(state => { -// console.log("Connection type", state.type); -// console.log("Is connected?", state.isConnected); -// if(state.isConnected){ -// init() -// }else{ -// Elements.nointernet2() -// } -// }) -// }, []) - -// const moneyFormat = (price, sign = 'PHP ') => { -// const pieces = parseFloat(price).toFixed(2).split('') -// let ii = pieces.length - 3 -// while ((ii-=3) > 0) { -// pieces.splice(ii, 0, ',') -// } -// return sign + pieces.join('') -// } - -// const setamount = (value) => { -// setDisplayAmount(moneyFormat(value).toString()) -// setAmount(value) -// } - -// let current = "" -// const onAmountChange = (value) => { -// if(value != current){ -// let parsed = parseFloat(clean(value)) -// if(parsed > 1000000) return false -// let formatted = formatCurrency(parsed) -// current = formatted -// setDisplayAmount(formatted) -// setAmount(parseFloat(parsed/100)) -// console.log(parsed, formatted, current) -// } -// } - -// const clean = (str) => { -// return str.replace("PHP ", "").replace(".", "").replace(",", "").toString() -// } - -// const formatCurrency = (val) => { -// let fv = parseFloat(val / 100).toFixed(2) -// return val.length == 6 ? "PHP " + fv.substr(0, 1) + "," + fv.substr(2, fv.length) : "PHP " + fv -// } - -// const validate = () => { -// if(amount < 100 || amount > 10000){ -// Alert.alert("Invalid top up amount", "\nPlease enter value between 100 - 10,000 pesos only.\n") -// return false -// } -// return true -// } - -// const onReload = (res, msg) => { -// // setTask(msg) -// // setpopup(true) -// // setTimeout(function(){ -// // setpopup(false) -// // }, 1200) -// // navigation.navigation.navigate("Main") -// } - -// const InitCheckout = async () => { - -// if(!validate()) return false - -// console.log('merchant', creditcards[activeIndex]) - -// if(creditcards.length > 0){ -// // HAS AN EXISTING MERCHANT TOKEN -// let mct = creditcards[activeIndex] - -// Platform.OS == 'ios' ? -// setTimeout(() => { -// Alert.alert("Confirm Top Up", "\nYour card number will be used to pay for "+parseFloat(amount).toFixed(2)+" points.", [ -// {text: "NO",style: "cancel"}, -// {text: "YES", -// onPress: async () => { -// setloading(true) -// let payout = await Tokenization.initPayOut(mct.customer_id, mct.cardTokenId, amount) -// console.log(payout) -// if(payout.isPaid){ -// if(payout.status == 'PAYMENT_SUCCESS'){ -// const SESSION = await DB.session() -// REQUEST('topup', 'post', { -// Authorization: SESSION.token, -// card_number: SESSION.user.card_number -// }, {}, { -// amount: amount -// }, function(res){ -// Platform.OS == 'ios' ? setTimeout(() => { -// Alert.alert( -// 'Transaction Completed!', -// `\nYou have successfully paid ${parseFloat(amount).toFixed(2)} points from your credit card \n**** **** **** ${mct.maskedPan}.`, -// [ -// { -// text: "OK", -// onPress: () => { -// navigation.navigation.reset({ -// index: 0, -// routes: [ { name: 'Main' } ], -// }) -// } -// }, -// ]) -// }, 700) : -// null -// }, function(error){ -// console.log(error) -// }) - -// }else{ -// setTimeout(() => alert(JSON.stringify(payout)), 300) -// } -// setloading(false) -// } -// } -// } -// ]) -// }, 300) -// : -// Alert.alert("Confirm Top Up", "\nYour card number will be used to pay for "+parseFloat(amount).toFixed(2)+" points.", [ -// {text: "NO",style: "cancel"}, -// {text: "YES", -// onPress: async () => { -// setloading(true) -// let payout = await Tokenization.initPayOut(mct.customer_id, mct.cardTokenId, amount) -// console.log(payout) -// if(payout.isPaid){ -// if(payout.status == 'PAYMENT_SUCCESS'){ -// Platform.OS == 'ios' ? setTimeout(() => { -// Alert.alert("Topup Success", `\nYou have successfully paid ${parseFloat(amount).toFixed(2)} points from your credit card ${payout.fundSource.details.masked}`) -// }, 300) : -// Alert.alert("Topup Success", `\nYou have successfully paid ${parseFloat(amount).toFixed(2)} points from your credit card ${payout.fundSource.details.masked}`) -// } -// }else{ -// setTimeout(() => alert(JSON.stringify(payout)), 300) -// } -// setloading(false) -// } -// } -// ]) -// }else{ -// //PRE REGISTRATION -// // navigation.navigation.navigate('TokenizationForm', {amount: amount, onBack: (res, msg) => onReload(res, msg)}) -// setCardFormVisibility(true); -// } -// return - -// // navigation.navigation.navigate('CheckOut', { -// // amount: amount, -// // data: {redirectUrl: "https://payments-web-sandbox.paymaya.com/authenticate?id=" + payout.id}, -// // // onBack: (res, msg) => props.route.params.onReload(res, msg) -// // onBack: (res, msg) => alert(msg) -// // }) - -// console.log('initializing...') -// setloading(true) -// const details = { -// "totalAmount": TotalAmount('PHP', amount), -// "buyer": Buyer( -// userProfile.data.firstname, -// userProfile.data.middlename, -// userProfile.data.lastname, -// "+" + userProfile.data.mobile, -// userProfile.data.email), -// "items": [Item('Top up', 1, 'N/A', 'Top up points', TotalAmount('PHP', amount))], -// "redirectUrl": { -// "success": "https://unioil.herokuapp.com/success", -// "failure": "https://unioil.herokuapp.com/failure", -// "cancel": "https://unioil.herokuapp.com/cancel" -// }, -// "requestReferenceNumber": Ref(), -// "metadata": {} -// } - -// CheckOut(PAYMENT_ENV, details, function(result){ -// console.log('CHECKOUT RESULT', result) -// setloading(false) -// navigation.navigation.navigate('CheckOut', {amount: amount, data: result, onBack: (res, msg) => onReload(res, msg)}) -// }) - -// } - -// const InitAddCard = async () => { -// setCardFormVisibility(true) -// } - -// if(!connected){ -// return ( -// -// -// -// { -// NetInfo.fetch().then(state => { -// console.log("Connection type", state.type); -// console.log("Is connected?", state.isConnected); -// if(state.isConnected){ -// init() -// }else{ -// Elements.nointernet2() -// } -// }) -// }} -// /> -// -// -// ) -// } - -// const getDisplayCard = (type) => { -// if(type == "visa") return Assets.icons.stpvisa -// else if(type == "master-card") return Assets.icons.stpmastercard -// else if(type == "jcb") return Assets.icons.stpjcb -// else return Assets.stpunknown -// } - -// return ( - -// -// {isCardFormVisible && ( -// 0 ? 'add' : 'create'} -// customerId={merchant && creditcards.length > 0 ? merchant.customer_id : ''} -// amount={amount} -// onDone={init} -// onBack={(res, msg) => onReload(res, msg)} -// onGoBack={() => setCardFormVisibility(false)} -// onSuccess={data => navigation.navigation.navigate('CheckOut', data)} -// /> -// )} -// -// -// -// -// -// Select Top Up Value Points -// -// - -// -// -// setamount(100)} style={{flex: 1, margin: 10, padding: 10, borderRadius: 10, borderColor: Theme.colors.primary, borderWidth: 2}}> -// 100 -// -// setamount(500)} style={{flex: 1, margin: 10, padding: 10, borderRadius: 10, borderColor: Theme.colors.primary, borderWidth: 2}}> -// 500 -// -// -// -// setamount(1000)} style={{flex: 1, margin: 10, padding: 10, borderRadius: 10, borderColor: Theme.colors.primary, borderWidth: 2}}> -// 1000 -// -// setamount(5000)} style={{flex: 1, margin: 10, padding: 10, borderRadius: 10, borderColor: Theme.colors.primary, borderWidth: 2}}> -// 5000 -// -// -// - -// -// -// Or Enter Desired Value (maximum of 10,000 points) -// -// 0 ? "PHP " + parseFloat(amount) : amount} -// onFocus={() => -// setfocused(true) -// } -// onChangeText={(value) => onAmountChange(value)} -// containerStyle={{padding: 0}} -// inputContainerStyle={{padding: 0, borderBottomWidth: focused ? 1.75 : 1, borderColor: focused ? Theme.colors.accent : "gray" }} -// inputStyle={{padding: 0, fontFamily: 'Arial', fontSize: 16}} -// /> -// Note: Top Up to a maximum of five(5) times per day. -// - -// -// -// Payment Method -// -// - -// {creditcards.length > 0 ? -// -// -// -// -// -// -// {creditcards[activeIndex].cardType.toString().toUpperCase()} {creditcards[activeIndex].maskedPan} -// **** **** **** {creditcards[activeIndex].maskedPan} -// -// -// -// : -// -// -// -// -// -// -// -// 0000 0000 0000 0000 -// -// -// -// } - -// -// -// -// Add New Card -// -// - -// {creditcards.length > 0 && creditcards.map((card, index) => { -// return ( -// -// -// -// -// -// -// { -// Toast.show({ -// text: "**** **** **** " + card.maskedPan + " is selected.", -// buttonText: "", -// duration: 1500 -// }) -// setActiveIndex(index) -// }}> -// {card.cardType.toString().toUpperCase()} -// **** **** **** {card.maskedPan} -// -// -// -// -// -// -// -// ) -// })} -// -// -// -// {topupCount > 5 ? null : -// { -// InitCheckout() -// }} style={{padding: 20, paddingTop: 15, paddingBottom: 15, width: '100%', borderRadius: 10, backgroundColor: Theme.colors.primary}}> -// Next -// -// } -// - -// - -// -// ); -// } \ No newline at end of file +export default connect(mapStateToProps, mapDispatchToProps)(TopUp); diff --git a/ios/RNUnioilLoyaltyApp.xcodeproj/project.pbxproj b/ios/RNUnioilLoyaltyApp.xcodeproj/project.pbxproj index c481d973..4d0d24f6 100644 --- a/ios/RNUnioilLoyaltyApp.xcodeproj/project.pbxproj +++ b/ios/RNUnioilLoyaltyApp.xcodeproj/project.pbxproj @@ -1065,7 +1065,7 @@ CODE_SIGN_ENTITLEMENTS = "RNUnioilLoyaltyApp/Unioil Loyalty App.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = J29MB7XX75; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -1240,7 +1240,7 @@ CODE_SIGN_ENTITLEMENTS = "RNUnioilLoyaltyApp/Unioil Loyalty App.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = J29MB7XX75; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/ios/RNUnioilLoyaltyApp.xcworkspace/xcuserdata/macbookpro2017.xcuserdatad/UserInterfaceState.xcuserstate b/ios/RNUnioilLoyaltyApp.xcworkspace/xcuserdata/macbookpro2017.xcuserdatad/UserInterfaceState.xcuserstate index 8003731e..c9872bfe 100644 Binary files a/ios/RNUnioilLoyaltyApp.xcworkspace/xcuserdata/macbookpro2017.xcuserdatad/UserInterfaceState.xcuserstate and b/ios/RNUnioilLoyaltyApp.xcworkspace/xcuserdata/macbookpro2017.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/package.json b/package.json index f3d5d3a1..e28ff55b 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "react-native-push-notification": "^8.1.1", "react-native-qrcode-svg": "^6.0.6", "react-native-reanimated": "^1.8.0", + "react-native-responsive-fontsize": "^0.5.1", "react-native-safe-area-context": "^4.2.5", "react-native-screens": "^2.4.0", "react-native-snap-carousel": "^3.9.0", diff --git a/yarn.lock b/yarn.lock index 5d666729..614d05d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7438,7 +7438,7 @@ react-native-image-slider-box@^1.0.12: dependencies: react-native-snap-carousel latest -react-native-iphone-x-helper@^1.3.0: +react-native-iphone-x-helper@^1.3.0, react-native-iphone-x-helper@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz#20c603e9a0e765fd6f97396638bdeb0e5a60b010" integrity sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg== @@ -7501,6 +7501,13 @@ react-native-reanimated@^1.8.0: dependencies: fbjs "^1.0.0" +react-native-responsive-fontsize@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/react-native-responsive-fontsize/-/react-native-responsive-fontsize-0.5.1.tgz#c39fa2212ecced2bac879211a7b25106534f72d2" + integrity sha512-G77iPzrf3BHxMxVm6G3Mw3vPImIdq+jLLXhYoOjWei6i9J3/jzUNUhNdRWvp49Csb5prhbVBLPM+pYZz+b3ESQ== + dependencies: + react-native-iphone-x-helper "^1.3.1" + react-native-safe-area-context@^4.2.5: version "4.3.1" resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-4.3.1.tgz#5cf97b25b395e0d09bc1f828920cd7da0d792ade"