Merge remote-tracking branch 'origin/master' into zmiguel

This commit is contained in:
José Valdiviesso 2019-03-06 17:16:18 +00:00
commit 629d86229b
25 changed files with 1498 additions and 276 deletions

View File

@ -2,7 +2,8 @@ import React from 'react';
import {
TouchableOpacity,
Text,
View
View,
Image
} from 'react-native';
import {
createStackNavigator,
@ -17,7 +18,7 @@ import AuthLoadingScreen from './screens/AuthLoading'
import Eventos from './screens/Eventos'
import Social from './screens/Social'
import Jogo from './screens/Jogo'
import Scan from './screens/Scan'
import Calendar from './screens/Calendar'
@ -37,7 +38,7 @@ import calendarDetail from './screens/calendarDetail';
const AppStack = createBottomTabNavigator(
{
Calendar: {
Calendário: {
screen: Calendar,
navigationOptions: {
@ -48,13 +49,14 @@ const AppStack = createBottomTabNavigator(
},
},
Social: {
screen: Social,
'Jogo do...': {
screen: Jogo,
navigationOptions: {
tabBarIcon: ({tintColor}) => (
<Icon name="ios-mail" color={tintColor} size={30}/>
<Image style={{width:30, height:30}}source={require('./assets/img/logo2.png')}></Image>
)
},
},
@ -100,7 +102,7 @@ const AppStack = createBottomTabNavigator(
tabBarOptions: {
showLabel: true, // hide labels
activeTintColor: '#CC1A17', // active icon color
inactiveTintColor: '#d8d6c9', // inactive icon color
inactiveTintColor: 'black', // inactive icon color
style: {
backgroundColor: '#fff' // TabBar background
}
@ -127,7 +129,7 @@ const Stack = createStackNavigator({
)
}
}
else if(navigation.state.routes[index].routeName == 'Calendar'){
else if(navigation.state.routes[index].routeName == 'Calendário'){
return {
headerTitle: 'Calendário',
headerRight: (

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

BIN
App/app/assets/altice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
App/app/assets/img/bg-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="1130px" height="350px" viewBox="0 0 1130 350" enable-background="new 0 0 1130 350" xml:space="preserve">
<g>
<path d="M234.08,65.945c-14.86-48.87-72.639-65.136-124.304-49.464c-51.652,15.67-77.705,65.582-62.822,114.453
c9.492,31.225,43.003,56.425,78.502,64.342l-11.714,78.736l-65.354-85.776H20.08v139.327h30.276v-88.576l67.899,99.774
l36.408-11.387l3.704-130.144c8.84-1.008,17.395-3.239,25.242-7.168C239.878,161.901,248.935,114.823,234.08,65.945z
M151.49,169.298c-37.983,0-76.66-30.117-76.66-65.855c0-35.754,24.019-69.244,61.993-69.244c37.978,0,67.65,28.148,75.54,69.244
C219.094,138.548,189.469,169.298,151.49,169.298z"/>
<path fill="#FF0000" d="M185.817,102.266c-9.019,24.76-31.073,42.792-54.108,42.792c-23.049,0-36.071-19.144-29.307-42.792
c6.488-22.723,19.313-37.402,41.701-42.783C172.28,52.743,193.908,80.071,185.817,102.266"/>
<g>
<g>
<path fill="#FF0000" d="M662.173,323.944l2.399-3.375c3.442,2.574,7.238,4.051,10.988,4.051c3.816,0,6.571-1.964,6.571-5.035
v-0.127c0-3.188-3.749-4.414-7.927-5.582c-4.973-1.411-10.499-3.133-10.499-8.967v-0.123c0-5.461,4.552-9.08,10.809-9.08
c3.868,0,8.171,1.346,11.415,3.497l-2.139,3.563c-2.947-1.908-6.323-3.076-9.388-3.076c-3.75,0-6.146,1.964-6.146,4.607v0.123
c0,3.009,3.928,4.173,8.166,5.461c4.907,1.477,10.189,3.384,10.189,9.089v0.122c0,6.02-4.974,9.517-11.296,9.517
C670.766,328.609,665.745,326.831,662.173,323.944z"/>
<path fill="#FF0000" d="M690.266,284.094h5.399v5.219h-5.399V284.094z M690.561,296.25h4.726v31.744h-4.726V296.25z"/>
<path fill="#FF0000" d="M701.062,296.25h4.724v5.35c2.092-3.136,4.909-6.024,10.243-6.024c5.165,0,8.474,2.766,10.19,6.329
c2.282-3.502,5.658-6.329,11.186-6.329c7.302,0,11.783,4.917,11.783,12.773v19.646h-4.725V309.46c0-6.15-3.066-9.581-8.235-9.581
c-4.778,0-8.706,3.554-8.706,9.825v18.29h-4.729v-18.661c0-5.957-3.131-9.454-8.166-9.454c-5.04,0-8.842,4.177-8.842,10.003
v18.112h-4.724V296.25z"/>
<path fill="#FF0000" d="M754.148,296.25h4.725v6.394c2.579-3.806,6.309-7.068,12.146-7.068c7.617,0,15.165,6.024,15.165,16.459
v0.121c0,10.378-7.481,16.519-15.165,16.519c-5.884,0-9.698-3.196-12.146-6.76v15.905h-4.725V296.25z M781.34,312.212v-0.123
c0-7.481-5.166-12.276-11.186-12.276c-5.887,0-11.474,4.974-11.474,12.222v0.121c0,7.369,5.587,12.276,11.474,12.276
C776.3,324.431,781.34,319.893,781.34,312.212z"/>
<path fill="#FF0000" d="M790.064,283.177h4.729v44.817h-4.729V283.177z"/>
<path fill="#FF0000" d="M798.59,312.212v-0.123c0-9.144,6.44-16.514,15.211-16.514c9.408,0,14.804,7.491,14.804,16.768
c0,0.614,0,0.979-0.066,1.533h-25.172c0.685,6.871,5.527,10.744,11.185,10.744c4.354,0,7.421-1.786,9.993-4.481l2.953,2.639
c-3.195,3.562-7.059,5.953-13.078,5.953C805.697,328.73,798.59,322.036,798.59,312.212z M823.815,310.379
c-0.494-5.771-3.804-10.81-10.125-10.81c-5.527,0-9.705,4.607-10.323,10.81H823.815z"/>
<path fill="#FF0000" d="M831.637,296.25h4.729v8.293c2.329-5.283,6.929-9.089,12.942-8.837v5.096h-0.374
c-6.93,0-12.568,4.968-12.568,14.551v12.642h-4.729V296.25z"/>
<path fill="#FF0000" d="M889.485,321.914c-3.932,4.239-8.479,6.695-14.057,6.695c-7.744,0-13.514-4.853-13.514-12.034v-0.121
c0-5.711,3.815-9.826,10.387-12.398c-2.953-3.44-4.308-6.084-4.308-9.46v-0.121c0-5.648,4.552-10.191,11.366-10.191
c6.015,0,10.437,4.354,10.437,9.704v0.121c0,5.461-3.868,8.958-10.145,11.166l9.833,10.012c1.909-2.76,3.62-6.015,5.152-9.576
l3.994,1.843c-1.907,4.049-3.861,7.733-6.196,10.808l7.486,7.67l-3.685,2.821L889.485,321.914z M886.532,318.905l-11.479-11.845
c-5.705,2.085-8.232,5.587-8.232,9.21v0.122c0,4.599,3.686,8.104,8.968,8.104C879.849,324.497,883.401,322.344,886.532,318.905z
M885.243,294.351v-0.122c0-3.439-2.572-5.957-6.079-5.957c-3.863,0-6.507,2.705-6.507,6.202v0.121
c0,2.522,1.046,4.42,4.308,7.927C882.426,300.679,885.243,298.036,885.243,294.351z"/>
<path fill="#FF0000" d="M915.079,283.177h4.73v18.601c2.086-3.437,5.395-6.202,10.855-6.202c7.684,0,12.165,5.161,12.165,12.707
v19.712h-4.73V309.46c0-5.896-3.192-9.581-8.784-9.581c-5.466,0-9.506,3.989-9.506,9.946v18.169h-4.73V283.177z"/>
<path fill="#FF0000" d="M945.244,318.783v-0.121c0-6.694,5.525-10.247,13.565-10.247c4.041,0,6.928,0.548,9.765,1.344v-1.101
c0-5.713-3.507-8.658-9.455-8.658c-3.75,0-6.703,0.979-9.638,2.335l-1.415-3.871c3.502-1.59,6.928-2.636,11.54-2.636
c4.486,0,7.921,1.167,10.256,3.497c2.151,2.151,3.245,5.218,3.245,9.269v19.4h-4.533v-4.786
c-2.219,2.889-5.901,5.466-11.495,5.466C951.198,328.674,945.244,325.3,945.244,318.783z M968.626,316.332v-3.066
c-2.335-0.68-5.466-1.354-9.329-1.354c-5.953,0-9.276,2.579-9.276,6.572v0.122c0,3.984,3.685,6.318,7.987,6.318
C963.843,324.924,968.626,321.365,968.626,316.332z"/>
<path fill="#FF0000" d="M977.915,296.25h4.731v6.394c2.572-3.806,6.323-7.068,12.158-7.068c7.617,0,15.165,6.024,15.165,16.459
v0.121c0,10.378-7.501,16.519-15.165,16.519c-5.901,0-9.698-3.196-12.158-6.76v15.905h-4.731V296.25z M1005.113,312.212v-0.123
c0-7.481-5.151-12.276-11.169-12.276c-5.903,0-11.476,4.974-11.476,12.222v0.121c0,7.369,5.572,12.276,11.476,12.276
C1000.074,324.431,1005.113,319.893,1005.113,312.212z"/>
<path fill="#FF0000" d="M1013.41,296.25h4.729v6.394c2.574-3.806,6.324-7.068,12.16-7.068c7.617,0,15.164,6.024,15.164,16.459
v0.121c0,10.378-7.5,16.519-15.164,16.519c-5.901,0-9.699-3.196-12.16-6.76v15.905h-4.729V296.25z M1040.608,312.212v-0.123
c0-7.481-5.156-12.276-11.171-12.276c-5.901,0-11.48,4.974-11.48,12.222v0.121c0,7.369,5.579,12.276,11.48,12.276
C1035.568,324.431,1040.608,319.893,1040.608,312.212z"/>
<path fill="#FF0000" d="M1049.035,284.094h5.395v5.219h-5.395V284.094z M1049.345,296.25h4.729v31.744h-4.729V296.25z"/>
<path fill="#FF0000" d="M1057.858,312.212v-0.123c0-9.144,6.436-16.514,15.225-16.514c9.389,0,14.79,7.491,14.79,16.768
c0,0.614,0,0.979-0.052,1.533h-25.172c0.665,6.871,5.525,10.744,11.166,10.744c4.372,0,7.434-1.786,10.012-4.481l2.953,2.639
c-3.198,3.562-7.06,5.953-13.078,5.953C1064.978,328.73,1057.858,322.036,1057.858,312.212z M1083.094,310.379
c-0.492-5.771-3.814-10.81-10.143-10.81c-5.508,0-9.699,4.607-10.303,10.81H1083.094z"/>
<path fill="#FF0000" d="M1090.905,296.25h4.726v8.293c2.333-5.283,6.945-9.089,12.96-8.837v5.096h-0.374
c-6.942,0-12.586,4.968-12.586,14.551v12.642h-4.726V296.25z"/>
</g>
<polygon points="377.608,138.481 395.687,138.481 395.687,242.92 380.299,242.92 322.628,168.622 322.628,242.92 304.552,242.92
304.552,138.481 321.577,138.481 377.608,210.698 "/>
<g>
<path d="M465.826,153.552c-20.77,0-35.25,16.566-35.25,37.004c0,20.442,14.79,37.299,35.555,37.299
c20.757,0,35.25-16.561,35.25-36.993C501.381,170.413,486.596,153.552,465.826,153.552 M465.826,244.711
c-32.119,0-54.525-24.31-54.525-53.85c0-29.551,22.698-54.17,54.83-54.17c32.124,0,54.525,24.329,54.525,53.864
C520.656,220.101,497.96,244.711,465.826,244.711"/>
</g>
<polygon points="603.297,138.481 623.174,138.481 579.687,243.661 563.557,243.661 520.075,138.481 540.392,138.481
571.91,218.756 "/>
<path d="M663.509,159.67l-17.93,41.775h35.996L663.509,159.67z M718.329,242.92h-19.425l-10.603-25.209h-49.453l-10.763,25.209
h-18.821l46.028-105.183h17.023L718.329,242.92z"/>
<g>
<path d="M797.169,212.188c0-8.953-7.021-14.175-21.515-14.175h-29.139v28.65H777
C789.552,226.664,797.169,221.732,797.169,212.188 M791.334,168.173c0-8.503-6.568-13.43-18.357-13.43h-26.461v27.764h25.103
C783.42,182.507,791.334,177.885,791.334,168.173 M809.718,165.196c0,12.825-7.167,19.388-14.948,23.419
c12.271,4.177,20.784,11.199,20.784,25.515c0,18.797-15.397,28.79-38.7,28.79h-48.412V138.481h46.922
C796.424,138.481,809.718,148.78,809.718,165.196"/>
</g>
<path d="M872.385,159.67l-17.934,41.775h36.015L872.385,159.67z M927.205,242.92h-19.409l-10.618-25.209h-49.453l-10.748,25.209
h-18.826l46.014-105.183h17.038L927.205,242.92z"/>
<g>
<path d="M978.412,182.348c22.117,5.367,33.615,13.279,33.615,30.731c0,19.696-15.391,31.326-37.354,31.326
c-15.989,0-31.083-5.513-43.632-16.692l11.058-13.144c10.017,8.662,20.021,13.584,33.009,13.584
c11.367,0,18.549-5.221,18.549-13.279c0-7.604-4.187-11.635-23.605-16.115c-22.262-5.368-34.825-11.93-34.825-31.327
c0-18.197,14.931-30.441,35.715-30.441c15.239,0,27.339,4.622,37.941,13.135l-9.858,13.871
c-9.408-7.008-18.82-10.74-28.387-10.74c-10.754,0-17.025,5.518-17.025,12.53C953.612,173.999,958.377,177.571,978.412,182.348"
/>
</g>
<polygon points="1104.559,154.897 1045.398,154.897 1045.398,182.052 1097.832,182.052 1097.832,198.459 1045.398,198.459
1045.398,226.514 1105.319,226.514 1105.319,242.92 1027.028,242.92 1027.028,138.491 1104.559,138.491 "/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -85,7 +85,7 @@ class Home extends Component {
//console.log(this.props.token);
// this.props.getUserInfo(this.props.userDetails.token);
this.props.getUserInfo(this.props.userDetails.token);
//console.log('logged:'+this.props.logged);
@ -184,36 +184,6 @@ _update=()=>{
<View style={styles.userBio}>
<View style={styles.userBioRow}>
<Icon name="ios-laptop" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioText}>{this.props.user.Job}</Text>
</View>
<Divider style={{ backgroundColor: 'black' }} />
<View style={styles.userBioRow}>
<Icon name="ios-mail" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioText}>{this.props.user.Email}</Text>
</View>
<Divider style={{ backgroundColor: 'black' }} />
<View style={styles.userBioRow}>
<Icon name="ios-phone-portrait" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioText}>{this.props.user.Mobile}</Text>
</View>
<Divider style={{ backgroundColor: 'black' }} />
<View style={styles.userBioRow}>
<Icon name="ios-map" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioText}>{this.props.user.Address}, {this.props.user.City}</Text>
</View>
<Divider style={{ backgroundColor: 'black' }} />
<View style={styles.userBioRow}>
<Icon name="ios-person" style={styles.userBioLogo} size={25}/>
<TouchableOpacity><Text style={styles.userCurriculum}>O meu Curriculo</Text></TouchableOpacity>
</View>
</View>

722
App/app/screens/Jogo.js Normal file
View File

@ -0,0 +1,722 @@
import React from 'react';
import {
StyleSheet,
Text,
View,
ImageBackground,
Dimensions,
Button,
TouchableOpacity
} from 'react-native';
import ProgressBarAnimated from 'react-native-progress-bar-animated';
import Modal from "react-native-modal";
import IconF from "react-native-vector-icons/Foundation"
import IconFA from "react-native-vector-icons/FontAwesome5"
import { ScrollView, ViewPagerAndroid } from 'react-native-gesture-handler';
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
import FitImage from 'react-native-fit-image';
export default class Jogo extends React.Component {
state = {
progress: 20,
progressWithOnComplete: 0,
progressCustomized: 0,
isModalVisible: false,
} ;
increase = (key, value) => {
this.setState({
[key]: this.state[key] + value,
});
}
_toggleModal = () =>{
this.setState({ isModalVisible: !this.state.isModalVisible });
console.log("assd")
}
render() {
const { navigate } = this.props.navigation;
const progressCustomStyles = {
backgroundColor: 'red',
borderRadius: 0,
borderColor: 'orange',
};
const barWidth = Dimensions.get('screen').width - 30;
return (
<View style={styles.container}>
<Modal
isVisible={this.state.isModalVisible}
animationInTiming={1000}
animationOutTiming={800}
>
<View style={{
flex:1,
alignContent:'center',
margin :SCREEN_WIDTH*0.1,
backgroundColor:'white',
marginBottom:SCREEN_HEIGHT*0.1,
marginTop:SCREEN_HEIGHT*0.1,
maxHeight:400
}}>
<ImageBackground
opacity={0.5}
source={require('../assets/img/bg_3.jpg')}
style={{
width:'96%',
height:'97.5%',
margin:10
}}
>
<View style={{width:'100%' ,margin:-10}}>
<View style={{width:30}}><Button
onPress={this._toggleModal}
title="X"
color="#CC1A17"
accessibilityLabel="Learn more about this purple button"
/>
</View>
</View>
<View style={{flex:1, alignContent:'center', width:'96%', alignItems:'center'}}>
<View style={{paddingTop:25,width:'40%',}}>
<FitImage
source={{ uri: 'https://upload.wikimedia.org/wikipedia/commons/8/8a/CSW_Gradiente_rgb.png' }}
style={styles.fitImage}
/>
</View>
<View style={{backgroundColor:'rgba(255,255,255,0.6)', width:'100%', marginTop:35}}>
<Text style={{padding:10}}>A CRITICAL Software fornece sistemas e serviços de software para segurança e
aplicações essenciais aos negócios, ajudando a garantir que os clientes atendam aos requisitos mais exigentes de qualidade - padrões de segurança, desempenho e fiabilidade</Text>
</View>
<View style={{width:'100%', marginTop:10}}><TouchableOpacity><Text style={{textAlign:'center', fontWeight:'bold', fontSize:18, color:'#CC1A17'}}>website</Text></TouchableOpacity></View>
</View>
</ImageBackground>
</View>
</Modal>
<View style={styles.header}>
<View style={styles.titleContainer}>
<Text style={styles.title}>Jogo do ENEI'19</Text>
</View>
</View>
<View style={{ height:50, backgroundColor:'white'}}>
<View style={{flex:1, justifyContent:'space-around', flexDirection:'row'}}>
<View style={{width:SCREEN_WIDTH*0.7, flex:1, flexDirection:'row',margin:10, marginLeft:SCREEN_WIDTH*0.10}}>
<IconFA name="trophy" size={30}/>
<Text style={{fontWeight:'bold', fontSize:20,marginLeft:10}}>45</Text>
<Text style={{margin:5}}>pontos</Text>
</View>
<View style={{width:SCREEN_WIDTH*0.3, marginTop:8, marginRight:SCREEN_WIDTH*0.1}}>
<Button
onPress={this._toggleModal}
title="Prémios"
color="#CC1A17"
accessibilityLabel="Learn more about this purple button"
/>
</View>
</View>
</View>
<View style={styles.progress}>
<View style={{ alignItems:'center'}}>
</View>
<View style={{backgroundColor:'#FDFDFD', shadowColor:"#000", shadowOffset:{height:2, width:0, shadowRadius:1}, elevation:3,}}>
<View style={{flex:1,margin: 20, alignItems:'center',flexDirection:'row', justifyContent: 'space-around',}}>
<Text style={{fontWeight:'bold'}} > 1 </Text>
<ProgressBarAnimated
width={barWidth*0.7}
value={this.state.progress}
backgroundColorOnComplete="#CC2A17"
/>
<Text style={{fontWeight:'bold'}}> 2 </Text>
</View>
</View>
</View>
<ScrollView style={{backgroundColor:'#eeeeee',marginTop:10}} horizontal={true}>
<ScrollView>
<View style={styles.cromosContainer}>
<TouchableOpacity onPress={this._toggleModal}>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/critical.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>0</Text>
</ImageBackground>
</View>
</TouchableOpacity>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/novabase.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>1</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>2</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>3</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>4</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>5</Text>
</ImageBackground>
</View>
</View>
<View style={styles.cromosContainer}>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>6</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/ubiwhere.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>7</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>8</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>9</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>10</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>11</Text>
</ImageBackground>
</View>
</View>
<View style={styles.cromosContainer}>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>12</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>13</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>14</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>15</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>16</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>17</Text>
</ImageBackground>
</View>
</View>
<View style={styles.cromosContainer}>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>18</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>19</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>20</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>21</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>22</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>23</Text>
</ImageBackground>
</View>
</View>
</ScrollView>
</ScrollView>
</View>
);
}
}
const styles = StyleSheet.create({
fitImage:{
},
points:{
marginTop:-25,
marginLeft:10,
fontWeight:'bold',
color:'#CC1A17'
},
cromosContainer:{
flex:1,
flexDirection:'row',
flexWrap: 'wrap',
justifyContent: 'space-around',
marginLeft:10,
marginRight:10,
},
cromo:
{
backgroundColor:'white',
margin:3,
height:200,
width:130,
borderRadius:0}
,
imageBg:{
height:190,
margin:5
},
label:{
margin:10
},
progress:{
backgroundColor:'#eeeeee',
shadowColor:'#000',
shadowOffset:{width:0, height:2},
shadowRadius:1,
elevation:1,
},
title:{
fontWeight:'bold',
fontSize:25,
color:'white',
textAlign:'center'
},
titleContainer:{
margin:10,
},
header:{
backgroundColor:'#CC2A17',
//alignItems:'center',
shadowColor:'#000',
shadowOffset:{width:0, height:2},
shadowRadius:1,
elevation:5,
},
container: {
flex: 1,
backgroundColor: '#eeeeee',
// alignItems: 'center',
//justifyContent: 'space-around',
},
triangle: {
width: 0,
height: 0,
backgroundColor: 'transparent',
borderStyle: 'solid',
borderLeftWidth:67,
borderRightWidth: 0,
borderBottomWidth: 20,
transform: [{ rotate: '180deg'}],
borderLeftColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: 'white'
},
triangleNumber: {
width: 0,
height: 0,
backgroundColor: 'transparent',
borderStyle: 'solid',
borderLeftWidth:67,
borderRightWidth: 0,
borderBottomWidth: 20,
transform: [{ rotate: '0deg'}],
borderLeftColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: 'white',
marginLeft:54,
marginTop:156
},
number:{
marginTop:-18,
marginLeft:103,
textAlign: 'center'
}
});

View File

@ -1,155 +1,374 @@
import React, {Component} from 'react'
import {Card, Divider} from 'react-native-elements'
import {
Image,
ImageBackground,
Linking,
ListView,
Platform,
ScrollView,
StyleSheet,
Text,
View,
TouchableOpacity,
Dimensions,
TextInput,
Button
} from 'react-native'
import PropTypes from 'prop-types';
import {connect, Provider} from "react-redux";
import {bindActionCreators} from "redux";
import * as Actions from "../store/actions";
import {createStore} from 'redux';
import Email from '../components/Email';
import Separator from '../components/Separator';
import Tel from '../components/Telephone';
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
import Icon from "react-native-vector-icons/Ionicons"
class Profile extends Component {
constructor(props) {
super(props);
this.state = {
token: false,
tokenData: '',
loggedIn: false,
onHold: true,
user: {},
cenas:{Name:'as'},
text:'',
};
}
_logout = () => {
// this.props.navigation.navigate('scan');
// this.props.logout();
this.props.logoutUser();
}
render() {
return (
<ScrollView>
<View style={styles.container}>
<View style={styles.userBio}>
<View style={styles.userBioRow}>
<Icon name="ios-laptop" style={styles.userBioLogo} size={25}/>
<TextInput
onFocus={this._print}
maxLength={50}
blurOnSubmit ={true}
onChangeText={(text) => this.setState({text})}
value={this.props.user.Job}
/>
</View>
<Divider style={{ backgroundColor: 'black' }} />
<View style={styles.userBioRow}>
<Icon name="ios-mail" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioText}>{this.props.user.Email}</Text>
</View>
<Divider style={{ backgroundColor: 'black' }} />
<View style={styles.userBioRow}>
<Icon name="ios-phone-portrait" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioText}>{this.props.user.Mobile}</Text>
</View>
<Divider style={{ backgroundColor: 'black' }} />
<View style={styles.userBioRow}>
<Icon name="ios-map" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioText}>{this.props.user.Address}, {this.props.user.City}</Text>
</View>
<Divider style={{ backgroundColor: 'black' }} />
<View style={styles.userBioRow}>
<Icon name="ios-person" style={styles.userBioLogo} size={25}/>
<TouchableOpacity><Text style={styles.userCurriculum}>O meu Curriculo</Text></TouchableOpacity>
</View>
<Button onPress={this._logout} title="LOGOUT"/>
</View>
</View>
</ScrollView>
)
}
}
const styles = StyleSheet.create({
container:{
},
userBioRow:{
flex:1,
flexDirection:'row',
padding:10,
},
userBioText:{
},
userBioLogo:{
marginLeft: SCREEN_WIDTH*0.05,
width: SCREEN_WIDTH*0.15,
},
});
mapStateToProps = (state, props) => {
return {
token: state.apiReducer.token,
user: state.apiReducer.user
}
};
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
}
import React, {Component} from 'react'
import {Card, Divider,} from 'react-native-elements'
import {
Image,
ImageBackground,
Linking,
ListView,
Platform,
ScrollView,
StyleSheet,
Text,
View,
TouchableOpacity,
Dimensions,
TextInput,
Button,
} from 'react-native'
import PropTypes from 'prop-types';
import {connect, Provider} from "react-redux";
import {bindActionCreators} from "redux";
import * as Actions from "../store/actions";
import {Validate} from '../Helpers/Validation'
import {RkTextInput} from 'react-native-ui-kitten';
import {createStore} from 'redux';
import Email from '../components/Email';
import Separator from '../components/Separator';
import Tel from '../components/Telephone';
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
import Icon from "react-native-vector-icons/Ionicons"
class Profile extends Component {
constructor(props) {
super(props);
this.state = {
name:this.props.user.Name,
userDetails:{},
token: false,
tokenData: '',
loggedIn: false,
onHold: true,
user: {},
cenas: {Name: 'as'},
text: '',
formValid: true,
jobs: this.props.user.Company,
jobsError: false,
jobsErrorMessage: '',
email: this.props.user.Email,
emailError: false,
emailErrorMessage: '',
phone: this.props.user.Mobile,
phoneError: false,
phoneErrorMessage: '',
address: this.props.user.Address,
addressError: false,
addressErrorMessage: '',
city: this.props.user.City,
cityError: false,
cityErrorMessage: '',
};
}
_logout = () => {
this.props.logoutUser();
};
_validateData = (name,jobs, email, phone, address, city) => {
let valid = null;
v = Validate('name',name );
let v = Validate('email', email);
this.setState({emailError: v[0], emailErrorMessage: v[1]});
v = Validate('jobs', jobs);
// setState is asynchronous and so trying to work with state directly after a setState
// call won't work as the update won't necessarily have run. Instead you can use the second argument to setState which is a callback
this.setState({jobsError: v[0], jobsErrorMessage: v[1]}, () => {
console.log('email error: ' + this.state.emailError + ' job Error: ' + this.state.jobsError);
});
v = Validate('city', city);
// setState is asynchronous and so trying to work with state directly after a setState
// call won't work as the update won't necessarily have run. Instead you can use the second argument to setState which is a callback
this.setState({cityError: v[0], cityErrorMessage: v[1]})
v = Validate('address', address);
// setState is asynchronous and so trying to work with state directly after a setState
// call won't work as the update won't necessarily have run. Instead you can use the second argument to setState which is a callback
this.setState({addressError: v[0], addressErrorMessage: v[1]});
v = Validate('city', city);
// setState is asynchronous and so trying to work with state directly after a setState
// call won't work as the update won't necessarily have run. Instead you can use the second argument to setState which is a callback
this.setState({cityError: v[0], cityErrorMessage: v[1]}, () => {
console.log(this.state.cityError + ' Error: ' + this.state.addressError);
if (this.state.emailError || this.state.jobsError || this.state.phoneError || this.state.addressError || this.state.cityError)
this.setState({formValid: false});
});
};
saveData() {
const {name,jobs, email, phone, address, city, formValid} = this.state;
this._validateData(name,jobs, email, phone, address, city);
console.log(formValid);
if (formValid){
console.log("data valid");
this.props.updateUser(this.props.userDetails.token,{
Name: this.state.name,
// LastName: "Último",
Company: jobs,
// Job: jobs,
Address: address,
City: city,
// PostalCode: "3000-010",
Mobile: phone,
Avatar: "base64"
} ); this.props.getUserInfo(this.props.userDetails.token);
}
else
console.log("data not valid");
}
render() {
return (
<View style={{flex: 1}}>
<ScrollView style={{backgroundColor: '#eee'}}>
<View style={styles.container}>
<View style={styles.userBioRowHeader}>
<View style={styles.userBioRowTitle}>
<Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>User Bio</Text>
</View>
<View>
<TouchableOpacity onPress={() => this.saveData()}>
<Icon name="ios-save" size={30}/><Text>Save</Text>
</TouchableOpacity>
</View>
</View>
<View style={styles.userBio}>
<View style={styles.userBioRow}>
<Icon name="ios-person" style={styles.userBioLogo} size={25}/>
<TextInput style={styles.userBioText}
onChangeText={(n) => {
this.setState({name:n })
}}
value={this.state.name}/>
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Icon name="ios-laptop" style={styles.userBioLogo} size={25}/>
<TextInput style={styles.userBioText}
onChangeText={(job) => {
this.setState({jobs: job})
}}
value={this.state.jobs}/>
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Icon name="ios-phone-portrait" style={styles.userBioLogo} size={25}/>
<TextInput style={styles.userBioText}
onChangeText={(phone) => {
this.setState({phone: phone})
}}
value={this.state.phone}/>
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Icon name="ios-map" style={styles.userBioLogo} size={25}/>
<TextInput style={styles.userBioText}
onChangeText={(add) => {
this.setState({address: add})
}}
value={this.state.address}/>
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Icon name="ios-map" style={styles.userBioLogo} size={25}/>
<TextInput style={styles.userBioText}
onChangeText={(city) => {
this.setState({city: city})
}}
value={this.state.city}/>
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Icon name="ios-person" style={styles.userBioLogo} size={25}/>
<TouchableOpacity>
<Text style={styles.userCurriculum}>O meu Curriculo</Text>
</TouchableOpacity>
</View>
</View>
</View>
{/*PassWord Edit*/}
<View style={styles.container}>
<View style={styles.userBioRowHeader}>
<View style={styles.userBioRowTitle}>
<Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>Nova Password:</Text>
</View>
</View>
<View style={styles.userBio}>
<View style={styles.userBioRow}>
<Text style={styles.userPassText} size={25}>
Old Password:
</Text>
<TextInput style={styles.userBioText}
placeholder='Antiga Password' secureTextEntry={true}
/>
</View>
<View style={styles.userBioRow}>
<Text style={styles.userPassText} size={25}>
Nova Password:
</Text>
<TextInput style={styles.userBioText}
placeholder='Nova Password' secureTextEntry={true}
/>
</View>
<View style={styles.userBioRow}>
<Text style={styles.userPassText} size={25}>
Repetir Password:
</Text>
<TextInput style={styles.userBioText}
placeholder='Repetir Password' secureTextEntry={true}
/>
</View>
</View>
</View>
</ScrollView>
<TouchableOpacity onPress={this._logout} style={{ height: 50, justifyContent: 'center', alignItems: 'center', backgroundColor: '#CC1A17'}}>
<Text style={{color:"#fff", fontWeight: 'bold'}}>Logout</Text>
</TouchableOpacity>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 10,
margin: 20,
backgroundColor: 'white',
borderRadius: 5,
},
userBioRowHeader: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
},
userBioRowTitle: {
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-start',
padding: 10,
},
userBioRow: {
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-start',
padding: 10
},
userBioText: {
width: SCREEN_WIDTH * 0.50,
},
userPassText: {
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-start',
},
userBioLogo: {
marginLeft: SCREEN_WIDTH * 0.05,
width: SCREEN_WIDTH * 0.15,
},
bottomLogOut: {
height: 20,
},
});
mapStateToProps = (state, props) => {
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
userDetails: state.apiReducer.userDetails,
}
};
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(Profile);

View File

@ -1,22 +0,0 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default class Social extends React.Component {
render() {
const { navigate } = this.props.navigation;
return (
<View style={styles.container}>
<Text style={styles.title}>Social</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'space-around',
}
});

View File

@ -11,7 +11,8 @@ import {
Picker,
CheckBox,
ActivityIndicator,
SectionList
SectionList,
FlatList
} from 'react-native';
import {TabView, TabBar, SceneMap} from 'react-native-tab-view';
@ -38,6 +39,10 @@ import FitImage from 'react-native-fit-image';
import { Dropdown } from 'react-native-material-dropdown';
import {Card, Divider} from 'react-native-elements'
import IconF from "react-native-vector-icons/Foundation"
import LinearGradient from 'react-native-linear-gradient';
const formatObj = (obj) => {
let a = {};
@ -50,6 +55,7 @@ const formatObj = (obj) => {
class choosePath extends React.Component {
static navigationOptions = ({ navigation }) => ({
@ -63,7 +69,8 @@ class choosePath extends React.Component {
});
state = {
calendar:{}
calendar:{},
guest:'9'
};
componentDidMount() {
@ -99,9 +106,25 @@ class choosePath extends React.Component {
this.props.getAvailableGuestlists(this.props.userDetails.token)
console.log(this.props.calendar)
}
_keyExtractor = (item, index) => item.id;
_renderItem = ({item}) => (
<MyListItem
id={item.id}
onPressItem={this._onPressItem}
selected={!!this.state.selected.get(item.id)}
title={item.title}
/>
);
_onPressItem = (id) => {
// updater functions are preferred for transactional updates
this.setState((state) => {
// copy the map rather than modifying state.
const selected = new Map(state.selected);
selected.set(id, !selected.get(id)); // toggle
return {selected};
});
};
render() {
@ -109,9 +132,40 @@ class choosePath extends React.Component {
return (
<ScrollView style={styles.page}>
{this.state.guest=='9' && <LinearGradient colors={[ '#D95856', '#CC1A17']} style={styles.linearGradient}>
<Text style={{margin:15,marginBottom:0, fontWeight:'bold', color:'white'}}> Empresa responsável: </Text>
<View style={styles.companyContainer}>
</View>
<View style={styles.companyDescription}>
<Text style={{fontSize:16, fontWeight:'bold', margin:6, color:'white'}}>Critical Software</Text>
<Text style={{margin:6, marginTop:0, color:'white'}}>A CRITICAL Software fornece sistemas e serviços de software para segurança e
aplicações essenciais aos negócios.</Text>
</View>
<View style={styles.companyLogo}>
<FitImage
source={{ uri: 'https://upload.wikimedia.org/wikipedia/commons/8/8a/CSW_Gradiente_rgb.png' }}
style={styles.fitImage}
/>
</View>
</View>
</LinearGradient>}
{this.state.guest=='10' && <LinearGradient colors={[ '#5887FF', '#715AFF']} style={styles.linearGradient}>
<Text style={{margin:15,marginBottom:0, fontWeight:'bold', color:'white'}}> Empresa responsável: </Text>
<View style={styles.companyContainer}>
<View style={styles.companyDescription}>
<Text style={{fontSize:16, fontWeight:'bold', margin:6, color:'white'}}>Altice</Text>
<Text style={{margin:6, marginTop:0, color:'white'}}>Altice é uma multinacional neerlandesa de telecomunicações, conteúdos, media, entretenimento e publicidade.</Text>
</View>
<View style={styles.companyLogo}>
<FitImage
source={{ uri: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTuIfl0Km4mTbCGdJSr4bWn_ApFHnOrjYsmJ4VlBL1OkaIlb93t' }}
style={styles.fitImage}
/>
</View>
</View>
</LinearGradient>}
<View style={{flex:1,width:SCREEN_WIDTH*0.7, alignContent:'center'}}>
@ -140,21 +194,21 @@ class choosePath extends React.Component {
</Picker>
</View>
<FlatList
data={this.state.data}
renderItem={({ item }) => (
<ListItem
title={`${item.name.first} ${item.name.last}`}
subtitle={item.email}
avatar={{ uri: item.picture.thumbnail }}
containerStyle={{ borderBottomWidth: 0 }}
/>
)}
keyExtractor={item => item.email}
/>
<SectionList
renderItem={({item, index, section}) => <Text key={index}>{item}</Text>}
renderSectionHeader={({section: {title}}) => (
<Text style={{fontWeight: 'bold'}}>{title}</Text>
)}
sections={[
{title: 'Title1', data: ['item1', 'item2']},
{title: 'Title2', data: ['item3', 'item4']},
{title: 'Title3', data: ['item5', 'item6']},
]}
keyExtractor={(item, index) => item + index}
/>
</View >
</View >
{ !this.props.changingGuest &&
<View style={styles.block}>
@ -260,6 +314,20 @@ onChange={() => this.setState({ checkbox1: !this.state.checkbox1 })}
}
const styles = StyleSheet.create({
companyLogo:{
backgroundColor:'white',
margin:20,
width:SCREEN_WIDTH*0.35,
borderRadius:3,
padding:5
},
companyDescription:{
// backgroundColor:'white',
margin:20,
marginRight:0,
width:SCREEN_WIDTH*0.5,
borderRadius:3,
},
sessionInfo:{
margin:5
},
@ -294,8 +362,11 @@ const styles = StyleSheet.create({
companyContainer:{
flex:1,
backgroundColor:'blue',
height:SCREEN_HEIGHT*0.25,
// backgroundColor:'blue',
flexDirection:'row',
marginTop:0
},

View File

@ -11,6 +11,33 @@ import { compose } from 'redux';
const axios = require('axios');
axios.defaults.baseURL = 'http://enei2019.uingress.com/internal/api'
//http://enei2019.uingress.com/internal/api/Attendee/Edit
export function updateUser(token, user){
axios.defaults.headers.common = {'Authorization': `bearer ${token.access_token}`}
console.log("asdasdasdasd")
return (dispatch)=>{
axios.post('/Attendee/Edit', user).then(a=>{
console.log(a);
alert("guardado com sucesso")
dispatch({
type: UPDATE_USER
// guests: response.data
});
}).catch(b=>{
alert("Erro a guardar os dados")
});
}
}
export const waitChangeGuest= ()=>{
return (dispatch)=>{
@ -33,7 +60,7 @@ export const connectionState = (status) => {
///Attendee/AvailableGuestlists
axios.defaults.baseURL = 'http://enei2019.uingress.com/internal/api'
export function getAvailableGuestlists(token){
@ -130,7 +157,7 @@ export function getAvailableSessions(token){
});
})
.catch(function (error) {
// handle error
alert("Error a obter sessões disponíveis!!");
console.log(error);
})
.then(function () {
@ -205,9 +232,7 @@ const saveToken = async token => {
obj.access_token = await AsyncStorage.getItem('userToken') || 'none';
obj.expirationDateToken = await AsyncStorage.getItem('expirationDateToken') || 'none';
obj.refreshToken = await AsyncStorage.getItem('refreshToken') || 'none';
} catch (error) {
// Error retrieving data
console.log(error.message);
@ -230,12 +255,8 @@ const deleteToken = async () => {
const renewToken=(refresh)=>{
}
export function login(user, pass){
return (dispatch)=>{
@ -252,17 +273,17 @@ export function login(user, pass){
for (var property in details) {
var encodedKey = encodeURIComponent(property);
var encodedKey = encodeURIComponent(property);
var encodedValue = encodeURIComponent(details[property]);
var encodedValue = encodeURIComponent(details[property]);
formBody.push(encodedKey + "=" + encodedValue);
formBody.push(encodedKey + "=" + encodedValue);
}
formBody = formBody.join("&");
fetch('http://enei2019.uingress.com/internal/api/token', {
fetch('https://tickets.enei.pt/internal/api/token', {
method: 'POST',
@ -276,6 +297,7 @@ export function login(user, pass){
}).catch(err=>{
console.log(err);
alert("Erro no login!!");
alert("error");
co
@ -285,9 +307,6 @@ export function login(user, pass){
failedAttempt:true,
tokenData:'error'
});
}).then(res=>res.json()).then(parsed=>{
if(parsed.error_description=="Provided username and password is incorrect"){
@ -320,14 +339,8 @@ export function login(user, pass){
userDetails: details
});
}
)
}
)
}
}
export function hold(){
@ -374,6 +387,7 @@ export function getUserInfo(token){
console.log("erro")
// dispatch({ type: USER_INFO,onHold:false});
alert("Erro a obter a informação pessoal.")
})
@ -575,7 +589,6 @@ export function checkUser(userDetails){
userDetails.username != '' &&
userDetails.password != undefined &&
userDetails.password != ''
){
//verifica a validade do token
@ -610,22 +623,17 @@ export function checkUser(userDetails){
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
},
body: formBody
}).catch(err=>{
console.log(err);
alert("error");
alert("Erro a validar o utilizador");
}).then(res=>res.json()).then(parsed=>{
if(parsed.error_description=="Provided username and password is incorrect"){
console.error("cenas da vida")
alert("Ups, password ou utilizador errada");
}
else{
@ -640,12 +648,12 @@ export function checkUser(userDetails){
dispatch({type: CHECK_USER, logged:true, onHold:false, userDetails:u,token:obj});
}
}
)
}else{
console.log("Tempo restante token: "+ Math.round((userDetails.token.expirationDateToken-Math.round(new Date().getTime()/1000) )/60) +" Minutos");
//dispatch home

View File

@ -5,7 +5,8 @@ export {checkUser,
getAvailableGuestlists,
changeGuestList,
waitChangeGuest,
getAvailableSessions
getAvailableSessions,
updateUser,
} from "./api"
export {

View File

@ -29,7 +29,9 @@ const apiReducer = (state = apiState, action) => {
switch(action.type){
case REHYDRATE:
console.log(action)
if(action.payload!=undefined){
console.log( action.payload)
var expirationDateTokenA=0;
@ -49,7 +51,7 @@ const apiReducer = (state = apiState, action) => {
}
}
return {
// token: action.payload.apiReducer.token,
@ -65,7 +67,7 @@ const apiReducer = (state = apiState, action) => {
password:action.payload.apiReducer.userDetails.password
}
};
}
case 'CHANGE_CONNECTION_STATUS':
return Object.assign({}, state, {
@ -121,6 +123,7 @@ const apiReducer = (state = apiState, action) => {
return state;

149
App/package-lock.json generated
View File

@ -2329,6 +2329,11 @@
"resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
"integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg=="
},
"colors": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz",
"integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w="
},
"combined-stream": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz",
@ -2512,6 +2517,11 @@
"cssom": "0.3.x"
}
},
"cycle": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz",
"integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI="
},
"dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
@ -2573,6 +2583,11 @@
"resolved": "https://registry.npmjs.org/deep-diff/-/deep-diff-0.3.8.tgz",
"integrity": "sha1-wB3mPvsO7JeYgB1Ax+Da4ltYLIQ="
},
"deep-equal": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
"integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU="
},
"deep-is": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
@ -3431,6 +3446,11 @@
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
"dev": true
},
"eyes": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz",
"integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A="
},
"fancy-log": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz",
@ -4460,6 +4480,11 @@
"sshpk": "^1.7.0"
}
},
"i": {
"version": "0.3.6",
"resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz",
"integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0="
},
"iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@ -4868,8 +4893,7 @@
"isstream": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
"dev": true
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
},
"istanbul-api": {
"version": "1.3.7",
@ -7021,6 +7045,11 @@
"integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
"dev": true
},
"ncp": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/ncp/-/ncp-0.4.2.tgz",
"integrity": "sha1-q8xsvT7C7Spyn/bnwfqPAXhKhXQ="
},
"negotiator": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
@ -7477,6 +7506,11 @@
"find-up": "^2.1.0"
}
},
"pkginfo": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz",
"integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8="
},
"plist": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz",
@ -7554,6 +7588,18 @@
"asap": "~2.0.3"
}
},
"prompt": {
"version": "0.2.14",
"resolved": "https://registry.npmjs.org/prompt/-/prompt-0.2.14.tgz",
"integrity": "sha1-V3VPZPVD/XsIRXB8gY7OYY8F/9w=",
"requires": {
"pkginfo": "0.x.x",
"read": "1.0.x",
"revalidator": "0.1.x",
"utile": "0.2.x",
"winston": "0.8.x"
}
},
"prompts": {
"version": "0.1.14",
"resolved": "https://registry.npmjs.org/prompts/-/prompts-0.1.14.tgz",
@ -7815,6 +7861,17 @@
"prop-types": "^15.5.7"
}
},
"react-native-cli": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/react-native-cli/-/react-native-cli-2.0.1.tgz",
"integrity": "sha1-8s08eqG4OCjN+6Yw4t/YF992bVQ=",
"requires": {
"chalk": "^1.1.1",
"minimist": "^1.2.0",
"prompt": "^0.2.14",
"semver": "^5.0.3"
}
},
"react-native-confirmation-code-input": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/react-native-confirmation-code-input/-/react-native-confirmation-code-input-1.0.4.tgz",
@ -7968,6 +8025,17 @@
"resolved": "https://registry.npmjs.org/react-native-network-info/-/react-native-network-info-4.0.1.tgz",
"integrity": "sha512-ZeSkeBL/fHsFR6sAOVHMd4oMknCwsbEeL+Zewec1/3ielg8k9YcddK3wymXS7kvwV0mTB2ji4X5tI0b7XY0sDA=="
},
"react-native-offline": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/react-native-offline/-/react-native-offline-4.3.0.tgz",
"integrity": "sha512-hM+rNGHKpmagseFuhnok/c7uCrMqs70fHRzaqGBCKnTsio6ff3/wb7jomsuRjsR1Iy+DwBws+VUovcfpQAtuBQ==",
"requires": {
"lodash": "^4.17.11",
"react-redux": "^6.0.0",
"redux": "4.x",
"redux-saga": "^0.16.2"
}
},
"react-native-permissions": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-1.1.1.tgz",
@ -7981,6 +8049,14 @@
"prop-types": "^15.5.8"
}
},
"react-native-progress-bar-animated": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/react-native-progress-bar-animated/-/react-native-progress-bar-animated-1.0.6.tgz",
"integrity": "sha512-UPAAwxtBVV+sPwhgVd78SA7QybPshV5CydaV0GJyM+eZ89ikkZQSasAUAgIQwVVCW1Tj6XNrgizimXM9JdczeA==",
"requires": {
"prop-types": "^15.6.0"
}
},
"react-native-pull-to-refresh": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/react-native-pull-to-refresh/-/react-native-pull-to-refresh-2.1.3.tgz",
@ -8244,6 +8320,14 @@
"react-proxy": "^1.1.7"
}
},
"read": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz",
"integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=",
"requires": {
"mute-stream": "~0.0.4"
}
},
"read-pkg": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz",
@ -8308,6 +8392,11 @@
"resolved": "https://registry.npmjs.org/redux-persist/-/redux-persist-5.10.0.tgz",
"integrity": "sha512-sSJAzNq7zka3qVHKce1hbvqf0Vf5DuTVm7dr4GtsqQVOexnrvbV47RWFiPxQ8fscnyiuWyD2O92DOxPl0tGCRg=="
},
"redux-saga": {
"version": "0.16.2",
"resolved": "https://registry.npmjs.org/redux-saga/-/redux-saga-0.16.2.tgz",
"integrity": "sha512-iIjKnRThI5sKPEASpUvySemjzwqwI13e3qP7oLub+FycCRDysLSAOwt958niZW6LhxfmS6Qm1BzbU70w/Koc4w=="
},
"redux-thunk": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.3.0.tgz",
@ -8554,6 +8643,11 @@
"resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
"integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg=="
},
"revalidator": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz",
"integrity": "sha1-/s5hv6DBtSoga9axgZgYS91SOjs="
},
"rimraf": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
@ -9329,6 +9423,11 @@
"tweetnacl": "~0.14.0"
}
},
"stack-trace": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
"integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA="
},
"stack-utils": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz",
@ -9959,6 +10058,26 @@
"object.getownpropertydescriptors": "^2.0.3"
}
},
"utile": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/utile/-/utile-0.2.1.tgz",
"integrity": "sha1-kwyI6ZCY1iIINMNWy9mncFItkNc=",
"requires": {
"async": "~0.2.9",
"deep-equal": "*",
"i": "0.3.x",
"mkdirp": "0.x.x",
"ncp": "0.4.x",
"rimraf": "2.x.x"
},
"dependencies": {
"async": {
"version": "0.2.10",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz",
"integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E="
}
}
},
"utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
@ -10080,6 +10199,32 @@
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
},
"winston": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/winston/-/winston-0.8.3.tgz",
"integrity": "sha1-ZLar9M0Brcrv1QCTk7HY6L7BnbA=",
"requires": {
"async": "0.2.x",
"colors": "0.6.x",
"cycle": "1.0.x",
"eyes": "0.1.x",
"isstream": "0.1.x",
"pkginfo": "0.3.x",
"stack-trace": "0.0.x"
},
"dependencies": {
"async": {
"version": "0.2.10",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz",
"integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E="
},
"pkginfo": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.3.1.tgz",
"integrity": "sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE="
}
}
},
"wordwrap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",

View File

@ -19,6 +19,7 @@
"react-native-app-intro-slider": "^1.0.1",
"react-native-camera": "^1.9.2",
"react-native-check-box": "^2.1.7",
"react-native-cli": "^2.0.1",
"react-native-confirmation-code-input": "^1.0.4",
"react-native-device-info": "^0.26.4",
"react-native-elements": "^1.0.0",
@ -35,6 +36,7 @@
"react-native-network-info": "^4.0.1",
"react-native-offline": "^4.3.0",
"react-native-progress": "^3.5.0",
"react-native-progress-bar-animated": "^1.0.6",
"react-native-pull-to-refresh": "^2.1.3",
"react-native-qrcode-scanner": "^1.1.2",
"react-native-shadow": "^1.2.2",