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

This commit is contained in:
José Valdiviesso 2019-03-14 16:51:08 +00:00
commit 166384ee7f
38 changed files with 5348 additions and 3638 deletions

View File

@ -149,6 +149,7 @@ android {
}
dependencies {
compile project(':react-native-maps')
compile project(':react-native-device-info')
compile project(':react-native-material-shadows')
compile project(':react-native-linear-gradient')

View File

@ -1,27 +1,30 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app">
package="com.app">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyAwM2Q3T62uh6BPDXcFPqdjXy8F7SI0WH4"/>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
</application>
</manifest>

View File

@ -3,6 +3,7 @@ package com.app;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.airbnb.android.react.maps.MapsPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import ui.materialshadows.RNMaterialShadowsPackage;
import com.BV.LinearGradient.LinearGradientPackage;
@ -29,6 +30,7 @@ public class MainApplication extends Application implements ReactApplication {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new MapsPackage(),
new RNDeviceInfo(),
new RNMaterialShadowsPackage(),
new LinearGradientPackage(),

View File

@ -1,4 +1,6 @@
rootProject.name = 'app'
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
include ':react-native-material-shadows'
@ -11,5 +13,7 @@ include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
include ':app'

File diff suppressed because it is too large Load Diff

View File

@ -3,16 +3,23 @@ import {
TouchableOpacity,
Text,
View,
Image
Image,
} from 'react-native';
import {
createStackNavigator,
createAppContainer,
createSwitchNavigator,
createBottomTabNavigator
createBottomTabNavigator,
HeaderBackButton
} from 'react-navigation';
import * as Screens from './screens';
/*Icons*/
import Icon from "react-native-vector-icons/Ionicons"
import IconF from "react-native-vector-icons/Foundation"
import IconFA from "react-native-vector-icons/FontAwesome5"
import AuthLoadingScreen from './screens/AuthLoading'
@ -25,16 +32,18 @@ import Calendar from './screens/Calendar'
import Home from './screens/Home'
/*Icons*/
import Icon from "react-native-vector-icons/Ionicons"
import IconF from "react-native-vector-icons/Foundation"
import IconFA from "react-native-vector-icons/FontAwesome5"
import Profile from "./screens/Profile";
import editCalendar from './screens/editCalendar';
import choosePath from './screens/choosePath';
import calendarDetail from './screens/calendarDetail';
import FebradaDetail from './screens/FebradaDetail';
import resetPassword from './screens/resetPassword';
const navigationOptions = ({navigation}) => ({
headerLeft: <HeaderBackButton onPress={() => navigation.goBack(null)}/>,
headerStyle: {backgroundColor: 'transparent', zIndex: 100 },
});
const AppStack = createBottomTabNavigator(
{
@ -48,15 +57,15 @@ const AppStack = createBottomTabNavigator(
)
},
},
'Jogo do...': {
screen: Jogo,
navigationOptions: {
tabBarIcon: ({tintColor}) => (
<Image style={{width:30, height:30}}source={require('./assets/img/logo2.png')}></Image>
<Image style={{width: 30, height: 30}} source={require('./assets/img/logo2.png')}></Image>
)
},
},
@ -71,8 +80,8 @@ const AppStack = createBottomTabNavigator(
},
},
Eventos: {
Eventos: {
screen: Eventos,
navigationOptions: {
@ -82,7 +91,7 @@ const AppStack = createBottomTabNavigator(
)
},
},
Home: {
screen: Home,
navigationOptions: {
@ -94,10 +103,9 @@ const AppStack = createBottomTabNavigator(
},
},
{
initialRouteName: 'Home',
initialRouteName: 'Eventos',
tabBarOptions: {
showLabel: true, // hide labels
@ -115,56 +123,67 @@ const Stack = createStackNavigator({
screen: AppStack,
navigationOptions: ({navigation}) => {
const index = navigation.state.index;
if (navigation.state.routes[index].routeName == 'Home') {
return {
headerTitle: `${navigation.state.routes[index].routeName}`,
headerRight: (
<TouchableOpacity style={{marginRight: 20, flex:1, flexDirection:'row'}} onPress={() => navigation.navigate('Profile')}>
<TouchableOpacity style={{marginRight: 20, flex: 1, flexDirection: 'row'}}
onPress={() => navigation.navigate('Profile')}>
<Text>editar</Text>
<IconFA name="user-edit" size={22}/>
</TouchableOpacity>
)
}
}
else if(navigation.state.routes[index].routeName == 'Calendário'){
else if (navigation.state.routes[index].routeName == 'Calendário') {
return {
headerTitle: 'Calendário',
headerRight: (
<View style={{flex:1, flexDirection:'row'}}>
<TouchableOpacity style={{marginRight: 20, flex:1, flexDirection:'row'}} onPress={() => navigation.navigate('Edit')}>
<Text>FAQ</Text>
</TouchableOpacity>
<View style={{flex: 1, flexDirection: 'row'}}>
<TouchableOpacity style={{marginRight: 20, flex: 1, flexDirection: 'row'}}
onPress={() => navigation.navigate('Edit')}>
<Text>FAQ</Text>
</TouchableOpacity>
<TouchableOpacity style={{marginRight: 20, flex: 1, flexDirection: 'row'}}
onPress={() => navigation.navigate('choosePath')}>
<Text>Escolher</Text>
<IconFA name="user-edit" size={22}/>
</TouchableOpacity></View>
<TouchableOpacity style={{marginRight: 20, flex:1, flexDirection:'row'}} onPress={() => navigation.navigate('choosePath')}>
<Text>Escolher</Text>
<IconFA name="user-edit" size={22}/>
</TouchableOpacity></View>
)
}
}
else if(navigation.state.routes[index].routeName == 'choosePath'){
}
else if (navigation.state.routes[index].routeName == 'choosePath') {
return {
headerTitle: 'Calendário',
headerRight: (
<View style={{flex:1, flexDirection:'row'}}>
<TouchableOpacity style={{marginRight: 20, flex:1, flexDirection:'row'}} onPress={() => navigation.navigate('Edit')}>
<Text>FAQ</Text>
</TouchableOpacity>
<View style={{flex: 1, flexDirection: 'row'}}>
<TouchableOpacity style={{marginRight: 20, flex: 1, flexDirection: 'row'}}
onPress={() => navigation.navigate('Edit')}>
<Text>FAQ</Text>
</TouchableOpacity>
<TouchableOpacity style={{marginRight: 20, flex: 1, flexDirection: 'row'}}
onPress={() => navigation.navigate('choosePath')}>
<Text>Escolher</Text>
<IconFA name="user-edit" size={22}/>
</TouchableOpacity></View>
<TouchableOpacity style={{marginRight: 20, flex:1, flexDirection:'row'}} onPress={() => navigation.navigate('choosePath')}>
<Text>Escolher</Text>
<IconFA name="user-edit" size={22}/>
</TouchableOpacity></View>
)
}
}
}
else if (navigation.state.routes[index].routeName == 'Eventos') {
return {
headerTitle: 'Eventos',
}
}
else {
return {
header: null
@ -175,18 +194,23 @@ const Stack = createStackNavigator({
Profile: {
screen: Profile
},
Edit:{
Edit: {
screen: editCalendar
},
choosePath:{
choosePath: {
screen: choosePath
},
calendarDetail:{
screen:calendarDetail
calendarDetail: {
screen: calendarDetail,
},
FebradaDetail: {
screen: FebradaDetail,
},
resetPassword:{
screen:resetPassword
}
});
@ -194,7 +218,7 @@ export default createAppContainer(createSwitchNavigator(
{
AuthLoading: AuthLoadingScreen,
App: Stack,
},
{

99
App/app/components/Nav.js Normal file
View File

@ -0,0 +1,99 @@
import React, { Component } from 'react'
import { StyleSheet, Text, View } from 'react-native'
import { Icon } from 'react-native-elements'
const styles = StyleSheet.create({
centerRow: {
alignItems: 'flex-start',
backgroundColor: 'transparent',
flex: 3,
flexDirection: 'column',
justifyContent: 'center',
},
container: {
backgroundColor: 'transparent',
borderBottomWidth: 0,
elevation: 0,
flexDirection: 'row',
height: 55,
justifyContent: 'center',
left: 0,
marginLeft: 10,
marginRight: 10,
//marginTop: 22,
position: 'absolute',
right: 0,
zIndex: 100,
},
icon: {
justifyContent: 'flex-start',
marginTop: 2.8,
},
iconContainer: {
alignSelf: 'center',
},
leftRow: {
backgroundColor: 'transparent',
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-start',
},
rightRow: {
alignItems: 'flex-end',
backgroundColor: 'transparent',
flex: 2,
flexDirection: 'row',
justifyContent: 'flex-end',
marginRight: 4,
},
titleText: {
color: '#000',
fontSize: 24,
fontWeight: '600',
},
subTitleText: {
color: '#000',
fontSize: 14,
fontWeight: '400',
},
});
class Nav extends Component {
render() {
const { navigation, title} = this.props;
return (
<View>
<View style={styles.container}>
<View style={styles.leftRow}>
<Icon
size={24}
name="arrow-back"
type="material-icon"
onPress={() => navigation.goBack(null)}
color= '#000'
iconStyle={styles.icon}
underlayColor="transparent"
underlineColorAndroid="transparent"
containerStyle={styles.iconContainer}
hitSlop={{ top: 15, bottom: 15, left: 15, right: 15 }}
/>
</View>
<View style={styles.centerRow}>
<Text style={styles.titleText} numberOfLines={1}>
{title}
</Text>
</View>
<View style={styles.rightRow}>
</View>
</View>
</View>
)
}
}
export default Nav

View File

@ -1,397 +1,426 @@
import * as React from 'react';
import {View, StyleSheet, Dimensions, Image, ScrollView, Text, Button, TouchableOpacity, Animated} from 'react-native';
import {TabView, TabBar, SceneMap} from 'react-native-tab-view';
import * as React from "react";
import {
RkButton, RkCard, RkText,
RkTheme
} from 'react-native-ui-kitten';
import Timeline from 'react-native-timeline-feed'
View,
StyleSheet,
Dimensions,
Image,
ScrollView,
Text,
Button,
TouchableOpacity,
Animated
} from "react-native";
import { TabView, TabBar, SceneMap } from "react-native-tab-view";
import { RkButton, RkCard, RkText, RkTheme } from "react-native-ui-kitten";
import Timeline from "react-native-timeline-feed";
import * as Progress from 'react-native-progress';
import * as Progress from "react-native-progress";
import { connect } from "react-redux";
import {connect} from 'react-redux';
import { bindActionCreators } from "redux";
import PTRView from 'react-native-pull-to-refresh';
import * as Actions from "../store/actions"; //Import your actionss
import {bindActionCreators} from 'redux';
const formatObj = obj => {
let a = {};
import * as Actions from '../store/actions'; //Import your actionss
const formatObj = (obj) => {
let a = {};
a.push({})
return a
a.push({});
return a;
};
const ThirdRoute = () => (
<View style={[styles.scene, {backgroundColor: '#efc44a'}]}/>
);
const FourthRoute = () => (
<View style={[styles.scene, {backgroundColor: '#49ef97'}]}/>
);
class Calendar extends React.Component {
state = {
index: 0,
routes: [
{key: 'first', weekDay: 'sex', day:12},
{key: 'second', weekDay: 'sab',day:13},
{key: 'third', weekDay: 'dom', day:14},
{key: 'fourth', weekDay: 'seg', day:15},
state = {
index: 0,
routes: [
{ key: "first", weekDay: "sex", day: 12 },
{ key: "second", weekDay: "sab", day: 13 },
{ key: "third", weekDay: "dom", day: 14 },
{ key: "fourth", weekDay: "seg", day: 15 }
],
CP: "SEM",
cpColor: "white",
careerPath: { name: "", color: "" }
};
],
};
componentDidMount() {
this.props.getEvents(this.props.user);
componentDidMount() {
this.props.getSessions(this.props.userDetails.token);
}
this.props.getEvents(this.props.user);
console.log('didMount');
console.log(this.props.events);
}
_openDetails = () => {
console.log("los");
};
_openDetails=()=>{
console.log("los");
}
renderDetail = ({item, index}) => {
const {navigate} = this.props.navigation;
// <Image source={{ uri:item.imageUrl, width:'100%' , height:100 }} style={{borderRadius:0}}/>
return (
<TouchableOpacity onPress={() => navigate('calendarDetail', { info: item })} >
<View style={styles.event}>
<View style={styles.titleContainer}>
<Text style={[styles.title]}>{item.name}</Text>
<Text style={{color:'black'}}>Local: 1</Text>
</View>
<View>
<Text style={styles.description}>{item.description}</Text>
<View style={styles.details}>
<Progress.Bar color={'#000000'} progress={item.Enrolled/item.MaxAttendees} unfilledColor={'white'} width={210}/>
<Text>{item.Enrolled} / {item.MaxAttendees}</Text>
</View>
</View>
</View>
</TouchableOpacity>
);
}
_update = () => {
this.setState({user: this.props.user});
console.log(this.props.events);
}
_renderTabBar = props => {
const inputRange = props.navigationState.routes.map((x, i) => i);
return (
<View style={styles.tabBar}>
{props.navigationState.routes.map((route, i) => {
const bgcolor = props.position.interpolate({
inputRange,
outputRange: inputRange.map(
inputIndex => (inputIndex === i ? '#CC1A17' : 'rgba(0,0,0,0)')
),
});
const color = props.position.interpolate({
inputRange,
outputRange: inputRange.map(
inputIndex => (inputIndex === i ? 'white' : 'black')
),
});
return (
<TouchableOpacity
style={styles.tabItem}
onPress={() => this.setState({ index: i })}>
<Animated.Text style={{ color :'#7A7B7B' }}>{route.weekDay}</Animated.Text>
<Animated.Text style={{ backgroundColor: bgcolor, borderRadius:90 , padding:10, marginTop:5, color:color, fontSize:15}}>{route.day}</Animated.Text>
</TouchableOpacity>
);
})}
renderDetail = ({ item, index }) => {
const { navigate } = this.props.navigation;
// <Image source={{ uri:item.imageUrl, width:'100%' , height:100 }} style={{borderRadius:0}}/>
return (
<TouchableOpacity
onPress={() => navigate("calendarDetail", { info: item })}
>
<View style={styles.event}>
<View style={styles.titleContainer}>
<Text style={[styles.title]}>{item.name}</Text>
<Text style={{ color: "black" }}>Local: 1</Text>
</View>
);
};
<View>
<Text style={styles.description}>{item.description}</Text>
<View style={styles.details}>
<Progress.Bar
color={"#000000"}
progress={0}
unfilledColor={"white"}
width={210}
/>
<Text>
{item.Enrolled} / {item.MaxAttendees}
</Text>
</View>
</View>
</View>
</TouchableOpacity>
);
};
constructor() {
_update = () => {
this.setState({ user: this.props.user });
console.log(this.props.events);
};
super()
_renderTabBar = props => {
const inputRange = props.navigationState.routes.map((x, i) => i);
const archeryImgSource = require('../assets/img/archery.png');
const badmintonImgSource = require('../assets/img/badminton.png');
const lunchImgSource = require('../assets/img/lunch.png');
const soccerImgSource = require('../assets/img/soccer.png');
const dumbbellImgSource = require('../assets/img/dumbbell.png');
return (
<View style={styles.tabBar}>
{props.navigationState.routes.map((route, i) => {
const bgcolor = props.position.interpolate({
inputRange,
outputRange: inputRange.map(inputIndex =>
inputIndex === i ? "#CC1A17" : "rgba(0,0,0,0)"
)
});
const color = props.position.interpolate({
inputRange,
outputRange: inputRange.map(inputIndex =>
inputIndex === i ? "white" : "black"
)
});
const ArcheryImage = (props) => <Image source={archeryImgSource} {...props} />;
const BadmintonImage = (props) => <Image source={badmintonImgSource} {...props} />;
const LunchImage = (props) => <Image source={lunchImgSource} {...props} />;
const SoccerImage = (props) => <Image source={soccerImgSource} {...props} />;
const DumbbellImage = (props) => <Image source={dumbbellImgSource} {...props} />;
const VectorIconImage = (props) => <Image source={vectorIconImgSource} {...props} />;
return (
<TouchableOpacity
style={styles.tabItem}
onPress={() => this.setState({ index: i })}
>
<Text style={{ color: "#7A7B7B" }}>
{route.weekDay}
</Text>
<Animated.Text
style={{
backgroundColor: bgcolor,
borderRadius: 0,
padding: 10,
marginTop: 5,
color: color,
fontSize: 15
}}
>
{route.day}
</Animated.Text>
</TouchableOpacity>
);
})}
</View>
);
};
this.data = [
constructor() {
super();
}
_refresh=()=>{
this.props.getEvents(this.props.user);
//this.props.getSessions(this.props.userDetails.token);
}
render() {
const ThirdRoute = () => (
<ScrollView contentContainerStyle={styles.contentContainer}>
{this.props.events != undefined && (
<Timeline
data={this.props.c}
timeContainerStyle={{ marginTop: 0 }}
timeStyle={{
textAlign: "center",
height: 100,
color: "#CC1A17",
padding: 5,
fontSize: 23
}}
descriptionStyle={{ color: "red" }}
renderDetail={this.renderDetail}
lineColor="rgba(0,0,0,0)"
lineWidth={1}
separator={false}
flatListProps={{
style: {
margin: 15
}
}}
circleSize={0}
dotColor={"#CC1A17"}
keyExtractor={(item, index) => index.toString()}
/>
)}
</ScrollView>
);
const FourthRoute = () => (
<ScrollView contentContainerStyle={styles.contentContainer}>
{this.props.events != undefined && (
<Timeline
data={this.props.d}
timeContainerStyle={{ marginTop: 0 }}
timeStyle={{
textAlign: "center",
// backgroundColor: 'red',
]
}
height: 100,
color: "#CC1A17",
padding: 5,
//marginTop:10,
// fontWeight:'bold',
fontSize: 23
render() {
//borderRadius: 13
}}
descriptionStyle={{ color: "red" }}
renderDetail={this.renderDetail}
lineColor="rgba(0,0,0,0)"
lineWidth={1}
separator={false}
flatListProps={{
style: {
margin: 15
}
}}
circleSize={0}
dotColor={"#CC1A17"}
keyExtractor={(item, index) => index.toString()}
/>
)}
</ScrollView>
);
const FirstRoute = () => (
<ScrollView contentContainerStyle={styles.contentContainer}>
{this.props.events != undefined && (
<Timeline
data={this.props.a}
timeContainerStyle={{ marginTop: 0 }}
timeStyle={{
textAlign: "center",
height: 100,
color: "#CC1A17",
padding: 5,
fontSize: 23
}}
descriptionStyle={{ color: "red" }}
renderDetail={this.renderDetail}
lineColor="rgba(0,0,0,0)"
lineWidth={1}
separator={false}
flatListProps={{
style: {
margin: 15
}
}}
circleSize={0}
dotColor={"#CC1A17"}
keyExtractor={(item, index) => index.toString()}
/>
)}
</ScrollView>
);
const SecondRoute = () => (
<ScrollView contentContainerStyle={styles.contentContainer}>
{this.props.events != undefined && (
<Timeline
data={this.props.b}
timeContainerStyle={{ marginTop: 0 }}
timeStyle={{
textAlign: "center",
const FirstRoute = () => (
height: 100,
color: "#CC1A17",
padding: 5,
<ScrollView contentContainerStyle={styles.contentContainer}>
fontSize: 23
<Timeline
//borderRadius: 13
}}
descriptionStyle={{ color: "red" }}
renderDetail={this.renderDetail}
lineColor="rgba(0,0,0,0)"
lineWidth={1}
separator={false}
flatListProps={{
style: {
margin: 15
}
}}
circleSize={0}
dotColor={"#CC1A17"}
keyExtractor={(item, index) => index.toString()}
/>
)}
</ScrollView>
);
data={this.props.events}
return (
<View style={{ flex: 1 }}>
timeContainerStyle={{ marginTop: 0}}
timeStyle={{
textAlign: 'center',
// backgroundColor: 'red',
height:100,
color:"#CC1A17",
padding: 5,
//marginTop:10,
// fontWeight:'bold',
fontSize:23,
//borderRadius: 13
}}
descriptionStyle={{color: 'red'}}
renderDetail={this.renderDetail}
lineColor='rgba(0,0,0,0)'
lineWidth={1}
separator={false}
flatListProps={{
style: {
margin: 15
}
}}
keyExtractor={(item, index) => index.toString()}
/>
</ScrollView>
)
const SecondRoute = () => (
<ScrollView contentContainerStyle={styles.contentContainer}>
<Timeline
data={this.props.events}
timeContainerStyle={{ marginTop: 0}}
timeStyle={{
textAlign: 'center',
// backgroundColor: 'red',
height:100,
color:"#CC1A17",
padding: 5,
//marginTop:10,
// fontWeight:'bold',
fontSize:23,
//borderRadius: 13
}}
descriptionStyle={{color: 'red'}}
renderDetail={this.renderDetail}
lineColor='rgba(0,0,0,0)'
lineWidth={1}
separator={false}
flatListProps={{
style: {
margin: 15
}
}}
keyExtractor={(item, index) => index.toString()}
/>
</ScrollView>
)
<View>
{this.props.careerPath != undefined && (
<Text
style={{
backgroundColor: this.props.careerPath.color,
color: "white",
fontWeight: "bold",
fontSize: 15,
textAlign: "center",
padding:15
}}
>
{this.props.careerPath.name}
</Text>
)}
</View>
<TabView
navigationState={this.state}
renderScene={SceneMap({
first: FirstRoute,
second: SecondRoute,
third: ThirdRoute,
fourth: FourthRoute
})}
renderTabBar={this._renderTabBar}
useNativeDriver={false}
onIndexChange={index => this.setState({ index })}
initialLayout={{
width: Dimensions.get("window").width,
height: Dimensions.get("window").height
}}
style={{ backgroundColor: "#F2F2F2" }}
indicatorStyle={{ backgroundColor: "pink" }}
/>
<Button onPress={this._refresh} title="Refresh" color="#841584"
/>
</View>
return (
<View style={{flex:1}}>
<View>
<Text style={{
backgroundColor:"#CC1A17",
color:'white',
fontWeight:'bold',
fontSize:15,
textAlign:'center',
}}>
WEB DEVELOPMENT
</Text>
</View>
<TabView
navigationState={this.state}
renderScene={SceneMap({
first: FirstRoute,
second: SecondRoute,
third: ThirdRoute,
fourth: FourthRoute
})}
renderTabBar={this._renderTabBar}
useNativeDriver={true}
onIndexChange={index => this.setState({index})}
initialLayout={{width: Dimensions.get('window').width, height: Dimensions.get('window').height}}
style={{backgroundColor:"#F2F2F2"}}
indicatorStyle={{ backgroundColor: 'pink' }}
/>
</View>
);
}
);
}
}
const styles = StyleSheet.create({
tabBar: {
flexDirection: 'row',
paddingTop:0,
marginTop:0,
backgroundColor:'white',
borderWidth: 1,
borderRadius: 2,
borderColor: '#ddd',
borderBottomWidth: 0,
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.8,
shadowRadius: 2,
elevation: 2,
},
tabItem: {
flex: 1,
alignItems: 'center',
padding: 10,
},
details: {
backgroundColor: "#FFFFFF",
borderBottomRightRadius: 10,
borderBottomLeftRadius: 10,
padding: 10,
paddingTop:0
},
description: {
padding: 10,
paddingLeft:0,
paddingTop:0
},
title: {
color: '#212121',
fontWeight: 'bold',
fontSize: 15,
},
titleContainer:{
padding: 10
},
event: {
borderRadius: 5,
backgroundColor: "#FFFFFF",
marginLeft:-25,
tabBar: {
flexDirection: "row",
paddingTop: 0,
marginTop: 0,
backgroundColor: "white",
borderWidth: 1,
borderRadius: 2,
borderColor: "#ddd",
borderBottomWidth: 0,
shadowColor: "#000",
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.8,
shadowRadius: 2,
elevation: 2
},
tabItem: {
flex: 1,
alignItems: "center",
padding: 10
},
details: {
backgroundColor: "#FFFFFF",
borderBottomRightRadius: 10,
borderBottomLeftRadius: 10,
padding: 10,
paddingTop: 0
},
description: {
padding: 10,
paddingLeft: 0,
paddingTop: 0
},
title: {
color: "#212121",
fontWeight: "bold",
fontSize: 15
},
titleContainer: {
padding: 10
},
event: {
borderRadius: 5,
backgroundColor: "#FFFFFF",
marginLeft: -25,
shadowColor: "#000",
shadowOffset: { width: 0, height: 2,},
shadowOpacity: 0.25,
shadowRadius: 1,
elevation: 2,
marginRight:2
},
scene: {
flex: 1,
},
contentContainer: {
//paddingVertical: 20,
backgroundColor:'#F2F2F2'
}
shadowColor: "#000",
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.25,
shadowRadius: 1,
elevation: 2,
marginRight: 2
},
scene: {
flex: 1
},
contentContainer: {
//paddingVertical: 20,
backgroundColor: "#F2F2F2"
}
});
RkTheme.setType('RkCard', 'story', {
img: {
height: 100,
opacity: 0.7
},
header: {
alignSelf: 'center'
},
content: {
alignSelf: 'center'
}
RkTheme.setType("RkCard", "story", {
img: {
height: 100,
opacity: 0.7
},
header: {
alignSelf: "center"
},
content: {
alignSelf: "center"
}
});
function mapStateToProps(state, props) {
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events
}
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events,
userDetails: state.apiReducer.userDetails,
sessions: state.apiReducer.sessions,
careerPath: state.apiReducer.careerPath,
a: state.apiReducer.a,
b: state.apiReducer.b,
c: state.apiReducer.c,
d: state.apiReducer.d
};
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
return bindActionCreators(Actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(Calendar);
export default connect(
mapStateToProps,
mapDispatchToProps
)(Calendar);

View File

@ -1,57 +1,142 @@
import * as React from 'react';
import {
View,
StyleSheet,
Dimensions,
Text
} from 'react-native';
import { TabView, TabBar, SceneMap } from 'react-native-tab-view';
import * as React from "react";
import {View, StyleSheet, Dimensions, Text, Button, ScrollView, Image, TouchableOpacity} from "react-native";
import {TabView, TabBar, SceneMap} from "react-native-tab-view";
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
const FirstRoute = () => (
<View style={[styles.scene, { backgroundColor: '#ff4081' }]} />
<View style={[styles.scene, {backgroundColor: "#ff4081"}]}/>
);
const SecondRoute = () => (
<View style={[styles.scene, { backgroundColor: '#673ab7' }]} />
<View style={[styles.scene, {backgroundColor: "#673ab7"}]}/>
);
const ThirdRoute = () => (
<View style={[styles.scene, { backgroundColor: '#673ab7' }]} />
<View style={[styles.scene, {backgroundColor: "#673ab7"}]}/>
);
const FourthRoute = () => (
<View style={[styles.scene, { backgroundColor: '#673ab7' }]} />
<View style={[styles.scene, {backgroundColor: "#673ab7"}]}/>
);
export default class Eventos extends React.Component {
state = {
index: 0,
routes: [
{key: "first", title: "Festarola"},
{key: "second", title: "Febrada"},
{key: "third", title: "Rally"},
{key: "fourth", title: "Peddy"}
]
};
renderFebrada = (navigate) => {
return (
<View>
<TouchableOpacity onPress={() => navigate('FebradaDetail')}>
<View style={styles.cardContainer}>
<Image
style={{
flex: 1,
width: undefined,
height: undefined
}}
resizeMode="contain"
source={require('../assets/altice_logo.png')}
>
</Image>
</View>
</TouchableOpacity>
export default class Eventos extends React.Component {
state = {
index: 0,
routes: [
{ key: 'first', title: 'Festarola' },
{ key: 'second', title: 'Febrada' },
{ key: 'third', title: 'Rally' },
{ key: 'fourth', title: 'Peddy' },
</View>
);
],
};
};
render() {
return (
<View>
<Text>asd</Text>
</View>
);
}
renderRally = () => {
return (
<View>
<View style={styles.cardContainer}>
<Image
style={{
flex: 1,
width: undefined,
height: undefined
}}
resizeMode="contain"
source={require('../assets/altice_logo.png')}
>
</Image>
</View>
</View>
);
};
renderCaching = () => {
return (
<View>
<View style={styles.cardContainer}>
<Image
style={{
flex: 1,
width: undefined,
height: undefined
}}
resizeMode="contain"
source={require('../assets/altice_logo.png')}
>
</Image>
</View>
</View>
);
};
render() {
const {navigate} = this.props.navigation;
return (
<View style={styles.container}>
<ScrollView styles={styles.scroll}>
{this.renderFebrada(navigate)}
{this.renderRally()}
{this.renderCaching()}
</ScrollView>
</View>
);
}
}
const styles = StyleSheet.create({
scene: {
flex: 1,
},
});
container: {
backgroundColor: '#eee',
flex: 1,
flexGrow: 1,
flexDirection: 'column',
},
scroll: {
flex: 1,
},
cardContainer: {
flex: 1,
padding: 10,
margin: 20,
backgroundColor: '#fff',
height: SCREEN_WIDTH * (1 / 2),
borderRadius: 5,
//borderWidth: 2,
},
scene: {
flex: 1
}
});

View File

@ -0,0 +1,246 @@
import * as React from 'react';
import {
View,
StyleSheet,
Dimensions,
ScrollView,
Text,
ImageBackground
} from 'react-native';
import {Divider} from 'react-native-elements'
import AppIntroSlider from 'react-native-app-intro-slider';
import NavAbsolute from '../components/Nav';
import * as Actions from "../store/actions";
import {connect} from "react-redux";
import {bindActionCreators} from "redux";
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
class FebradaDetail extends React.Component {
static navigationOptions = ({navigation}) => ({
header: (
<NavAbsolute
navigation={navigation}
// title={navigation.state.params.info.name}
/>
),
});
renderHeader = () => {
return (
<View style={styles.headerContainer}>
<View style={styles.coverContainer}>
<ImageBackground
source={{
uri: 'https://upload.wikimedia.org/wikipedia/commons/9/94/Logo_TvAAC_2014.png',
}}
style={styles.coverImage}
>
</ImageBackground>
</View>
</View>
)
};
renderDescription = () => {
return (
<View style={{height: SCREEN_HEIGHT * (1 / 3)}}>
<View
style={{flexDirection: "row"}}>
<View style={styles.header}>
<View style={styles.nameText}>
<Text
style={{color: '#CC1A17', fontSize: 20}}>Febrada</Text>
</View>
<View style={styles.timeText}>
<Text style={{color: "#CC1A17", fontSize: 15}}>
<Text style={{color: "#CC1A17", fontSize: 15}}>
Sexta 12 -
</Text>
14h00{/*{info.time === info.timeEnd ? info.time : `${info.time} - ${info.timeEnd}`}*/}
</Text>
</View>
</View>
</View>
<View style={styles.descContainer}>
<Text style={{fontSize: 20, color: '#CC1A17'}}>Descrição</Text>
<Divider style={{backgroundColor: '#000'}}/>
<Text style={{paddingRight: 10, paddingTop: 10}}>g</Text>
</View>
</View>
)
};
renderSlider = () => {
const slides = [
{
key: 'somethun',
title: 'Title 1',
titleStyle: '',
text: 'blblbalbalba',
textStyle: '',
backgroundColor: '#59b2ab',
},
{
key: 'somethun-dos',
title: 'Title 2',
titleStyle: '',
text: 'blblbalbalba',
textStyle: '',
backgroundColor: '#febe29',
},
{
key: 'somethun1',
title: 'Rocket guy',
titleStyle: '',
text: 'blblbalbalba',
textStyle: '',
backgroundColor: '#22bcb5',
}
];
return (
<AppIntroSlider
slides={slides}
style={{height: SCREEN_WIDTH * 0.54}}
activeDotStyle={{backgroundColor:'#CC1A17'}}
renderDoneButton={this._buyFinosOrBifanas()}
renderNextButton={this._renderNextButton}
/>
)
};
_buyFinosOrBifanas = () => {
//Modal
};
render() {
return (
<View style={styles.mainViewStyle}>
<ScrollView style={styles.scroll}>
<View style={styles.container}>
<View style={styles.headerContainer}>
{this.renderHeader()}
</View>
<View style={{backgroundColor: "#fff"}}>
{this.renderDescription()}
{this.renderSlider()}
</View>
</View>
</ScrollView>
</View>
)
}
}
const styles = StyleSheet.create({
mainContent: {
flex: 1,
alignItems: 'center',
justifyContent: 'space-around',
},
text: {
//color: 'rgba(255, 255, 255, 0.8)',
backgroundColor: 'transparent',
textAlign: 'center',
color:'#000',
paddingHorizontal: 16,
},
title: {
fontSize: 22,
color: 'white',
backgroundColor: 'transparent',
textAlign: 'center',
marginBottom: 16,
},
header: {
flex: 1,
flexDirection: 'row',
padding: 10,
backgroundColor: 'white',
//height: SCREEN_HEIGHT * (1 / 3),
},
nameText: {
alignSelf: 'flex-start',
flex: 1,
},
timeText: {
alignItems: 'flex-end',
flex: 1,
marginRight: 4,
},
mainViewStyle: {
flex: 1,
flexGrow: 1,
flexDirection: 'column',
},
scroll: {
backgroundColor: '#eee',
flex: 1,
//marginBottom: 55,
},
descContainer: {
padding: 10,
},
headerContainer: {
flex: 1,
},
container: {
flex: 1,
flexDirection: 'column',
},
coverContainer: {
position: 'relative',
},
coverImage: {
height: Dimensions.get('window').width * (2 / 4),
width: Dimensions.get('window').width,
},
});
function mapStateToProps(state, props) {
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events,
careerPath: state.apiReducer.careerPath,
}
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(FebradaDetail);

View File

@ -1,338 +1,429 @@
import React, {Component} from 'react';
import React, { Component } from "react";
import {
Button,
View,
Text,
TouchableOpacity,
FlatList,
ActivityIndicator,
Dimensions,
StyleSheet,
Image,
ImageBackground,
NetInfo,
AppState
} from 'react-native';
Button,
View,
Text,
TouchableOpacity,
FlatList,
ActivityIndicator,
Dimensions,
StyleSheet,
Image,
ImageBackground,
NetInfo,
AppState
} from "react-native";
import {Shadow} from 'react-native-shadow'
import Icon from "react-native-vector-icons/Ionicons"
import {
RkButton,
RkTheme
} from 'react-native-ui-kitten';
import { Shadow } from "react-native-shadow";
import Icon from "react-native-vector-icons/Ionicons";
import { RkButton, RkTheme } from "react-native-ui-kitten";
import { connect } from "react-redux";
import {connect} from 'react-redux';
import { bindActionCreators } from "redux";
import {bindActionCreators} from 'redux';
import * as Actions from '../store/actions'; //Import your actionss
import * as Actions from "../store/actions"; //Import your actionss
import ImageOverlay from "react-native-image-overlay";
import {createStore} from 'redux';
import PTRView from 'react-native-pull-to-refresh';
import {Provider} from 'react-redux'
import { ScrollView } from 'react-native-gesture-handler';
import { createStore } from "redux";
import PTRView from "react-native-pull-to-refresh";
import { Provider } from "react-redux";
import { ScrollView } from "react-native-gesture-handler";
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
import {Card, Divider} from 'react-native-elements'
import RNMaterialShadows from 'react-native-material-shadows';
import { Card, Divider } from "react-native-elements";
import RNMaterialShadows from "react-native-material-shadows";
import IconFA from "react-native-vector-icons/FontAwesome5";
class Home extends Component {
_handleConnectionChange = (isConnected) => {
// this.props.dispatch(connectionState({ status: isConnected }));
console.log("fck that")
};
_refresh() {
return new Promise((resolve) => {
setTimeout(()=>{resolve()}, 2000)
});
}
_callApi(){
this.props.getUserInfo(this.props.token);
}
constructor(props) {
_handleConnectionChange = isConnected => {
// this.props.dispatch(connectionState({ status: isConnected }));
console.log("fck that");
};
_refresh() {
return new Promise(resolve => {
setTimeout(() => {
resolve();
}, 2000);
});
}
_callApi() {
this.props.getUserInfo(this.props.token);
}
constructor(props) {
super(props);
super(props);
this.state = {
token: { valid: false },
logged: true,
onHold: true,
user: { Name: "" },
userDetails: {},
appState: AppState.currentState
};
}
handleConnectivityChange = () => {
console.log("asdasdasdasdasd");
};
this.state = {
componentDidMount() {
// NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange);
token: {valid: false},
logged: true,
onHold: true,
user: {Name: ''},
userDetails:{},
appState: AppState.currentState,
};
}
handleConnectivityChange = () => {
console.log("asdasdasdasdasd");
}
// this.props.hold();
console.log("hold" + this.props.onHold);
//this.props.logoutUser();
componentDidMount() {
// NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange);
//console.log(this.props.token);
// this.props.hold();
console.log("hold"+ this.props.onHold)
//this.props.logoutUser();
//console.log(this.props.token);
this.props.getUserInfo(this.props.userDetails.token);
//console.log('logged:'+this.props.logged);
//console.log(th2is.props)
}
componentWillUnmount() {
}
bClick() {
//this.props.logoutUser();
let a = {};
// this.setState({ user: this.props.user });
// console.log(this.props.user)
//
//var navigate = this.props.navigation.navigate
}
_update=()=>{
this.props.getUserInfo(this.props.userDetails.token);
}
render() {
//console.log('logged:'+this.props.logged);
const {navigate} = this.props.navigation;
//console.log(th2is.props)
}
componentWillUnmount() {}
if (this.props.onHold) {
bClick() {
//this.props.logoutUser();
return (
<View>
<Text>lollsss {this.props.onHold}</Text>
<ActivityIndicator size="large" color="#0000ff"/>
</View>
)
}
if (this.props.logged) {
let a = {};
// this.setState({ user: this.props.user });
// console.log(this.props.user)
//
return (
<PTRView onRefresh={this._update} >
<ScrollView style={{backgroundColor:'#eeeeee'}}>
<View>
<ImageBackground
opacity={0.9}
source={require('../assets/img/bg_3.jpg')}
style={{
width: '100%',
// marginTop:150,
backgroundColor: 'rgba(255,255,255,1)' ,
}
}>
<View style={styles.homeHeader}>
<View style={styles.userImageContainer}>
<Image style={styles.userImage} source={{uri: 'https://i.imgur.com/XXJ7LxV.jpg'}}/>
</View>
<Text style={styles.userText}>{this.props.user.Name}</Text>
<Text style={styles.userTextSub}>{this.props.user.Company}</Text>
</View>
</ImageBackground>
<View style={styles.userStats}>
<Text style={styles.userStatsTitle}>O meu saldo:</Text>
<View style={styles.userStatsBox}>
<View style={styles.userBox}>
<Icon name="ios-beer" style={styles.userStatsBoxIcon} size={50}/>
<Text style={styles.userBoxText}>0 Fino(s)</Text>
</View>
<View style={styles.userBox}>
<Icon name="ios-beer" style={styles.userStatsBoxIcon} size={50}/>
<Text style={styles.userBoxText}>0 Fino(s)</Text>
</View>
<View style={styles.userBox}>
<Icon name="ios-beer" style={styles.userStatsBoxIcon} size={50}/>
<Text style={styles.userBoxText}>0 Fino(s)</Text>
</View>
</View>
</View>
</View>
</ScrollView>
</PTRView>
);
}
else {
return (
<View>
<Text>sem permissões para aceder aqui</Text>
</View>
);
}
//var navigate = this.props.navigation.navigate
}
_update = () => {
this.props.getUserInfo(this.props.userDetails.token);
};
render() {
const { navigate } = this.props.navigation;
if (this.props.onHold) {
return (
<View>
<Text>lollsss {this.props.onHold}</Text>
<ActivityIndicator size="large" color="#0000ff" />
</View>
);
}
if (this.props.logged) {
return (
<PTRView onRefresh={this._update}>
<ScrollView style={{ backgroundColor: "#eeeeee" }}>
<View>
<ImageBackground
opacity={0.9}
source={require("../assets/img/bg_3.jpg")}
style={{
width: "100%",
// marginTop:150,
backgroundColor: "rgba(255,255,255,1)"
}}
>
<View style={styles.homeHeader}>
<View style={styles.userImageContainer}>
<Image
style={styles.userImage}
source={{ uri: "https://i.imgur.com/XXJ7LxV.jpg" }}
/>
</View>
{this.props.user != undefined && (
<Text style={styles.userText}>{this.props.user.Name}</Text>
)}
<Text style={styles.userTextSub}>
{this.props.user.Company}
</Text>
</View>
</ImageBackground>
<View style={styles.userStats}>
<View style={{backgroundColor:'orange'}}>
<Text style={styles.userStatsTitle}>Informações Importantes</Text>
</View>
<View style={styles.userStatsBox}>
<Text style={{margin:10}}>Grupo de ....</Text>
<Text style={{margin:10}}>Alojamento</Text>
</View>
</View>
<View>
<View
style={{
margin: 10,
marginTop: 20,
backgroundColor: "white",
borderRadius: 3
}}
>
<View style={{ backgroundColor: "#CC1A17" , flex:1, flexDirection:'row'}}>
<View style={{width:'79%'}}>
<Text
style={{
fontSize: 25,
color: "white",
margin: 10,
fontWeight: "bold",
marginBottom: 0
}}
>
Os tones
</Text>
<Text
style={{
color: "white",
marginLeft: 10,
marginBottom: 5
}}
>
5/6 elementos
</Text>
</View>
<View style={{alignItems:'center', alignContent:'center',alignSelf:'center'}}>
<IconFA name="plus" color={'white'} size={30} />
<Text style={{color:'white'}}>Adicionar</Text>
</View>
</View>
<View>
<View style={{ flex: 1 }}>
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
<Text>AFFJASDXZ</Text>
</View>
<TouchableOpacity style={styles.userRemove}>
<Text style={{fontWeight:'bold'}}>rm equipa</Text>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: "black" }} />
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
<Text>AFFJASDXZ</Text>
</View>
<TouchableOpacity style={styles.userRemove}>
<IconFA name="times" color={"#CC1A17"} size={30} />
<Text>remover</Text>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: "black" }} />
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
<Text>AFFJASDXZ</Text>
</View>
<TouchableOpacity style={styles.userRemove}>
<IconFA name="times" color={"#CC1A17"} size={30} />
<Text>remover</Text>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: "black" }} />
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
<Text>AFFJASDXZ</Text>
</View>
<TouchableOpacity style={styles.userRemove}>
<IconFA name="times" color={"#CC1A17"} size={30} />
<Text>remover</Text>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: "black" }} />
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
<Text>AFFJASDXZ</Text>
</View>
<TouchableOpacity style={styles.userRemove}>
<IconFA name="times" color={"#CC1A17"} size={30} />
<Text>remover</Text>
</TouchableOpacity>
</View>
</View>
</View>
</View>
</View>
</View>
</ScrollView>
</PTRView>
);
} else {
return (
<View>
<Text>sem permissões para aceder aqui</Text>
</View>
);
}
}
}
const styles = StyleSheet.create({
userBoxText:{
color:'white',
userName:{
fontSize:16,
fontWeight:'bold'
},
userStatsBoxIcon:{
color:'white'
},
userStatsBox:{
flex:1,
flexDirection:'row'
userRemove: {
alignContent: "center",
alignItems: "center",
alignSelf:'center'
},
userBox:{
alignItems:'center',
justifyContent:'center',
width:'33%',
userT: {
margin: 10,
},
userCurriculum:{
paddingTop:5,
color:'red',
fontWeight:'bold',
fontSize:15
},
userBioRow:{
flex:1,
flexDirection:'row',
padding:10,
},
userBioText:{
width: "55%",
// backgroundColor: "red"
},
userLogo: {
paddingLeft: 10,
},
userBioLogo:{
marginLeft: SCREEN_WIDTH*0.05,
width: SCREEN_WIDTH*0.15,
},
margin: 10
},
user: {
alignSelf: "center",
flex: 1,
flexDirection: "row",
userTextSub:{
backgroundColor: 'rgba(0,0,0,0.7)' ,
color:'white',
},
userText:{
backgroundColor: 'rgba(0,0,0,0.7)' ,
color:'white',
fontWeight:'bold',
fontSize:20,
},
homeHeader:{
flex:1,
height: SCREEN_HEIGHT*0.3,
justifyContent: 'center',
alignItems:'center' ,
},
userImage:{
width:110,
height:110,
borderWidth: 1,
borderRadius: 5,
borderWidth:2,
borderColor: 'white',
},
userBio:{
flex:1,
padding:10,
margin:9,
backgroundColor:'white',
// height: SCREEN_HEIGHT*0.20,
color:'black',
borderRadius:5,
},
userStats:{
backgroundColor:'#CC1A17',
height: SCREEN_HEIGHT*0.2,
padding:10,
margin:10,
borderRadius:5,
marginTop:10,
marginBottom:0
margin: 10,
},
userStatsTitle:{
color:'white',
fontSize:17,
fontWeight:'bold',
padding:1
},
userImageContainer:{
alignSelf: 'center',
// transform: [{ rotate: '-15deg'}],
}
marginTop: 5,
width: "100%"
},
userBoxText: {
color: "white",
fontWeight: "bold"
},
userStatsBoxIcon: {
color: "white"
},
userStatsBox: {
flex: 1,
backgroundColor:'white',
flexDirection: "row"
},
userBox: {
alignItems: "center",
justifyContent: "center",
width: "33%"
},
userCurriculum: {
paddingTop: 5,
color: "red",
fontWeight: "bold",
fontSize: 15
},
userBioRow: {
flex: 1,
flexDirection: "row",
padding: 10
},
userBioText: {},
userBioLogo: {
marginLeft: SCREEN_WIDTH * 0.05,
width: SCREEN_WIDTH * 0.15
},
userTextSub: {
backgroundColor: "rgba(0,0,0,0.7)",
color: "white"
},
userText: {
backgroundColor: "rgba(0,0,0,0.7)",
color: "white",
fontWeight: "bold",
fontSize: 20
},
homeHeader: {
flex: 1,
height: SCREEN_HEIGHT * 0.3,
justifyContent: "center",
alignItems: "center"
},
userImage: {
width: 110,
height: 110,
borderWidth: 1,
borderRadius: 5,
borderWidth: 2,
borderColor: "white"
},
userBio: {
flex: 1,
padding: 10,
margin: 9,
backgroundColor: "white",
// height: SCREEN_HEIGHT*0.20,
color: "black",
borderRadius: 5
},
userStats: {
backgroundColor: "white",
height: SCREEN_HEIGHT * 0.2,
// padding: 10,
margin: 10,
borderRadius: 5,
marginTop: 10,
marginBottom: 0
},
userStatsTitle: {
margin:10,
color: "white",
fontSize: 17,
fontWeight: "bold",
padding: 1
},
userImageContainer: {
alignSelf: "center"
// transform: [{ rotate: '-15deg'}],
}
});
function mapStateToProps(state, props) {
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
userDetails: state.apiReducer.userDetails,
onHold: state.apiReducer.onHold
}
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
userDetails: state.apiReducer.userDetails,
onHold: state.apiReducer.onHold
};
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
return bindActionCreators(Actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(Home);
export default connect(
mapStateToProps,
mapDispatchToProps
)(Home);

View File

@ -45,8 +45,8 @@ class Profile extends Component {
super(props);
this.state = {
name:this.props.user.Name,
userDetails:{},
name: this.props.user.Name,
userDetails: {},
token: false,
tokenData: '',
loggedIn: false,
@ -64,7 +64,7 @@ class Profile extends Component {
email: this.props.user.Email,
emailError: false,
emailErrorMessage: '',
emailErrorMessage: '',
phone: this.props.user.Mobile,
phoneError: false,
@ -78,19 +78,35 @@ class Profile extends Component {
cityError: false,
cityErrorMessage: '',
oldPass:'',
new1:'',
new2:'',
url:this.props.user.Url,
curso:this.props.user.LastName,
};
}
_press=()=>{
this.props.changePassword(
this.props.userDetails.token,
this.state.oldPass,
this.state.new1,
this.state.new2
)
}
_logout = () => {
this.props.logoutUser();
};
_validateData = (name,jobs, email, phone, address, city) => {
_validateData = (name, jobs, email, phone, address, city) => {
let valid = null;
v = Validate('name',name );
v = Validate('name', name);
let v = Validate('email', email);
@ -138,29 +154,28 @@ class Profile extends Component {
saveData() {
const {name,jobs, email, phone, address, city, formValid} = this.state;
const {name, jobs, email, phone, address, city, formValid, url,curso} = this.state;
this._validateData(name,jobs, email, phone, address, city);
// this._validateData(name, jobs, email, phone, address, city,curso);
console.log(formValid);
if (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",
this.props.updateUser(this.props.userDetails.token, {
Name: this.state.name,
Company: jobs,
LastName: curso,
Address: address,
City: city,
Mobile: phone,
Avatar: "base64",
Url:url,
Mobile: phone,
Avatar: "base64"
} ); this.props.getUserInfo(this.props.userDetails.token);
});
}
else
@ -176,27 +191,34 @@ class Profile extends Component {
<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>
<Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>Informações Pessoais</Text>
</View>
</View>
<View style={styles.userBio}>
<View style={styles.userBioRow}>
<Icon name="ios-person" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioLogo} >Nome</Text>
<TextInput style={styles.userBioText}
onChangeText={(n) => {
this.setState({name: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}/>
<Text style={styles.userBioLogo} >Curso</Text>
<TextInput style={styles.userBioText}
onChangeText={(cu) => {
this.setState({curso: cu})
}}
value={this.state.curso}/>
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Text style={styles.userBioLogo} >Faculdade</Text>
<TextInput style={styles.userBioText}
onChangeText={(job) => {
@ -206,10 +228,9 @@ class Profile extends Component {
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Icon name="ios-phone-portrait" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioLogo} >Telemóvel</Text>
<TextInput style={styles.userBioText}
onChangeText={(phone) => {
@ -221,7 +242,7 @@ class Profile extends Component {
<View style={styles.userBioRow}>
<Icon name="ios-map" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioLogo} >Morada</Text>
<TextInput style={styles.userBioText}
onChangeText={(add) => {
@ -233,22 +254,19 @@ class Profile extends Component {
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Icon name="ios-map" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioLogo} >LinkedIn</Text>
<TextInput style={styles.userBioText}
onChangeText={(city) => {
this.setState({city: city})
onChangeText={(u) => {
this.setState({url: u})
}}
value={this.state.city}/>
value={this.state.url}/>
</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.saveData() } title="Guardar Alterações" color="#CC1A17"
/>
</View>
</View>
@ -256,46 +274,77 @@ class Profile extends Component {
<View style={styles.container}>
<View style={styles.userBioRowHeader}>
<View style={styles.userBioRowTitle}>
<Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>Nova Password:</Text>
<Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>Alterar Password</Text>
</View>
</View>
<View style={styles.userBio}>
<View style={styles.userBioRow}>
<Text style={styles.userPassText} size={25}>
Old Password:
</Text>
<View style={styles.userBioRow}>
<TextInput style={styles.userBioText}
placeholder='Antiga Password' secureTextEntry={true}
placeholder='Antiga Password'
onChangeText={(old => {
this.setState({oldPass: old})
})}
value={this.state.oldPass}
maxLength = {20}
secureTextEntry={true}
/>
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Text style={styles.userPassText} size={25}>
Nova Password:
</Text>
<TextInput style={styles.userBioText}
placeholder='Nova Password' secureTextEntry={true}
placeholder='Nova Password'
secureTextEntry={true}
onChangeText={(newz => {
this.setState({new1: newz})
})}
value={this.state.new1}
maxLength = {20}
/>
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Text style={styles.userPassText} size={25}>
Repetir Password:
</Text>
<TextInput style={styles.userBioText}
placeholder='Repetir Password' secureTextEntry={true}
placeholder='Repetir Password'
secureTextEntry={true}
onChangeText={(newzz => {
this.setState({new2: newzz})
})}
value={this.state.new2}
maxLength = {20}
/>
</View>
<Button onPress={this._press} title="Alterar Password" color="#CC1A17"
/>
</View>
</View>
<TouchableOpacity onPress={this._logout} style={{
height: 50,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'black',
marginTop:30
}}>
<Text style={{color: "#fff", fontWeight: 'bold'}}>Logout</Text>
</TouchableOpacity>
</ScrollView>
<TouchableOpacity onPress={this._logout} style={{ height: 50, justifyContent: 'center', alignItems: 'center', backgroundColor: '#CC1A17'}}>
<Text style={{color:"#fff", fontWeight: 'bold'}}>Logout</Text>
</TouchableOpacity>
</View>
@ -330,23 +379,27 @@ const styles = StyleSheet.create({
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-start',
padding: 10
padding: 10,
// borderWidth: 2,
alignItems: 'center',
},
userBioText: {
width: SCREEN_WIDTH * 0.50,
width: SCREEN_WIDTH * 0.40,
flex: 2,
// borderWidth: 2,
},
userPassText: {
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-start',
//alignSelf: 'flex-start',
justifyContent: 'flex-end',
borderWidth: 2,
},
userBioLogo: {
marginLeft: SCREEN_WIDTH * 0.05,
width: SCREEN_WIDTH * 0.15,
marginLeft: 10,
width:80,
},
bottomLogOut: {

View File

@ -1,121 +1,174 @@
import React from 'react';
import { View, Image, Vibration, Dimensions,Text ,Button ,TouchableOpacity } from 'react-native';
import {View, Image, Vibration, Dimensions, Text, Button, TouchableOpacity, ActivityIndicator} from 'react-native';
import QRCodeScanner from 'react-native-qrcode-scanner';
import {UtilStyles} from '../assets/styles'
import CodeInput from 'react-native-confirmation-code-input';
import Modal from "react-native-modal";
import {TabView, TabBar, SceneMap} from 'react-native-tab-view';
import {
RkButton,
RkTheme, RkText
} from 'react-native-ui-kitten';
import {RkButton,
RkTheme , RkText} from 'react-native-ui-kitten';
import IconMI from "react-native-vector-icons/MaterialIcons"
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
export default class Scan extends React.Component {
_toggleModal = () =>
this.setState({ isModalVisible: !this.state.isModalVisible });
this.setState({isModalVisible: !this.state.isModalVisible});
_activate=()=>{
_activate = () => {
this.setState({ isModalVisible: !this.state.isModalVisible ,reactivate:true});
this.setState({isModalVisible: !this.state.isModalVisible, reactivate: true});
this.scanner.reactivate();
}
onSuccess = (e) => {
this.setState({ isModalVisible: !this.state.isModalVisible ,isActive:false});
this.setState({code:e.data});
};
this.setState({isModalVisible: !this.state.isModalVisible, isActive: false});
this.setState({code: e.data});
};
state = {
isActive:true,
isRender: true,
reactivate:false,
isModalVisible: false,
code:''
}
componentDidMount() {
state = {
isActive: true,
isRender: true,
reactivate: false,
isModalVisible: false,
code: '',
index: 0,
routes: [
{key: 'scan', title: 'Scan', icon: ''},
{key: 'history', title: 'Histórico', icon: 'history'},
{key: 'fav', title: 'Favoritos', icon: 'favorite'},
],
};
componentDidMount() {
this.props.navigation.addListener('willFocus', (route) => {
this.setState({ isRender: true })
this.setState({isRender: true})
});
this.props.navigation.addListener('willBlur', (route) => {
this.setState({ isRender: false })
this.setState({isRender: false})
});
}
render() {
{
}
return (
render() {
<View style={{flex: 1}}>
{ this.state.isRender &&
<QRCodeScanner
/*Screen SCAN*/
const scanScreen = () => (
<QRCodeScanner
showMarker
ref={(node) => { this.scanner = node }}
ref={(node) => {
this.scanner = node
}}
reactivate={false}
cameraProps={{captureAudio: false}}
onRead={this.onSuccess.bind(this)}
showMarker={true}
cameraStyle={{ height: SCREEN_HEIGHT }}
cameraStyle={{height: SCREEN_HEIGHT}}
fadeIn={true}
customMarker={
<View style={{ flex: 1 }}>
<Modal isVisible={this.state.isModalVisible} style={{backgroundColor:'#E8E8E8', borderRadius:30, height:100}}>
<View style={{ flex: 1 }}>
<Text></Text>
<Text> Qr code data: {this.state.code}</Text>
<Button onPress={this._activate} title="Close" color="#841584" accessibilityLabel="Learn more about this purple button"/>
</View>
</Modal>
</View>
<View style={{flex: 1}}>
<Modal isVisible={this.state.isModalVisible}
style={{backgroundColor: '#E8E8E8', borderRadius: 30, height: 100}}>
<View style={{flex: 1}}>
<Text></Text>
<Text> Qr code data: {this.state.code}</Text>
<Button onPress={this._activate} title="Close" color="#841584"
accessibilityLabel="Learn more about this purple button"/>
</View>
</Modal>
</View>
}
/>
}
</View>
)}
return (
<View style={{ flex: 1 }}>
<TouchableOpacity onPress={this._toggleModal}>
<Text>Show Modal</Text>
</TouchableOpacity>
<Modal isVisible={this.state.isModalVisible}>
<View style={{ flex: 1 }}>
<Text>Hello!</Text>
<TouchableOpacity onPress={this._toggleModal}>
<Text>Hide me!</Text>
</TouchableOpacity>
</View>
</Modal>
/>
);
const historyScreen = () => (
<View style={{backgroundColor: '#ff4081'}}>
</View>
);
}
);
const favScreen = () => (
<View style={{backgroundColor: '#a95'}}>
</View>
);
_renderLazyPlaceholder = () => {
return (
<ActivityIndicator size="large" color="red" />
);
};
{
return (
<View style={{flex: 1}}>
{this.state.isRender &&
<TabView
lazy
navigationState={this.state}
renderScene={SceneMap({
scan: scanScreen,
history: historyScreen,
fav: favScreen,
})}
renderLazyPlaceholder={this._renderLazyPlaceholder}
onIndexChange={(index) => this.setState({index})}
initialLayout={{width: SCREEN_WIDTH, height: SCREEN_HEIGHT}}
renderIcon={({route}) => (
<IconMI
name={route.icon}
size={15}
color={'white'}
/>
)}
/>
}
</View>
)
}
return (
<View style={{flex: 1}}>
<TouchableOpacity onPress={this._toggleModal}>
<Text>Show Modal</Text>
</TouchableOpacity>
<Modal isVisible={this.state.isModalVisible}>
<View style={{flex: 1}}>
<Text>Hello!</Text>
<TouchableOpacity onPress={this._toggleModal}>
<Text>Hide me!</Text>
</TouchableOpacity>
</View>
</Modal>
</View>
);
}
}
RkTheme.setType('RkButton', 'dark', {
container: {
paddingTop:10,
backgroundColor: 'gray',
borderRadius: 90,
paddingTop: 10,
backgroundColor: 'gray',
borderRadius: 90,
}
});
});
const rectDimensions = SCREEN_WIDTH * 0.85; // this is equivalent to 255 from a 393 device width
@ -123,35 +176,31 @@ const rectDimensions = SCREEN_WIDTH * 0.85; // this is equivalent to 255 from a
const overlayColor = 'rgba(0,0,0,0.30)';
const styles = {
recover:{
paddingTop:10,
recover: {
paddingTop: 10,
color: "red",
paddingBottom:10
paddingBottom: 10
},
manual:{
manual: {},
},
logo:{
logo: {
height:SCREEN_HEIGHT*0.35,
width:SCREEN_WIDTH,
height: SCREEN_HEIGHT * 0.35,
width: SCREEN_WIDTH,
backgroundColor: overlayColor,
},
rectangleContainer: {
flex: 1,
alignItems: "center",
justifyContent: "center",
backgroundColor: "transparent",
},
rectangle: {
height: rectDimensions,
width: rectDimensions,
alignItems: "center",

View File

@ -1,15 +1,17 @@
import * as React from 'react';
import {
View,
StyleSheet,
Dimensions,
Image,
ScrollView,
Text,
Button,
TouchableOpacity
} from 'react-native';
View,
StyleSheet,
Dimensions,
Image,
ScrollView,
Text,
Button,
TouchableOpacity,
ImageBackground
} from 'react-native';
import {Divider, Icon, Avatar} from 'react-native-elements'
import {TabView, TabBar, SceneMap} from 'react-native-tab-view';
import {
RkButton, RkCard, RkText,
@ -19,6 +21,7 @@ import Timeline from 'react-native-timeline-feed'
import * as Progress from 'react-native-progress';
import NavAbsolute from '../components/Nav';
import {connect} from 'react-redux';
@ -29,8 +32,10 @@ import Swiper from 'react-native-swiper';
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
import FitImage from 'react-native-fit-image';
import MapView, {PROVIDER_GOOGLE} from 'react-native-maps';
const formatObj = (obj) => {
@ -43,26 +48,38 @@ const formatObj = (obj) => {
};
class calendarDetail extends React.Component {
state = {
};
static navigationOptions = ({navigation}) => ({
header: (
<NavAbsolute
navigation={navigation}
// title={navigation.state.params.info.name}
/>
),
});
state = {};
componentDidMount() {
this.props.getEvents(this.props.user);
console.log('didMount');
console.log(this.props.events);
const {navigation} = this.props;
const info = navigation.getParam('info', 'error');
console.log("putas")
console.log(info)
}
_update = () => {
this.setState({user: this.props.user});
console.log(this.props.events);
}
};
constructor(props) {
@ -70,97 +87,347 @@ class calendarDetail extends React.Component {
super(props)
this.data = [
]
this.data = []
}
render() {
const { navigation } = this.props;
const info = navigation.getParam('info', 'error');
console.log(info);
renderHeader = (info) => {
return (
<View>
<Text>{info.name}, {info.description}</Text>
<View style={styles.headerContainer}>
<View style={styles.coverContainer}>
<ImageBackground
source={{
uri: info.imageUrl,
}}
style={styles.coverImage}
>
</ImageBackground>
</View>
</View>
)
};
renderDescription = (info) => {
return (
<View>
<View style={styles.header}>
<View style={{flexDirection: "row", alignItems: 'center', alignSelf:'center'}}>
<View style={styles.timeText}>
<Text style={{color: "#CC1A17", fontSize: 15}}>
{info.time === info.timeEnd ? info.time : `${info.time} - ${info.timeEnd}`}
</Text>
</View>
</View>
<View><Text style={{margin:10,marginTop:0, fontSize:20, color:'#CC1A17'}}>{info.name}</Text></View>
<View style={{margin:10}}>
<Progress.Bar color={'#000000'} progress={info.Enrolled / info.MaxAttendees} height={10}
unfilledColor={'white'} width={210}/>
<Text >{info.Enrolled} / {info.MaxAttendees}</Text>
</View>
<Divider style={{backgroundColor: '#000'}}/>
<View>
<Text style={{fontSize:15, color:'#CC1A17', padding:10}}>Descrição</Text>
<Text style={{paddingLeft:10, paddingRigh:10}}></Text>
</View>
</View>
<View style={styles.block}>
<Text style={{fontSize: 20, color: "#CC1A17"}}>Descrição</Text>
<Divider style={{backgroundColor: '#000'}}/>
<View style={{marginTop: 10}}>
<Text>
{info.description}
</Text>
</View>
</View>
</View>
)
};
/*
renderMap = () => {
return (
<MapView
provider={PROVIDER_GOOGLE}
style={{flex: 2}}
region={{
latitude: 40.19092111672049,
latitudeDelta: 0.007664297080957283,
longitude: -8.410662319511175,
longitudeDelta: 0.007551424205303192
}}
onRegionChangeComplete={(region) => {
console.log(region);
}}
/>
)
};
*/
renderAttendee = () => {
return (
<View style={{backgroundColor: '#fff', height: SCREEN_HEIGHT * 0.1}}>
<View style={styles.AttendeeContainer}>
<View style={styles.leftRow}>
<Avatar
rounded
size="medium"
source={{
uri: "https://cdn3.iconfinder.com/data/icons/vector-icons-6/96/256-512.png",
}}
/>
</View>
<View style={styles.centerRow}>
<Text style={styles.titleText} numberOfLines={1}>
Nome do gajo
</Text>
</View>
<View style={styles.rightRow}>
<Icon
size={24}
name="visibility"
type="material-icon"
onPress={() => navigation.goBack(null)}
color='#000'
iconStyle={styles.icon}
underlayColor="transparent"
underlineColorAndroid="transparent"
containerStyle={styles.iconContainer}
hitSlop={{top: 15, bottom: 15, left: 15, right: 15}}
/>
</View>
</View>
</View>
);
};
render() {
const {navigation} = this.props;
const info = navigation.getParam('info', 'error');
return (
<View style={styles.mainViewStyle}>
<ScrollView style={styles.scroll}>
<View style={styles.container}>
<View style={styles.headerContainer}>
{this.renderHeader(info)}
</View>
{this.renderDescription(info)}
</View>
<View style={styles.block}>
<Text style={{fontSize: 20, color: "#CC1A17"}}>Localização</Text>
<Divider style={{backgroundColor: '#000', marginBottom: 10}}/>
</View>
</ScrollView>
<Divider style={{backgroundColor: 'black'}}/>
</View>
)
}
}
const styles = StyleSheet.create({
carreerPathContainer:{
backgroundColor:'#CC1A17',
height:50,
flex:1,
alignItems:'center',
justifyContent:'center',
paddingTop:15,
block:{
marginTop:15,
backgroundColor:'white',
padding:20
},
carreerPathText:{
AttendeeContainer: {
flexDirection: 'row',
height: 55,
justifyContent: 'center',
marginLeft: 10,
marginRight: 10,
},
centerRow: {
alignItems: 'center',
backgroundColor: 'transparent',
flex: 3,
flexDirection: 'column',
justifyContent: 'center',
},
leftRow: {
backgroundColor: 'transparent',
flex: 1,
flexDirection: 'row',
justifyContent: 'flex-start',
alignSelf: 'center',
},
rightRow: {
alignItems: 'flex-end',
backgroundColor: 'transparent',
flex: 2,
flexDirection: 'row',
justifyContent: 'flex-end',
marginRight: 4,
alignSelf: 'center'
},
icon: {
justifyContent: 'flex-start',
marginTop: 2.8,
},
nameAttendee: {
alignSelf: 'center',
fontSize: 20,
fontWeight: '400',
color: '#000',
marginBottom: 10,
},
details: {
marginTop: 20,
flex: 1,
alignSelf: 'center',
},
infoRow: {
margin: 25,
},
ramoText: {
alignSelf: 'flex-start',
marginBottom: 5,
color: 'white',
fontSize: 17,
fontWeight: '400',
},
timeText: {
alignItems: 'flex-end',
flex: 2,
lineHeight: 10,
marginRight: 4,
},
mainViewStyle: {
flex: 1,
flexGrow: 1,
flexDirection: 'column',
},
scroll: {
backgroundColor: '#eee',
flex: 1,
//marginBottom: 55,
},
header:{
flex: 1,
padding: 10,
backgroundColor: 'white',
borderRadius: 0,
height:50,
color:'white',
fontWeight:'bold',
fontSize:20,
},
cardContainer: {
flex: 1,
padding: 10,
// margin: 20,
backgroundColor: 'white',
borderRadius: 5,
},
headerContainer: {
flex: 1,
},
container: {
flex: 1,
flexDirection: 'column',
},
coverContainer: {
position: 'relative',
},
coverImage: {
height: Dimensions.get('window').width * (2 / 4),
width: Dimensions.get('window').width,
},
/*headerContainer: {
alignItems: 'center',
backgroundColor: '#FFF',
},*/
carreerPathContainer: {
backgroundColor: '#CC1A17',
height: 50,
flex: 1,
alignItems: 'center',
justifyContent: 'center',
paddingTop: 15,
},
carreerPathText: {
height: 50,
color: 'white',
fontWeight: 'bold',
fontSize: 20,
},
companyHeader:{
backgroundColor:'#dddddd',
// height:150,
borderRadius:5,
margin:10,
padding:10
companyHeader: {
backgroundColor: '#dddddd',
// height:150,
borderRadius: 5,
margin: 10,
padding: 10
},
companyTitle:{
paddingBottom:5,
fontWeight:'bold',
color:'#777777',
fontSize:17,
// padding:20
companyTitle: {
paddingBottom: 5,
fontWeight: 'bold',
color: '#777777',
fontSize: 17,
// padding:20
},
companyLogo: {
borderRadius: 20,
},
wrapper: {
},
company:{
flex:1,
flexDirection:'row',
// backgroundColor:'red',
color:'black'
},
companyLogoContainer:{
flex:1,
wrapper: {},
company: {
flex: 1,
flexDirection: 'row',
// backgroundColor:'red',
color: 'black'
},
companyLogoContainer: {
flex: 1,
justifyContent: 'center',
width:'60%',
// backgroundColor:'white',
margin:20,
width: '60%',
// backgroundColor:'white',
margin: 20,
},
aboutCompany:{
width:SCREEN_WIDTH,
flex:1,
aboutCompany: {
width: SCREEN_WIDTH,
flex: 1,
justifyContent: 'center',
alignItems: 'center',
}
});
});
function mapStateToProps(state, props) {
@ -170,7 +437,8 @@ function mapStateToProps(state, props) {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events
events: state.apiReducer.events,
careerPath: state.apiReducer.careerPath,
}
}

View File

@ -1,427 +1,519 @@
import * as React from 'react';
import * as React from "react";
import {
View,
StyleSheet,
Dimensions,
Image,
ScrollView,
Text,
Button,
TouchableOpacity,
Picker,
CheckBox,
ActivityIndicator,
SectionList,
FlatList
} from 'react-native';
View,
StyleSheet,
Dimensions,
ScrollView,
Text,
Button,
TouchableOpacity,
Picker,
ActivityIndicator,
FlatList
} from "react-native";
import moment from "moment";
import {TabView, TabBar, SceneMap} from 'react-native-tab-view';
import {
RkButton, RkCard, RkText,
RkTheme
} from 'react-native-ui-kitten';
import Timeline from 'react-native-timeline-feed'
import * as Progress from 'react-native-progress';
import Modal from "react-native-modal";
import {connect} from 'react-redux';
import * as Progress from "react-native-progress";
import {bindActionCreators} from 'redux';
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import * as Actions from "../store/actions"; //Import your actionss
import AwesomeAlert from 'react-native-awesome-alerts';
import * as Actions from '../store/actions'; //Import your actionss
import Swiper from 'react-native-swiper';
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
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';
import FitImage from "react-native-fit-image";
const formatObj = (obj) => {
let a = {};
a.push({})
return a
};
import { Divider } from "react-native-elements";
import LinearGradient from "react-native-linear-gradient";
import IconFA from "react-native-vector-icons/FontAwesome5";
class choosePath extends React.Component {
_verifySession = Id => {
var sessions = this.props.user.Sessions;
for (let key in sessions) {
if (sessions[key].Id == Id) return true;
// cenas.push(result[key]);
console.log();
}
};
static navigationOptions = ({ navigation }) => ({
headerTitleStyle: { textAlign: "center", alignSelf: "center" },
headerStyle: {
backgroundColor: "rgba(0,0,0,0)",
shadowRadius: 0,
elevation: 0
}
});
static navigationOptions = ({ navigation }) => ({
headerTitleStyle : {textAlign: 'center',alignSelf:'center'},
headerStyle:{
backgroundColor:'rgba(0,0,0,0)',
shadowRadius:0,
elevation:0
},
});
state = {
calendar: {},
guest: "9"
};
state = {
calendar:{},
guest:'9'
_mount = () => {
var sessions = this.props.sessions;
for (let key in sessions) {
if (sessions[key].Name == "IA") {
this.setState({ guest: "9" });
}
//...
}
};
componentDidMount() {
// this.props.getEvents(this.props.user);
this.props.getAvailableGuestlists(this.props.userDetails.token);
this.props.getSessions(this.props.userDetails.token);
this._mount();
//console.log('didMount');
// console.log(this.props.events);
}
_update = () => {
this.setState({ user: this.props.user });
console.log(this.props.events);
};
_findPath = id => {
var sessions = this.props.sessions;
for (let key in sessions) {
if (sessions[key].Name == id) {
return true;
}
}
return false;
};
constructor() {
super();
this.state = {
showAlert:true,
Blocks: [],
onHoldBlocks: true,
checked: true,
modalVisible: false,
isModalVisible: false,
};
componentDidMount() {
this.data = [];
}
onPress = () => {
};
// this.props.getEvents(this.props.user);
this.props.getAvailableGuestlists(this.props.userDetails.token)
console.log('didMount');
console.log(this.props.events);
}
_s() {
this.props.signSession(this.props.userDetails.token, item[index].Id);
}
getCareerPaths = () => {
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}
/>
);
_toggleModal = () =>
this.setState({ isModalVisible: !this.state.isModalVisible });
_update = () => {
this.setState({user: this.props.user});
console.log(this.props.events);
}
_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 = ({ item }) => {
<Text>Cenas: {item.Name}</Text>;
};
constructor() {
render() {
return (
<View>
<ScrollView style={styles.page}>
super()
this.data = [
]
}
getCareerPaths=()=>{
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() {
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 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'}}>
<View style={styles.pickerCareer}>
<Picker
selectedValue={this.state.guest}
style={{width:'100%'}}
onValueChange={(itemValue, itemIndex) =>{
this.setState({guest: itemValue})
this.props.waitChangeGuest();
this.props.changeGuestList(this.props.userDetails.token,itemValue)
this.props.waitChangeGuest();
this.props.getAvailableSessions(this.props.userDetails.token);
}
}>
<Picker.Item label="Inteligência Artificial" value="9" />
<Picker.Item label="Redes e Segurança" value="10" />
<Picker.Item label="Data Science" value="15" />
<Picker.Item label="Desenvolvimento Web" value="14" />
<Picker.Item label="Internet das Coisas" value="12" />
<Picker.Item label="Desenvolvimento Mobile" value="11" />
</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 }}
/>
{this._findPath("IA") && (
<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 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._findPath("NET") && (
<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>
)}
keyExtractor={item => item.email}
/>
</View >
{ !this.props.changingGuest &&
<View style={styles.block}>
<View style={styles.time}>
<Text style={
{
margin:10,
fontSize:25,
color:'#CC1A17',
marginBottom:0
}
}>
9:00</Text>
<Text style={{marginLeft:20}}>até</Text>
<Text style={
{
margin:10,
fontSize:25,
color:'#CC1A17',
marginTop:5
}
}>
9:30</Text>
</View>
<View style={styles.sessions}>
<View
style={{ flex: 1, width: SCREEN_WIDTH * 0.7, alignContent: "center" }}
>
<View style={styles.pickerCareer}>
<Picker
selectedValue={this.state.guest}
style={{ width: "100%" }}
onValueChange={(itemValue, itemIndex) => {
this.setState({ guest: itemValue });
// this.props.timerChangeGuest();
this.props.waitChangeGuest();
this.props.changeGuestList(
this.props.userDetails.token,
itemValue
);
// this.props.waitChangeGuest();
// this.props.getAvailableSessions(this.props.userDetails.token);
// this.props.waitChangeGuest();
// this.props.getSessionBlocks(this.props.sessions)
}}
>
<Picker.Item label="Escolhe o teu career path!" value="0" />
<Picker.Item label="Inteligência Artificial" value="9" />
<Picker.Item label="Redes e Segurança" value="10" />
<Picker.Item label="Data Science" value="15" />
<Picker.Item label="Desenvolvimento Web" value="14" />
<Picker.Item label="Internet das Coisas" value="12" />
<Picker.Item label="Desenvolvimento Mobile" value="11" />
</Picker>
</View>
<View style={{ width: SCREEN_WIDTH }}>
{!this.props.changingGuest && (
<FlatList
data={this.props.Blocks}
renderItem={({ item, index }) => (
<View style={styles.block}>
<View style={styles.time}>
<Text
style={{
margin: 10,
fontSize: 25,
color: "#CC1A17",
marginBottom: 0
}}
>
{moment(item[0].SessionStart).format("HH:mm")}
</Text>
<Text style={{ marginLeft: 20 }}>às</Text>
<Text
style={{
margin: 10,
fontSize: 25,
color: "#CC1A17",
marginTop: 5
}}
>
{moment(item[0].SessionEnd).format("HH:mm")}
</Text>
</View>
<View style={styles.sessions}>
<FlatList
data={item}
renderItem={({ data, index }) => (
<View>
<View style={styles.session}>
{this._verifySession(item[index].Id) && (
<TouchableOpacity
onPress={() => {
this.props.removeSession(
this.props.user,
this.props.userDetails.token,
item[index].Id
);
}}
style={{ flex: 1, alignSelf: "center" }}
>
<View>
<IconFA
name="check-square"
color={"#CC1A17"}
size={35}
/>
</View>
</TouchableOpacity>
)}
{!this._verifySession(item[index].Id) && (
<TouchableOpacity
onPress={() => {
//this.props.waitChangeGuest()
this.props.signSession(
this.props.user,
this.props.userDetails.token,
item[index].Id
);
}}
style={{ flex: 1, alignSelf: "center" }}
>
<View>
<IconFA name="square" size={35} />
</View>
</TouchableOpacity>
)}
<CheckBox
style={{margin:10}}
value={this.state.checkbox1}
onChange={() => this.setState({ checkbox1: !this.state.checkbox1 })}
/>
<TouchableOpacity><View style={styles.sessionInfo}>
<Text style={styles.sessionTitle}>Nome da palestra</Text>
<Text style={{marginTop:10, marginBottom:5}}>12 Lugares disponíveis</Text>
<Progress.Bar color={'#000000'} progress={0.3} unfilledColor={'white'} width={150}/>
</View></TouchableOpacity>
<TouchableOpacity
onPress={() =>
this.props.navigation.navigate("febrada")
}
>
<View style={styles.sessionInfo}>
<Text style={styles.sessionTitle}>
{item[index].Name}
</Text>
<Text
style={{ marginTop: 10, marginBottom: 5 }}
>
{item[index].MaxAttendees -
item[index].Enrolled}{" "}
Lugares disponíveis
</Text>
<Progress.Bar
color={"#000000"}
progress={
item[index].Enrolled /
item[index].MaxAttendees
}
unfilledColor={"white"}
width={170}
/>
</View>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: '#eeeeee' }} />
<View style={styles.session}>
<CheckBox
style={{margin:10}}
value={this.state.checkbox1}
onChange={() => this.setState({ checkbox1: !this.state.checkbox1 })}
/>
<TouchableOpacity><View style={styles.sessionInfo}>
<Text style={styles.sessionTitle}>Nome da palestra</Text>
<Text style={{marginTop:10, marginBottom:5}}>12 Lugares disponíveis</Text>
<Progress.Bar color={'#000000'} progress={0.3} unfilledColor={'white'} width={150}/>
</View></TouchableOpacity>
</View>
<Divider style={{ backgroundColor: '#eeeeee' }} />
<View style={styles.session}>
<CheckBox
style={{margin:10}}
value={this.state.checkbox1}
onChange={() => this.setState({ checkbox1: !this.state.checkbox1 })}
/>
<TouchableOpacity><View style={styles.sessionInfo}>
<Text style={styles.sessionTitle}>Nome da palestra</Text>
<Text style={{marginTop:10, marginBottom:5}}>12 Lugares disponíveis</Text>
<Progress.Bar color={'#000000'} progress={0.3} unfilledColor={'white'} width={150}/>
</View></TouchableOpacity>
</View>
<Divider style={{ backgroundColor: '#eeeeee' }} />
</View>
<Divider style={{ backgroundColor: "#eeeeee" }} />
</View>
)}
/>
</View>
}
{this.props.changingGuest &&
</View>
)}
/>
)}
</View>
</View>
<ActivityIndicator size="large" color="red"/>
}
</ScrollView>
);
}
{(this.props.changingGuest || this.props.Blocks == true) && (
<View style={{ flex:1, height:SCREEN_HEIGHT*0.6, alignSelf:'center',}}>
<ActivityIndicator
size="large"
color="red"
style={{ alignContent: "center" , alignSelf:'center', marginTop:SCREEN_HEIGHT*0.2}}
/></View>
)}
</ScrollView>
</View>
);
}
}
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
},
sessionTitle:{
fontSize:15,
fontWeight:'bold'
},
day:{
margin:10
},
dayText:{
fontSize:20,
color: '#CC1A17',
textAlign: 'center',
},
time:{
alignContent:'center',
width:SCREEN_WIDTH*0.20,
backgroundColor:'white'
},
block:{
flex:1,
flexDirection:'row',
backgroundColor:'red',
margin:10,
borderRadius:5
},
companyContainer:{
flex:1,
// backgroundColor:'blue',
flexDirection:'row',
marginTop:0
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
},
sessionTitle: {
fontSize: 15,
fontWeight: "bold"
},
day: {
margin: 10
},
dayText: {
fontSize: 20,
color: "#CC1A17",
textAlign: "center"
},
time: {
alignContent: "center",
width: SCREEN_WIDTH * 0.23,
backgroundColor: "white"
},
sessions:{
flex:1,
flexDirection:'column',
backgroundColor:'white',
block: {
flex: 1,
flexDirection: "row",
backgroundColor: "red",
margin: 10,
borderRadius: 5
},
page:{
backgroundColor:'#eeeeee',
},
pickerCareer:{
paddingLeft:30,
paddingRight:30,
backgroundColor:'white',
width:SCREEN_WIDTH,
companyContainer: {
flex: 1,
// backgroundColor:'blue',
flexDirection: "row",
marginTop: 0
},
session:{
margin:10,
flex:1,
flexDirection:'row',
sessions: {
flex: 1,
flexDirection: "column",
backgroundColor: "white"
},
page: {
backgroundColor: "#eeeeee"
},
pickerCareer: {
paddingLeft: 30,
paddingRight: 30,
backgroundColor: "white",
width: SCREEN_WIDTH
},
session: {
margin: 10,
flex: 1,
flexDirection: "row"
}
});
function mapStateToProps(state, props) {
return {
// token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events,
userDetails: state.apiReducer.userDetails,
calendar : state.apiReducer.calendar,
changingGuest : state.apiReducer.changingGuest,
sessions:state.apiReducer.sessions,
}
return {
// token: state.apiReducer.token,
showAlert: state.apiReducer.showAlert,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events,
userDetails: state.apiReducer.userDetails,
calendar: state.apiReducer.calendar,
changingGuest: state.apiReducer.changingGuest,
sessions: state.apiReducer.sessions,
Blocks: state.apiReducer.Blocks,
showAlert: state.apiReducer.showAlert
};
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
return bindActionCreators(Actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(choosePath);
export default connect(
mapStateToProps,
mapDispatchToProps
)(choosePath);

View File

@ -0,0 +1,29 @@
import React, {Component} from 'react';
import {
ActivityIndicator,
AsyncStorage,
Button,
StatusBar,
StyleSheet,
View,
} from 'react-native';
import {UtilStyles} from '../assets/styles'
export default class resetPassword extends Component {
constructor() {
super();
this._bootstrapAsync();
}
// Render Loading
render() {
return (
<View style={UtilStyles.containerLoading}>
<Text>Reset Password</Text>
</View>
);
}
}

View File

@ -9,6 +9,12 @@ export const LOGOUT_USER= 'LOGOUT_USER';
export const USER_INFO= 'USER_INFO'
export const HOLD='HOLD'
export const GET_EVENTS='GET_EVENTS'
export const UPDATE_USER='UPDATE_USER'
export const RESET_PASSWORD='RESET_PASSWORD'
export const CHECK_AND_RENEW='CHECK_AND_RENEW'
//API BLUETREND CALENDÁRIO
@ -17,7 +23,7 @@ export const CHANGE_GUEST = 'CHANGE_GUEST'
export const GET_SESSIONS= 'GET_SESSIONS'
export const SIGN_SESSION= 'SIGN_SESSION'
export const WAIT_CHANGE='WAIT_CHANGE'
export const REMOVE_SESSION = 'REMOVE_SESSION'
//UI
@ -29,6 +35,9 @@ export const UI_LOGIN_PASSWORD_INPUT_LOADING='UI_LOGIN_PASSWORD_INPUT_LOADING'
export const UI_LOGIN_PASSWORD_INPUT_INVALID='UI_LOGIN_PASSWORD_INPUT_INVALID'
export const UI_LOGIN_NOINTERNET='UI_LOGIN_NOINTERNET'
export const UI_LOGIN_OPEN_SCANNER='UI_LOIN_OPEN_SCANNER'
export const LOADINGLOGIN = 'LOADINGLOGIN'
//HOME
export const OPEN_MODAL='OPEN_MODAL'
export const CLOSE_MODAL='CLOSE_MODAL'

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,26 @@
export {checkUser,
login,getEvents,
hold, getUserInfo,
login,
getEvents,
hold,
getUserInfo,
logoutUser,
getAvailableGuestlists,
changeGuestList,
waitChangeGuest,
getAvailableSessions,
updateUser,
getSessionBlocks,
timerChangeGuest,
getSessions,
signSession,
openModal,
closeModal,
loginInternal,
waitLogin,
removeSession,
changePassword,
resetPassword
} from "./api"
export {

View File

@ -1,182 +1,269 @@
import { DATA_AVAILABLE, API_LOGIN, CHECK_USER, LOGOUT_USER, USER_INFO, HOLD, GET_EVENTS, GET_CAREERS, CHANGE_GUEST, WAIT_CHANGE, GET_SESSIONS } from "../actions/actionTypes" //Import the actions types constant we defined in our actions
import { REHYDRATE } from 'redux-persist';
let apiState= {
import {
DATA_AVAILABLE,
API_LOGIN,
CHECK_USER,
LOGOUT_USER,
USER_INFO,
HOLD,
GET_EVENTS,
GET_CAREERS,
CHANGE_GUEST,
WAIT_CHANGE,
GET_SESSIONS,
SESSION_BLOCKS,
TIMERWAIT_CHANGE,
SIGN_SESSION,
OPEN_MODAL,
CLOSE_MODAL,
LOADINGLOGIN,
REMOVE_SESSION,
UPDATE_USER,
} from "../actions/actionTypes"; //Import the actions types constant we defined in our actions
isConnected:false,
logged:false,
onHold:true,user:{},
events:[],
failedAttempt:false,
userDetails:{
username:'',
password:'',
token:{
expirationDateToken:0,
access_token:''
}
},
calendar:{
import { REHYDRATE } from "redux-persist";
},
changingGuest:false,
sessions:{}
}
let apiState = {
isConnected: false,
logged: false,
onHold: true,
user: {},
events: [],
showAlert: true,
failedAttempt: false,
userDetails: {
username: "",
password: "",
token: {
expirationDateToken: 0,
access_token: ""
}
},
calendar: {},
changingGuest: false,
sessions: {},
Blocks: {},
onHoldBlocks: true,
careerPath: { name: "Sem Career Path", color: "#eeeeee" },
a: {},
b: {},
c: {},
d: {},
loadingLogin: false
};
const apiReducer = (state = apiState, action) => {
switch(action.type){
switch (action.type) {
case REHYDRATE:
console.log(action);
if (action.payload != undefined) {
console.log(action.payload);
case REHYDRATE:
console.log(action)
if(action.payload!=undefined){
console.log( action.payload)
var expirationDateTokenA = 0;
var access_tokenA = "";
var expirationDateTokenA=0;
var access_tokenA='';
if (action.payload.apiReducer.userDetails.token != undefined) {
if (
action.payload.apiReducer.userDetails.token.expirationDateToken !=
undefined
) {
expirationDateTokenA =
action.payload.apiReducer.userDetails.token.expirationDateToken;
}
if(action.payload.apiReducer.userDetails.token!=undefined){
if(action.payload.apiReducer.userDetails.token.expirationDateToken!= undefined){
expirationDateTokenA= action.payload.apiReducer.userDetails.token.expirationDateToken;
}
if((action.payload.apiReducer.userDetails.token.access_token!= undefined)){
access_tokenA= action.payload.apiReducer.userDetails.token.access_token;
}
}
return {
// token: action.payload.apiReducer.token,
user: action.payload.apiReducer.user,
userDetails:{
token:{
expirationDateToken: expirationDateTokenA,
access_token:access_tokenA,
},
username:action.payload.apiReducer.userDetails.username,
password:action.payload.apiReducer.userDetails.password
}
};
}
case 'CHANGE_CONNECTION_STATUS':
return Object.assign({}, state, {
isConnected: action.isConnected,
});
if (
action.payload.apiReducer.userDetails.token.access_token !=
undefined
) {
access_tokenA =
action.payload.apiReducer.userDetails.token.access_token;
}
}
return {
sessions: action.payload.apiReducer.sessions,
// token: action.payload.apiReducer.token,
user: action.payload.apiReducer.user,
onHoldBlocks: true,
userDetails: {
token: {
expirationDateToken: expirationDateTokenA,
access_token: access_tokenA
},
username: action.payload.apiReducer.userDetails.username,
password: action.payload.apiReducer.userDetails.password
}
};
}
case "CHANGE_CONNECTION_STATUS":
return Object.assign({}, state, {
isConnected: action.isConnected
});
case UPDATE_USER:
state = Object.assign({}, state, { user:action.user});
return state
case LOADINGLOGIN:
state = Object.assign({}, state, { loadingLogin: true });
case HOLD:
state = Object.assign({}, state, { onHold: true });
return state;
case API_LOGIN:
state = Object.assign({}, state, {
logged: action.logged,
//token:action.token,
failedAttempt: action.failedAttempt,
user: action.user,
userDetails: {
token: action.token,
username: action.userDetails.username,
password: action.userDetails.password
},
loadingLogin: false,
onHold: action.onHold
});
return state;
case CHECK_USER:
var u = action.userDetails;
if (action.token != undefined) u.token = action.token;
state = Object.assign({}, state, {
logged: action.logged,
onHold: action.onHold,
userDetails: u
});
return state;
case LOGOUT_USER:
state = Object.assign({}, state, {
user: {},
userDetails: {},
logged: false
});
return state;
case USER_INFO:
state = Object.assign({}, state, {
user: action.user,
loggedIn: action.loggedIn,
onHold: action.onHold
});
return state;
case GET_EVENTS:
state = Object.assign({}, state, {
events: action.events,
a: action.day1,
b: action.day2,
c: action.day3,
d: action.day4
});
return state;
case REMOVE_SESSION:
state = Object.assign({}, state, {
sessions: action.sessions,
Blocks: action.Blocks,
careerPath: action.careerPath,
changingGuest: action.changingGuest,
user: action.user
});
return state;
case OPEN_MODAL:
console.log("open modal");
state = Object.assign({}, state, {
modalOpen: true,
modalInfo: action.modalInfo,
modalType: action.type
});
return state;
case CLOSE_MODAL:
state = Object.assign({}, state, {
modalOpen: false,
modalInfo: "",
type: ""
});
return state;
case SIGN_SESSION:
if(action.sessions==undefined || action.Blocks==undefined || action.user==undefined){
state = Object.assign({}, state, {
changingGuest: false,
case HOLD:
});
}
else{
state = Object.assign({}, state, {
sessions: action.sessions,
Blocks: action.Blocks,
careerPath: action.careerPath,
changingGuest: false,
user: action.user,
a:action.day1,
b:action.day2,
c:action.day3,
d:action.day4
});
}
return state;
state=Object.assign({},state, { onHold:true });
return state;
case SESSION_BLOCKS:
state = Object.assign({}, state, {
Blocks: action.Blocks,
onHoldBlocks: false,
changingGuest: false
});
return state;
case API_LOGIN:
state=Object.assign({},state, {
logged:action.logged,
//token:action.token,
failedAttempt: action.failedAttempt,
user:action.user,
userDetails: {token:action.token, username:action.userDetails.username, password:action.userDetails.password},
});
case GET_CAREERS:
var c = {
guests: action.guests
};
state = Object.assign({}, state, { calendar: c });
return state;
return state;
case CHECK_USER:
case CHANGE_GUEST:
state = Object.assign({}, state, {
changingGuest: false,
sessions: action.sessions,
Blocks: action.Blocks,
careerPath: action.careerPath
});
return state;
var u= action.userDetails;
if(action.token!=undefined)
u.token= action.token;
case WAIT_CHANGE:
state = Object.assign({}, state, { changingGuest: true });
return state;
state=Object.assign({},state, {logged:action.logged, onHold:action.onHold, userDetails:u });
return state;
case LOGOUT_USER:
state=Object.assign({},state, { logged:false});
return state;
case USER_INFO:
state=Object.assign({},state, { user: action.user , loggedIn:action.loggedIn, onHold:action.onHold});
return state;
case GET_EVENTS:
state=Object.assign({},state, { events: action.events});
return state;
case GET_CAREERS:
var c= {
guests:action.guests
}
state=Object.assign({},state, { calendar:c });
return state;
case CHANGE_GUEST:
state=Object.assign({},state, { changingGuest:false});
return state;
case WAIT_CHANGE:
state=Object.assign({},state, { changingGuest:true});
return state;
case GET_SESSIONS:
state=Object.assign({},state, { changingGuest:false, sessions:action.sessions});
return state;
default:
return state;
}
}
case TIMERWAIT_CHANGE:
state = Object.assign({}, state, { Blocks: true });
return state;
case GET_SESSIONS:
state = Object.assign({}, state, {
sessions: action.sessions,
Blocks: action.Blocks,
careerPath: action.careerPath
});
return state;
default:
return state;
}
};
export default apiReducer;

View File

@ -60,6 +60,7 @@
BE5EAC41221B889900E92E5B /* libReactNativePermissions.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE5EAC40221B888C00E92E5B /* libReactNativePermissions.a */; };
4EBB88037B054A508BF35245 /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F42241E0235464C91B24049 /* libRNDeviceInfo.a */; };
E677346A94D54E90817979B0 /* libRNDeviceInfo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C4D43A092A4408B91B32E76 /* libRNDeviceInfo-tvOS.a */; };
A52E07192CD249F7B10FDA66 /* libAirMaps.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C0906CC582484A7393F9B1F6 /* libAirMaps.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -440,6 +441,8 @@
5BA133418E6F4967BC5BC234 /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; name = "RNDeviceInfo.xcodeproj"; path = "../node_modules/react-native-device-info/ios/RNDeviceInfo.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
0F42241E0235464C91B24049 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; name = "libRNDeviceInfo.a"; path = "libRNDeviceInfo.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
3C4D43A092A4408B91B32E76 /* libRNDeviceInfo-tvOS.a */ = {isa = PBXFileReference; name = "libRNDeviceInfo-tvOS.a"; path = "libRNDeviceInfo-tvOS.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
A97F1617782E42EC83467F41 /* AirMaps.xcodeproj */ = {isa = PBXFileReference; name = "AirMaps.xcodeproj"; path = "../node_modules/react-native-maps/lib/ios/AirMaps.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
C0906CC582484A7393F9B1F6 /* libAirMaps.a */ = {isa = PBXFileReference; name = "libAirMaps.a"; path = "libAirMaps.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -473,6 +476,7 @@
BE104176D74E47E9A369B15A /* libRNVectorIcons.a in Frameworks */,
69E1B84AE0DF486CB1B1D226 /* libBVLinearGradient.a in Frameworks */,
4EBB88037B054A508BF35245 /* libRNDeviceInfo.a in Frameworks */,
A52E07192CD249F7B10FDA66 /* libAirMaps.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -667,6 +671,7 @@
664970B9D10A41A18B44727F /* RNVectorIcons.xcodeproj */,
1908F5E093844AC5A143E888 /* BVLinearGradient.xcodeproj */,
5BA133418E6F4967BC5BC234 /* RNDeviceInfo.xcodeproj */,
A97F1617782E42EC83467F41 /* AirMaps.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
@ -1450,6 +1455,7 @@
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
"$(SRCROOT)/../node_modules/react-native-device-info/ios/RNDeviceInfo",
"$(SRCROOT)\..\node_modules\react-native-maps\lib\ios/**",
);
INFOPLIST_FILE = appTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
@ -1461,6 +1467,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
@ -1482,6 +1489,7 @@
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
"$(SRCROOT)/../node_modules/react-native-device-info/ios/RNDeviceInfo",
"$(SRCROOT)\..\node_modules\react-native-maps\lib\ios/**",
);
INFOPLIST_FILE = appTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
@ -1493,6 +1501,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
@ -1516,6 +1525,7 @@
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
"$(SRCROOT)/../node_modules/react-native-device-info/ios/RNDeviceInfo",
"$(SRCROOT)\..\node_modules\react-native-maps\lib\ios/**",
);
INFOPLIST_FILE = app/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@ -1541,6 +1551,7 @@
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
"$(SRCROOT)/../node_modules/react-native-device-info/ios/RNDeviceInfo",
"$(SRCROOT)\..\node_modules\react-native-maps\lib\ios/**",
);
INFOPLIST_FILE = app/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@ -1572,6 +1583,7 @@
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
"$(SRCROOT)/../node_modules/react-native-device-info/ios/RNDeviceInfo",
"$(SRCROOT)\..\node_modules\react-native-maps\lib\ios/**",
);
INFOPLIST_FILE = "app-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@ -1582,6 +1594,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
@ -1612,6 +1625,7 @@
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
"$(SRCROOT)/../node_modules/react-native-device-info/ios/RNDeviceInfo",
"$(SRCROOT)\..\node_modules\react-native-maps\lib\ios/**",
);
INFOPLIST_FILE = "app-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@ -1622,6 +1636,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
@ -1651,6 +1666,7 @@
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
"$(SRCROOT)/../node_modules/react-native-device-info/ios/RNDeviceInfo",
"$(SRCROOT)\..\node_modules\react-native-maps\lib\ios/**",
);
INFOPLIST_FILE = "app-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@ -1661,6 +1677,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
@ -1690,6 +1707,7 @@
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
"$(SRCROOT)/../node_modules/react-native-device-info/ios/RNDeviceInfo",
"$(SRCROOT)\..\node_modules\react-native-maps\lib\ios/**",
);
INFOPLIST_FILE = "app-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@ -1700,6 +1718,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",

22
App/package-lock.json generated
View File

@ -2745,6 +2745,11 @@
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"email-validator": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/email-validator/-/email-validator-2.0.4.tgz",
"integrity": "sha512-gYCwo7kh5S3IDyZPLZf6hSS0MnZT8QmJFqYvbqlDZSbwdZlY6QZWxJ4i/6UhITOJ4XzyI647Bm2MXKCLqnJ4nQ=="
},
"emojis-list": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz",
@ -3059,6 +3064,10 @@
"ansi-styles": "^3.2.0"
}
},
"react-native-maps": {
"version": "github:expo/react-native-maps#e6f98ff7272e5d0a7fe974a41f28593af2d77bb2",
"from": "github:expo/react-native-maps#v0.22.1-exp.0"
},
"react-native-screens": {
"version": "1.0.0-alpha.22",
"resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-1.0.0-alpha.22.tgz",
@ -7840,6 +7849,14 @@
"resolved": "https://registry.npmjs.org/react-native-app-intro-slider/-/react-native-app-intro-slider-1.0.1.tgz",
"integrity": "sha512-5Gzg5FG2uP/RHkSDFB5+2df4vQ2FpyUJ5PGYd23lLEISsEOJe0Zredh1hHMJj+fB5D9B7ZoL0IlR+SNn8iFxHg=="
},
"react-native-awesome-alerts": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/react-native-awesome-alerts/-/react-native-awesome-alerts-1.2.0.tgz",
"integrity": "sha512-ouxDGJ/porNkuaeqpgxIJA4jAPqHC9bJIsxLA21NA6eZhnEhbqWOprjsNqwI0/7bJxXm9baTzXESCMzwAy3eZw==",
"requires": {
"prop-types": "^15.5.10"
}
},
"react-native-branch": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/react-native-branch/-/react-native-branch-2.2.5.tgz",
@ -7957,8 +7974,9 @@
}
},
"react-native-maps": {
"version": "github:expo/react-native-maps#e6f98ff7272e5d0a7fe974a41f28593af2d77bb2",
"from": "github:expo/react-native-maps#v0.22.1-exp.0"
"version": "0.23.0",
"resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-0.23.0.tgz",
"integrity": "sha512-qxOIQGsDtQXQlSJdXMW1wg8pvLaVYdbiIolB7tZTTgTGgIA/hDxXwZbQZ08c4KDD6/VTk8krfd1APaHkqvh6og=="
},
"react-native-material-buttons": {
"version": "0.5.0",

View File

@ -9,6 +9,7 @@
"dependencies": {
"@redux-offline/redux-offline": "^2.5.1",
"axios": "^0.18.0",
"email-validator": "^2.0.4",
"expo": "^32.0.5",
"material-icons-react": "^1.0.4",
"moment": "^2.24.0",
@ -17,6 +18,7 @@
"react-native": "0.57.8",
"react-native-action-button": "^2.8.5",
"react-native-app-intro-slider": "^1.0.1",
"react-native-awesome-alerts": "^1.2.0",
"react-native-camera": "^1.9.2",
"react-native-check-box": "^2.1.7",
"react-native-cli": "^2.0.1",
@ -30,6 +32,7 @@
"react-native-linear-gradient": "^2.5.3",
"react-native-loader": "^1.2.1",
"react-native-loading-spinner-overlay": "^1.0.1",
"react-native-maps": "^0.23.0",
"react-native-material-dropdown": "^0.11.1",
"react-native-material-shadows": "0.0.2",
"react-native-modal": "^7.0.2",

0
App/{ Normal file
View File

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Net.Http;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
@ -14,6 +15,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json.Linq;
namespace api.Controllers
{
@ -30,15 +32,18 @@ namespace api.Controllers
public IUsersRepository _repo { get; }
private readonly IMapper _mapper;
private readonly RoleManager<Role> _roleManager;
private readonly System.Net.Http.IHttpClientFactory clientFactory;
public AuthController(IConfiguration config, UserManager<User> UserManager, SignInManager<User> SignInManager, IMapper mapper, RoleManager<Role> roleManager, IUsersRepository repo)
public AuthController(IConfiguration config, UserManager<User> UserManager, SignInManager<User> SignInManager, IMapper mapper, RoleManager<Role> roleManager, IUsersRepository repo, System.Net.Http.IHttpClientFactory clientFactory)
{
_mapper = mapper;
_roleManager = roleManager;
_repo = repo;
this.clientFactory = clientFactory;
this.config = config;
_userManager = UserManager;
_signInManager = SignInManager;
}
@ -80,6 +85,40 @@ namespace api.Controllers
}
[HttpPost("loginQR")]
public async Task<IActionResult> loginQr(UserForLoginDto userLoginDTO){
var token= "_A6q1cVGa12QutCrYCsYETfz9nPspnbcnPqjD-87kDaYPr99ArEfpdRTbkEzA4p-WEJzPFQhsMX7nG5BmUm0E6RTju8vQHnaTjGd80NIqUCr-jXefUtGwyl6I00fGD4sN6psW714JnCFuZRbtZbIXsdIRKmD3b8YUpPo2lvYP8SzjoEgACyabj13T3CLpHF43PI8Dvny6ylW6j0ka5qGNvw5MHVvYFURUPiTA7hlxoyQ35eOqHE8-eIiLNSTUJW7q-o8CxIGqGWSkltKPxbrY-Xo5iYagUucesqmj64VxYs";
using (var client = new HttpClient())
{
try{
var url = "http://enei2019.uingress.com/internal/api/Attendee/Detail";
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token);
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
//var resource = JObject.Parse(response);
return Ok(response);
}catch(Exception e){
Console.WriteLine(e);
return Unauthorized();
}
}
}
private async Task<string> GenerateJwtToken(User user)
{
var claims = new List<Claim>

23
api/Dtos/tokenDto.cs Normal file
View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using api.Models;
namespace api.Dtos
{
public class tokenDto
{
public string access_token{get;set;} //teamid
public string token_type{get;set;} //user qr
public int expires_in{get;set;}
public string refresh_token{get;set;}
}
}

18
api/Dtos/userDetails.cs Normal file
View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using api.Models;
namespace api.Dtos
{
public class userDetails
{
public string name{get;set;} //teamid
public string qr{get;set;} //user qr
}
}

View File

@ -42,7 +42,7 @@ namespace api
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpClient();
services.AddAutoMapper();
services.AddScoped<IUsersRepository, UsersRepository>();
services.AddScoped<IEventsRepository, EventsRepository>();

View File

@ -3,12 +3,13 @@
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\"/>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1"/>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="5.0.1"/>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0"/>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="5.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
</ItemGroup>
</Project>

View File

@ -1,5 +1,5 @@
{
"ProjectFilePath": "c:\\Users\\ZMiguel\\Desktop\\ENEI2019\\api\\api.csproj",
"ProjectFilePath": "/Users/henrique/ENEI2019/api/api.csproj",
"TargetFramework": "netcoreapp2.1",
"TagHelpers": [],
"Configuration": {

180
website/ctf.html Normal file
View File

@ -0,0 +1,180 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="pt" xml:lang="pt">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1, user-scalable=0" name="viewport">
<meta content="width" name="MobileOptimized">
<meta content="true" name="HandheldFriendly">
<!-- Place favicon.ico in the root directory -->
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="site.webmanifest">
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<title>ENEI'19</title>
<meta name="description"
content="Página do Encontro Nacional de Estudantes de Informática 2019, no Instituto Superior de Engenharia de Coimbra (ISEC) a realizar-se entre 12 e 15 de abril de 2019. O ENEI pretende oferecer aos estudantes de todo o país um evento que promove a aprendizagem, a troca de ideias e o convívio, enquanto tenta criar fortes ligações com o mundo empresarial.">
<meta property="og:locale" content="pt_PT" />
<meta property="og:title" content="ENEI'19" />
<meta property="og:description"
content="Página do Encontro Nacional de Estudantes de Informática 2019, no Instituto Superior de Engenharia de Coimbra (ISEC) a realizar-se entre 12 e 15 de abril de 2019. O ENEI pretende oferecer aos estudantes de todo o país um evento que promove a aprendizagem, a troca de ideias e o convívio, enquanto tenta criar fortes ligações com o mundo empresarial." />
<meta property="og:site_name" content="ENEI'19" />
<meta property="og:url" content="http://www.enei.pt/" />
<meta property="og:image" content="http://www.enei.pt/imgs/share-image.jpg" />
<meta property="og:type" content="Website" />
<link rel="canonical" href="http://www.enei.pt/" />
<link href="bootstrap-grid.css" rel="stylesheet" type="text/css" />
<link href="main.css" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Bai+Jamjuree:400,600,700" rel="stylesheet">
</head>
<body>
<header id="main-menu">
<nav>
<a href="#" title="Abrir menu" rel="nofollow" id="open-menu-mobile">Menu</a>
<ul>
<li><a href="#enei" title="Enei">Enei</a></li>
<li class="unavailable">Oradores</li>
<li class="unavailable">Programa</li>
<li><a href="#precos" title="Preços">Preços</a></li>
<li class="unavailable">App</li>
<li><a href="#ctf" title="Faq's">CTF</li>
<li><a href="#sponsors" title="Sponsors">Sponsors</a></li>
<li><a href="#faqs" title="Faq's">Faq's</a></li>
</ul>
</nav>
</header>
<section id="ctf">
<div class="container ctf-container">
<div class="col-lg-12 centerctf">
<h1>Capture the flag</h1>
<h1></h1>
</div>
</div>
</section>
<section>
</section>
<!-- faqs section -->
<section id="faqs">
<div class="container">
<div class="row">
<div class="col-lg-5">
<div class="pre-h1">Perguntas Frequentes</div>
<h1>Faq</h1>
<hr>
</div>
</div>
<div class="row">
<div class="col-lg-10">
<ul id="accordion">
<li>
<a href="#" title="O que é o ENEI?" rel="nofollow" class="toggle">O que é o ENEI?</a>
<div class="content-accordion">
<p>O Encontro Nacional de Estudantes de Informática (ENEI) é um evento que pretende
oferecer aos estudantes de todo o país um evento que promove a aprendizagem, a troca
de
ideias e o convívio, enquanto tenta criar fortes ligações com o mundo empresarial.
</p>
<p>Esta versão do evento também incluirá os tradicionais momentos de diversão noturnos
que
muito apelam a todos os participantes das antigas edições e são uma excelente via de
networking e transferência de conhecimento!</p>
</div>
</li>
<li>
<a href="#" title="Onde me posso inscrever?" rel="nofollow" class="toggle">Onde me posso
inscrever?</a>
<div class="content-accordion">
<p>Podes adquirir o teu bilhete <a href="https://tickets.enei.pt" title="Aqui">AQUI</a>.
</p>
</div>
</li>
<li>
<a href="#" title="Quando é o programa vai estar disponível?" rel="nofollow"
class="toggle">Quando é o programa vai estar disponível?</a>
<div class="content-accordion">
<p>O programa vai sendo lançado nas próximas semanas de forma iterativa.</p>
</div>
</li>
<li>
<a href="#" title="Quem pode participar no evento?" rel="nofollow" class="toggle">Quem pode
participar no evento?</a>
<div class="content-accordion">
<p>Podem participar no ENEI19 todos os estudantes de cursos relacionados com
informática e
todos aqueles que querem aprender mais sobre os temas abordados!</p>
</div>
</li>
<li>
<a href="#" title="Tenho acesso a todas as sessões?" rel="nofollow" class="toggle">Tenho
acesso a todas as sessões?</a>
<div class="content-accordion">
<p>Não, as palestras e workshops necessitam de inscrições visto que têm lugares
limitados.</p>
<p>Brevemente poderás te inscrever na aplicação móvel do ENEI'19!</p>
</div>
</li>
</ul>
</div>
</div>
</div>
</section>
<!-- social network section -->
<aside id="social-network">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2>Segue-nos</h2>
<ul>
<li><a href="https://www.facebook.com/ENEIConf/" title="Facebook" target="_blank"
class="icon-facebook"></a></li>
<li><a href="https://www.instagram.com/eneiconf/" title="Instagram" target="_blank"
class="icon-instagram"></a></li>
<li><a href="https://www.linkedin.com/company/enei/" title="Linkedin" target="_blank"
class="icon-linkedin"></a></li>
<li><a href="mailto:geral@enei.pt" title="Email" target="_blank" class="icon-email"></a></li>
</ul>
</div>
</div>
</div>
</aside>
<!-- footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-lg-12">
<p>© 2019 ENEI . Todos os direitos reservados</p>
</div>
</div>
</div>
</footer>
<!-- Scripts -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-130588243-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-130588243-1');
</script>
</body>
</html>

BIN
website/imgs/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -43,6 +43,7 @@
<li class="unavailable">Programa</li>
<li><a href="#precos" title="Preços">Preços</a></li>
<li class="unavailable">App</li>
<li><a href="#ctf" title="Faq's">CTF</li>
<li><a href="#sponsors" title="Sponsors">Sponsors</a></li>
<li><a href="#faqs" title="Faq's">Faq's</a></li>
</ul>
@ -121,42 +122,53 @@
<h1>Preços</h1>
<hr>
<div class="price-block">
<div class="type">Early-Bird</div>
<div class="type">Normal</div>
<div>
<div class="individual-price">
<div class="price"><span></span>25</div>
<div class="label">Grupo</div>
<span class="options">*Alimentação e alojamento (pavilhão) incluídos</span>
<span class="options">*Alimentação [5,00€] e alojamento (pavilhão) [5,10€]</span>
</div>
</div>
<a href="https://tickets.enei.pt/group" title="Comprar" target="_blank"
class="buy-button">Comprar</a>
</div>
<div class="price-block">
<div class="type">Early-Bird</div>
<div class="type">Normal</div>
<div>
<div class="individual-price">
<div class="price"><span></span>30</div>
<div class="label">Individual</div>
<span class="options">*Alimentação e alojamento (pavilhão) incluídos</span>
<span class="options">*Alimentação [5,00€] e alojamento (pavilhão) [5,10€]</span>
</div>
</div>
<a href="https://tickets.enei.pt" title="Comprar" target="_blank" class="buy-button">Comprar</a>
</div>
<div class="price-block disable">
<div class="price-block">
<div class="type">Pontual</div>
<div class="individual-price">
<div class="price"><span></span>20</div>
<div class="label">Individual</div>
<span class="options">*Alimentação incluída</span>
</div>
<span class="buy-button">Brevemente</span>
<a href="https://tickets.enei.pt/pontual" title="Comprar" target="_blank"
class="buy-button">Comprar</a>
</div>
</div>
</div>
</div>
</section>
<section id="ctf">
<div class="container ctf-container">
<div class="col-lg-12">
<div class="prectf-h1">Brevemente disponível</div>
<h1>Capture the flag</h1>
<a class ="button-ctf" href="ctf.html" title="Comprar" target="_blank">Começar</a>
<h1></h1>
</div>
</div>
</section>
<!-- sponsors section -->
<section id="sponsors">
<div class="container">
@ -173,6 +185,20 @@
</div>
</div>
</div>
<div class="container gold">
<div class="row">
<div class="col-lg-4 col-lg-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1">
<h1>Gold Sponsor</h1>
<hr>
</div>
</div>
<div class="row">
<div class="col-lg-10 col-lg-offset-1 col-sm-8 col-sm-offset-2 col-xs-10 col-xs-offset-1">
<a href="http://www.novabase.pt/pt" title="Novabase" target="_blank"
class="sponsor-image"><img src="imgs/novaBase-sponsor.jpg" alt="Novabase Image"></a>
</div>
</div>
</div>
</section>
<!-- faqs section -->
@ -277,14 +303,12 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-130588243-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-130588243-1');
</script>
</body>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -892,6 +892,61 @@ hr {
}
}
#ctf{
background-image: url("imgs/image.png");
text-align: center;
h1 {
color: white;
margin-top: 80px;
margin-bottom: 50px;
}
.button-ctf {
&:hover {
border-color: #cc1a17;
background-color: white;
color: $grey;
}
}
}
.prectf-h1{
@include font($mont-font, 20px, 22px, $grey);
font-weight: $semi-bold;
text-transform: uppercase;
margin-bottom:100px;
@include portable {
font-size: 17px;
}
@include mobile {
margin-bottom: 5px;
}
color: #cc1a17;
}
.button-ctf{
font-family: "Bai Jamjuree", sans-serif;
font-size: 18px;
line-height: 14px;
color: #CC1A17;
font-weight: 700;
text-transform: uppercase;
border: 1px solid #eeeeee;
padding: 20px 40px;
margin: 200;
transition: border-color 150ms ease-out, background-color 150ms ease-out, color 150ms ease-out;
-webkit-transition: border-color 150ms ease-out, background-color 150ms ease-out, color 150ms ease-out;
}
#faqs,
#tickets {
background: url("imgs/cubes2-image.png") no-repeat bottom right;
@ -971,6 +1026,22 @@ hr {
transform: scale(1.03);
}
}
.gold {
h1 {
font-size: 30px;
line-height: 26px;
margin-top: 75px;
@include portable{
font-size: 27px;
}
@include mobile{
font-size: 23px;
}
}
.sponsor-image {
max-width: 135px;
}
}
}
#social-network {