import React,{Component} from 'react'; import {StyleSheet,View,Text,Image,StatusBar,ScrollView,Alert} from 'react-native'; import { Fumi } from 'react-native-textinput-effects'; import * as Animatable from 'react-native-animatable' let theme=require('./../../utils/theme.json'); import I18n from 'react-native-i18n' import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome5' import {readUser,AssignAgentGeo} from './../../webservice/AuthApi'; import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions'; import MapView,{Marker} from 'react-native-maps'; import Icon from 'react-native-vector-icons/FontAwesome5' import Button from 'apsl-react-native-button' import Notification from "react-native-in-app-notification"; import {Navigation} from "react-native-navigation" require('./../../utils/Translations') const route=require('./../../route.json') export default class IntersticielAds extends Component { static navigatorStyle = { navBarBackgroundColor: theme.primaryDark, navBarTextColor: 'white', navBarButtonColor: 'white', drawUnderStatusBar: false, statusBarColor: theme.primaryDarkAdvanced, statusBarTextColorScheme: 'light', }; static options(passProps){ return { topBar:{ title:{ text:"", }, backButton: { visible: true, color:"white" }, buttonsRight:[], buttonColor:"white", background:{ color:theme.primaryDark } } } } constructor(props) { super(props) this.state=this.generateState() } generateState() { return { isLoading:false, notifi:false } } render(){ return ( iLink World {I18n.t('ADD_NETWORK')} this.setState({validateCode:text})} style={style.input}/> {this.numberRef=com}} onChangeText={(text)=>this.setState({enterPhone:text})} labelStyle={style.labelInput} /> ) } async validateNetwork() { const {validateCode,isLoading,enterPhone}=this.state if(validateCode!==undefined && validateCode!==null && enterPhone!==null){ this.setState({isLoading:true}) let res=await AssignAgentGeo(validateCode,enterPhone) this.setState({isLoading:false}) if(res){ if(res['success']!==undefined){ Alert.alert( I18n.t('ADD_SUCCES'), I18n.t('ADD_SUCCESS_TEXT') , [ {text: 'OK', onPress: () =>{ this.setState({validateCode:"",enterPhone:""}) }} ]) }else{ Alert.alert("Une erreur est survenu", "Verifiez que les champs sont correctement remplis" ,[{text:"Ok",onPress:()=>{}}]); } console.log(res) } } } } const style=StyleSheet.create({ btnHelpText:{ color:'white', fontWeight:'bold' }, btnHelp:{ width:responsiveWidth(10), marginTop:responsiveHeight(10), alignSelf:'flex-end', marginRight:20, borderColor:'transparent', backgroundColor:theme.primaryDark }, btnTextStyle:{ color:"white", fontWeight:'bold', }, btnStyle:{ alignSelf:'center', width:responsiveWidth(95), marginTop:20, borderColor:'transparent', backgroundColor:theme.primaryDarkAdvanced, height:responsiveHeight(8) }, appContainer:{ flexDirection:'row', justifyContent:'center', alignItems:'center' }, container:{ alignItems:'center', justifyContent:'center', alignSelf:'center', flex:1, width:responsiveWidth(100), height:responsiveHeight(100), backgroundColor:theme.primary}, input:{ height:responsiveHeight(10), width:responsiveWidth(90), borderRadius:10, marginTop:20, color:"black" }, logo:{ width:128, height:128 }, nameApp:{ fontSize:27, fontWeight:'bold', color:'white' }, title:{ fontSize:22, fontWeight:'bold', margin:10, color:'white' }, subtitle:{ fontSize:20, margin:10, color:'white' } })