diff --git a/app/components/elements.js b/app/components/elements.js index 61701f12..bdd31f49 100644 --- a/app/components/elements.js +++ b/app/components/elements.js @@ -1,7 +1,7 @@ import * as React from 'react'; -import {useEffect, useState, useRef} from 'react'; -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 { useState, useRef} from 'react'; +import { Platform, View, Text, Image, TouchableOpacity, ScrollView, StyleSheet, TextInput, Modal, ActivityIndicator, Alert } from 'react-native' +import { Button, Icon, Divider, Input } from 'react-native-elements' import {ActionSheet} from 'native-base'; import DateTimePicker from '@react-native-community/datetimepicker'; import DateTimePickerModal from "react-native-modal-datetime-picker"; diff --git a/app/components/header.js b/app/components/header.js index bba9a422..016a1e80 100644 --- a/app/components/header.js +++ b/app/components/header.js @@ -192,7 +192,7 @@ class CustomHeader extends React.Component { - + ) } } diff --git a/app/components/tab/Tabs.js b/app/components/tab/Tabs.js index 66b9e687..bd2ab57f 100644 --- a/app/components/tab/Tabs.js +++ b/app/components/tab/Tabs.js @@ -18,7 +18,7 @@ interface Props { const Tabs = (props: Props) => { const layout = useWindowDimensions(); - const [index, setIndex ] = useState(0); + const [index, setIndex ] = useState(props.tab || 0); const renderScene = props.renderScene; const routes = props.routes; diff --git a/app/components/theme.style.js b/app/components/theme.style.js index 94fafa41..20f8aeb6 100644 --- a/app/components/theme.style.js +++ b/app/components/theme.style.js @@ -1,4 +1,4 @@ -import {Stylesheet, Dimensions} from 'react-native'; +import {Platform, Dimensions} from 'react-native'; import moment from 'moment'; const colors = { @@ -85,10 +85,13 @@ const formatter = { } } +const platform = Platform.OS; + export default { colors, screen, font, card, - formatter + formatter, + platform } \ No newline at end of file diff --git a/app/screens/account/add.js b/app/screens/account/add.js index 0b495f5b..58c0b003 100644 --- a/app/screens/account/add.js +++ b/app/screens/account/add.js @@ -165,7 +165,6 @@ class AddAccountCard extends React.PureComponent { color={this.props.app_theme?.theme.colors.text} visible={this.state.loading} /> this.props.navigation.goBack()} back={true} /> - @@ -173,7 +172,7 @@ class AddAccountCard extends React.PureComponent { Add Card - Enter you 16-digit card number. + Enter your 16-digit card number. - ) } diff --git a/app/screens/account/index.js b/app/screens/account/index.js index 18fd458b..c820c2e7 100644 --- a/app/screens/account/index.js +++ b/app/screens/account/index.js @@ -253,11 +253,12 @@ class About extends React.PureComponent { style={{width: '100%', height: '85%', resizeMode: 'contain'}} /> - + - - + + @@ -286,7 +287,7 @@ class About extends React.PureComponent { {this.renderAccount()} - + {this.state.accounts.length < 5 ? { @@ -128,60 +133,68 @@ class ApplyCardDetails extends React.Component { return ( - - - - - - - {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}}> - + + + + + + + + {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}}> + + + */} + + + + + + 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/apply/form.js b/app/screens/login/apply/form.js index 50043633..6a865153 100644 --- a/app/screens/login/apply/form.js +++ b/app/screens/login/apply/form.js @@ -18,6 +18,7 @@ import moment from 'moment'; import DB from '../../../components/storage/'; import REQUEST from '../../../components/api/'; import CustomSafeArea from '../../../components/safeArea.component.js'; +import { KeyboardAvoidingView } from 'native-base'; const CustomInput = (props) => { @@ -394,130 +395,136 @@ class ApplyForm extends React.Component { onCancel={() => this.setState({ datepicker: false })} /> this.props.navigation.goBack()} navigation={this.props.navigation} /> - - - - Enter Your Details - - Fill out the remaining forms and you're good to go! - - { - this.setState({ activeInput: 1, focus: true }) - }} - onChangeText={this.onChangeTextValueFirstname} - /> - { - this.setState({ activeInput: 2, focus: true }) - }} - onChangeText={this.onChangeTextValueLastname} - /> - { - this.setState({ activeInput: 3, focus: true }) - }} - onChangeText={(val) => { - this.setState({ email: val }) - }} - /> - - - - {this.state.activeInput >= 4 ? Birthday : null} - { - this.setState({ focus: true, activeInput: 4, datepicker: true }) - if(this.state.errors && this.state.errors.birthdate) delete this.state.errors.birthdate - }}> - - {this.state.birthdate || "Birthday"} - - - {this.state.errors && this.state.errors.birthdate ? - - {this.state.errors?.birthdate[0]} - : null} - - - - { - this.setState({ activeInput: 5, focus: true }) - if(this.state.number == null) this.setState({ number: '+63' }) - }} - onChangeText={(val) => { - this.setState({ number: val, errors: null }) - if(this.state.agree){ - if(val.length < 13) this.setState({ valid: false }) - else if(val.length == 13) this.setState({ valid: true }) - } - }} - /> - - this.state.fname && this.state.lname && this.state.birthdate && this.state.email && this.state.number ? this.onAgree() : null} style={{flex: 0, paddingTop: 15}}> - {!this.state.agree ? : } - - - - I agree to - this.props.navigation.navigate("TermsConditions", {screen: 'ApplyForm'})}> - Unioil's Data Privacy Policy. + + + + + Enter Your Details + + Fill out the remaining forms and you're good to go! + + { + this.setState({ activeInput: 1, focus: true }) + }} + onChangeText={this.onChangeTextValueFirstname} + /> + { + this.setState({ activeInput: 2, focus: true }) + }} + onChangeText={this.onChangeTextValueLastname} + /> + { + this.setState({ activeInput: 3, focus: true }) + }} + onChangeText={(val) => { + this.setState({ email: val }) + }} + /> + + + + {this.state.activeInput >= 4 ? Birthday : null} + { + this.setState({ focus: true, activeInput: 4, datepicker: true }) + if(this.state.errors && this.state.errors.birthdate) delete this.state.errors.birthdate + }}> + + {this.state.birthdate || "Birthday"} + + {this.state.errors && this.state.errors.birthdate ? + + {this.state.errors?.birthdate[0]} + : null} - - - this.onSubmit()} disabled={!this.state.valid} style={{padding: 20, paddingTop: 15, width: Theme.screen.w - 60, 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"}}> - Submit - - - - - + + { + this.setState({ activeInput: 5, focus: true }) + if(this.state.number == null) this.setState({ number: '+63' }) + }} + onChangeText={(val) => { + this.setState({ number: val, errors: null }) + if(this.state.agree){ + if(val.length < 13) this.setState({ valid: false }) + else if(val.length == 13) this.setState({ valid: true }) + } + }} + /> + + this.state.fname && this.state.lname && this.state.birthdate && this.state.email && this.state.number ? this.onAgree() : null} style={{flex: 0, paddingTop: 15}}> + {!this.state.agree ? : } + + + + I agree to + this.props.navigation.navigate("TermsConditions", {screen: 'ApplyForm'})}> + Unioil's Data Privacy Policy. + + + + + + this.onSubmit()} disabled={!this.state.valid} style={{padding: 20, paddingTop: 15, width: Theme.screen.w - 60, 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"}}> + Submit + + + + + + ); } diff --git a/app/screens/main/station/fragments/searchbar.js b/app/screens/main/station/fragments/searchbar.js index ea0fd23a..a52d9d8f 100644 --- a/app/screens/main/station/fragments/searchbar.js +++ b/app/screens/main/station/fragments/searchbar.js @@ -13,7 +13,7 @@ export default function SearchBar(props){ - + {props.clear ? diff --git a/app/screens/main/station/xindex.js b/app/screens/main/station/xindex.js index acccd5b3..7ce2ebea 100644 --- a/app/screens/main/station/xindex.js +++ b/app/screens/main/station/xindex.js @@ -134,7 +134,7 @@ class Stations extends React.Component { - + @@ -166,120 +166,6 @@ class Stations extends React.Component { export default Stations -// export default function Stations(navigation) { - -// const [loading, setloading] = useState(false) -// const [panel, setpanel] = useState(null) -// const [showPanel, setshowpanel] = useState(false) -// const [session, setsession] = useState(null) -// const [stations, setstations] = useState([]) -// const [initialRegion, setinitialRegion] = useState({ -// latitude: 14.599512, -// longitude: 120.984222, -// latitudeDelta: 0.0922, -// longitudeDelta: 0.0421, -// }) -// const [mylocation, setmylocation] = useState({}) - -// const fetch = async () => { -// setloading(true) -// panel.hide() -// let session = await DB.session() -// await setsession(session) -// REQUEST('gas_stations', 'post', { -// Authorization: session.token -// }, {}, { -// lcard_uuid: session.user.lcard_uuid, -// longitude: mylocation.longitude, -// latitude: mylocation.latitude -// }, function(res){ -// setloading(false) -// setstations(res.data) -// panel.show() -// updateRegion() -// }, function(e){ -// console.log(e) -// setloading(false) -// }) -// setloading(false) -// } - -// const updateRegion = () => { -// if(stations.length > 0){ -// let region = initialRegion -// region.latitude = parseFloat(stations[0].latitude) -// region.longitude = parseFloat(stations[0].longitude) -// region.latitudeDelta = 0.00700 -// region.longitudeDelta = 0.00100 -// setinitialRegion(region) -// } -// } - -// const init = async () => { -// Geolocation.getCurrentPosition(info => setmylocation(info.coords) ); -// // if(!mylocation.accuracy){ -// // alert("Location is disabled") -// // return -// // } -// fetch() -// } - -// useEffect(() => { -// init() -// }, []) - -// return ( -// -// - -// -// -// - -// -// -// -// -// -// -// -// -// -// - -// {/* */} -// -// setpanel(c)} -// backdropOpacity={1} -// allowDragging={true} -// showBackdrop={false} -// draggableRange={{top: Theme.screen.h / 2.35, bottom: Theme.screen.h / 1.96}}> -// -// setshowpanel(true)} style={{ width: '100%', height: 60, top: -70}}> -// -// Unioil Stations found: {stations.length} -// {loading ? : null} -// -// -// -// {renderStations(stations)} -// -// - -// -// -// -// -// ); -// } - const styles = StyleSheet.create({ mapContainer: { ...StyleSheet.absoluteFillObject, diff --git a/app/screens/mpin/setmpin.js b/app/screens/mpin/setmpin.js index d76db235..ab9d87b9 100644 --- a/app/screens/mpin/setmpin.js +++ b/app/screens/mpin/setmpin.js @@ -5,9 +5,12 @@ import { TouchableOpacity, ScrollView, Alert, - Dimensions } from 'react-native'; + Dimensions, + KeyboardAvoidingView} from 'react-native'; import { connect } from "react-redux"; import { saveUserInfo } from "../../redux/actions/AppUserInfoActions"; +import Icon from '../../components/icons.js'; +import CustomHeader from '../../components/header.js'; import Crypto from '../../components/crypto.js'; import Elements from '../../components/elements.js'; import NetInfo from "../../components/netstatus"; @@ -149,13 +152,21 @@ class Setmpin extends React.Component { render() { return( - - + {/* + + this.props.navigation.goBack()}> + + + + Set your mobile PIN - + + */} + this.props.navigation.goBack()} navigation={this.props.navigation} /> + - - - To keep your app secure, you will be asked for an MPIN to open your app. - - Enter 4-digit MPIN - { - this.setState({ mpin: v, valid: v.length == 4 ? true : false }) - }}/> - Confirm 4-digit MPIN - { - this.setState({ confirmMpin: v, valid: v.length == 4 ? true : false }) - }}/> - {(this.state.confirmMpin.length > 0 && !this.checkValidMpin()) && ( - Please ensure that your MPIN is matched - )} - - - + + + + To keep your app secure, you will be asked for an MPIN to open your app. + + Enter 4-digit MPIN + { + this.setState({ mpin: v, valid: v.length == 4 ? true : false }) + }}/> + Confirm 4-digit MPIN + { + this.setState({ confirmMpin: v, valid: v.length == 4 ? true : false }) + }}/> + {(this.state.confirmMpin.length > 0 && !this.checkValidMpin()) && ( + Please ensure that your MPIN is matched + )} + + + + this.setAppMpin()}> Submit diff --git a/app/screens/myprofile/card.js b/app/screens/myprofile/card.js index e39dc1f4..e9fdca8d 100644 --- a/app/screens/myprofile/card.js +++ b/app/screens/myprofile/card.js @@ -80,8 +80,8 @@ class MyCard extends React.Component { render() { return ( - - + + {this.renderName() || null} {this.renderCardNumber() || null} diff --git a/app/screens/myprofile/index.js b/app/screens/myprofile/index.js index 7696fce4..9f1c1f99 100644 --- a/app/screens/myprofile/index.js +++ b/app/screens/myprofile/index.js @@ -64,11 +64,13 @@ class MyProfile extends React.PureComponent { } render() { + const { tab } = this.props.route.params; + return ( this.props.navigation.goBack()} menu={false} navigation={this.props} /> - + ) diff --git a/app/screens/myprofile/profile/edit.js b/app/screens/myprofile/profile/edit.js index 2d2422e5..f9980c99 100644 --- a/app/screens/myprofile/profile/edit.js +++ b/app/screens/myprofile/profile/edit.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { SafeAreaView, ScrollView, TouchableOpacity, View, Text, Alert } from 'react-native'; +import { KeyboardAvoidingView, ScrollView, TouchableOpacity, View, Text, Alert } from 'react-native'; import { Avatar } from 'react-native-elements'; import { connect } from "react-redux"; import { saveUserInfo, savePlainUserInfo } from "../../../redux/actions/AppUserInfoActions"; @@ -466,6 +466,11 @@ class EditProfile extends React.PureComponent { navigation={this.props.navigation} /> + @@ -636,6 +641,7 @@ class EditProfile extends React.PureComponent { + - + {props.clear ? diff --git a/app/screens/tracker/add.js b/app/screens/tracker/add.js index eda2ee40..1c3b6758 100644 --- a/app/screens/tracker/add.js +++ b/app/screens/tracker/add.js @@ -53,8 +53,7 @@ const Tracker = (navigation) => { return ( - - + { style={{ width: '90%', marginLeft: '5%', marginTop: Theme.screen.h / 3, borderRadius: 10, padding: 15, backgroundColor: Theme.colors.primary}}> Save Tracker -