Merge branch 'master' into Borges_march

# Conflicts:
#	App/app/Router.js
#	App/app/screens/Eventos.js
This commit is contained in:
João Borges 2019-03-14 18:46:17 +00:00
commit c2b7539e2f
31 changed files with 2433 additions and 1683 deletions

View File

@ -39,6 +39,7 @@ const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width; const SCREEN_WIDTH = Dimensions.get("window").width;
import Swiper from "react-native-swiper"; import Swiper from "react-native-swiper";
import resetPassword from "./screens/resetPassword";
var TimerMixin = require("react-timer-mixin"); var TimerMixin = require("react-timer-mixin");
function handleConnectivityChange() { function handleConnectivityChange() {
@ -46,6 +47,9 @@ function handleConnectivityChange() {
} }
class App extends Component { class App extends Component {
handleConnectivityChange = isConnected => { handleConnectivityChange = isConnected => {
this.setState({ isConnected }); this.setState({ isConnected });
}; };
@ -83,7 +87,9 @@ class App extends Component {
UI_loginScannerActive: false, UI_loginScannerActive: false,
userDetails: { username: "", password: "" }, userDetails: { username: "", password: "" },
isConnected: true, isConnected: true,
modalOpen: false modalOpen: false,
modalResetPassword:false,
resetText:''
}; };
} }
_print = () => { _print = () => {
@ -123,6 +129,16 @@ class App extends Component {
this.handleConnectivityChange this.handleConnectivityChange
); );
} }
_toggle=()=>{
this.setState({modalResetPassword:false})
}
//faz call
_reset=()=>{
//fecha modal
this.props.resetPassword(this.props.userDetails.token,this.state.resetText),
this.setState({modalResetPassword:false})
//faz call
}
_keyboardDidShow() { _keyboardDidShow() {
//alert('Keyboard Shown'); //alert('Keyboard Shown');
@ -142,7 +158,10 @@ class App extends Component {
}; };
render() { render() {
if (!this.props.logged && this.props.onHold) { if (!this.props.logged && this.props.onHold) {
return ( return (
<View style={UtilStyles.containerLoading}> <View style={UtilStyles.containerLoading}>
@ -158,6 +177,7 @@ class App extends Component {
return <Router />; return <Router />;
} }
return ( return (
<View style={styles.slide2}> <View style={styles.slide2}>
<Modal isVisible={this.props.UI_loginScannerActive}> <Modal isVisible={this.props.UI_loginScannerActive}>
<View style={{ flex: 1, backgroundColor: "white" }}> <View style={{ flex: 1, backgroundColor: "white" }}>
@ -174,12 +194,48 @@ class App extends Component {
/> />
</View> </View>
</Modal> </Modal>
<Modal
isVisible={this.state.modalResetPassword}
onBackdropPress={this._toggle}
onBackButtonPress={this._toggle}
animationInTiming={1100}
animationOutTiming={1100}
>
<View style={{ backgroundColor: "white" , padding:20,paddingBottom:0, alignItems:'center'}}>
<View>
<Text style={{textAlign:'center',fontSize:23, fontWeight:'bold', color:'#CC1A17', margin:30}}>Reset Password</Text>
<Text style={{textAlign:'center', }}>Deves introduzir o email com o qual efectuaste a compra do bilhete.</Text>
<TextInput
style={styles.resetPassword}
onFocus={this._print}
maxLength={50}
blurOnSubmit={true}
onChangeText={r => this.setState({ resetText:r })}
clearButtonMode="always"
value={this.state.resetText}
clearTextOnFocus={true}
onSubmitEditing={Keyboard.dismiss}
placeholder="Email ou Qr code"
/>
<Button
onPress={this._reset}
title={"Enviar"}
color={"#CC1A17"}
></Button>
<Text style={{textAlign:'center', fontSize:12, margin:10,marginBottom:5}}> Caso tenhas problemas com este processo deves contactar a comissão organizadora atravês do email geral.</Text>
</View>
</View>
</Modal>
<View <View
style={{ style={{
width: "100%", width: "100%",
justifyContent: "center", justifyContent: "center",
alignItems: "center" alignItems: "center",
margin:20
}} }}
> >
<Image <Image
@ -203,10 +259,10 @@ class App extends Component {
<Icon <Icon
style={styles.searchIcon} style={styles.searchIcon}
name="ios-qr-scanner" name="ios-qr-scanner"
size={30} size={40}
color="#000" color="#000"
/> />
<Text>Scan QR</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
@ -225,13 +281,11 @@ class App extends Component {
placeholder="Password" placeholder="Password"
/> />
{ !this.props.loadingLogin && { !this.props.loadingLogin &&
<RkButton <View style={{alignItems:'center', margin:20}}>
rkType="dark" <TouchableOpacity onPress={this._tryLogin} style={{backgroundColor:'#CC1A17',borderRadius:3}}>
style={styles.loginBtn} <Text style={{color:'white', fontSize:20, margin:10, width:150,textAlign:'center',}}>Login</Text>
onPress={this._tryLogin} </TouchableOpacity>
> </View>
Entrar
</RkButton>
} }
{this.props.alignItems && {this.props.alignItems &&
<ActivityIndicator size="large" color="#0000ff" /> <ActivityIndicator size="large" color="#0000ff" />
@ -253,9 +307,9 @@ class App extends Component {
<View style={styles.textRow}> <View style={styles.textRow}>
<RkText rkType="primary3">Não sabes a password?</RkText> <RkText rkType="primary3">Não sabes a password?</RkText>
<RkButton rkType="clear" onPress={this.onSignUpButtonPressed}> <RkButton rkType="clear" onPress={this.onSignUpButtonPressed}>
<TouchableOpacity> <TouchableOpacity onPress={() => {this.setState({modalResetPassword:true})}}>
<RkText style={{ color: "red" }} kType="header6"> <RkText style={{ color: "#CC1A17", fontWeight:'bold' }} kType="header6">
Recuperar Password Reset Password
</RkText> </RkText>
</TouchableOpacity> </TouchableOpacity>
</RkButton> </RkButton>
@ -282,10 +336,30 @@ const overlayColor = "rgba(0,0,0,0.30)";
const styles = { const styles = {
cameraContainer: { cameraContainer: {
// height: Dimensions.get('window').height , height: Dimensions.get('window').height ,
},
resetPassword:{
borderColor: "#bfbdbd",
borderWidth: 1,
margin:20,
marginTop: 60,
marginBottom: 60,
width: SCREEN_WIDTH * 0.8,
backgroundColor: "white",
borderRadius: 3,
height: SCREEN_HEIGHT * 0.08,
borderColor: "#bfbdbd",
borderWidth: 1,
paddingLeft: SCREEN_WIDTH * 0.05
}, },
passwordInput: { passwordInput: {
borderRadius: 90,
borderColor: "#bfbdbd", borderColor: "#bfbdbd",
borderWidth: 1, borderWidth: 1,
@ -295,7 +369,7 @@ const styles = {
backgroundColor: "white", backgroundColor: "white",
borderRadius: 90, borderRadius: 3,
height: SCREEN_HEIGHT * 0.08, height: SCREEN_HEIGHT * 0.08,
borderColor: "#bfbdbd", borderColor: "#bfbdbd",
borderWidth: 1, borderWidth: 1,
@ -307,15 +381,19 @@ const styles = {
}, },
scanQR: { scanQR: {
//flexDirection: 'row', //flexDirection: 'row',
paddingTop: 5, flex:1,
//paddingTop: 5,
backgroundColor: 10, backgroundColor: 10,
alignItems:'center',
padding:5,
paddingRight:15,
width: 80, //width: 80,
paddingLeft: 10, // paddingLeft: 10,
backgroundColor: "#f24b4b", backgroundColor: "#CC1A17",
borderBottomRightRadius: 90, borderBottomRightRadius: 3,
borderTopRightRadius: 90, borderTopRightRadius: 3,
height: "100%" // height: "100%"
}, },
inputSection: { inputSection: {
flexDirection: "row", flexDirection: "row",
@ -323,7 +401,7 @@ const styles = {
backgroundColor: "white", backgroundColor: "white",
borderRadius: 90, borderRadius: 3,
height: SCREEN_HEIGHT * 0.08, height: SCREEN_HEIGHT * 0.08,
borderColor: "#bfbdbd", borderColor: "#bfbdbd",
borderWidth: 1 borderWidth: 1
@ -382,7 +460,8 @@ const styles = {
justifyContent: "center", justifyContent: "center",
alignItems: "center", alignItems: "center",
marginTop: 200 marginTop: 200,
}, },
logo2: { logo2: {

View File

@ -36,7 +36,8 @@ import Profile from "./screens/Profile";
import editCalendar from './screens/editCalendar'; import editCalendar from './screens/editCalendar';
import choosePath from './screens/choosePath'; import choosePath from './screens/choosePath';
import calendarDetail from './screens/calendarDetail'; import calendarDetail from './screens/calendarDetail';
import FebradaDetail from './screens/FebradaDetail';
import resetPassword from './screens/resetPassword';
const navigationOptions = ({navigation}) => ({ const navigationOptions = ({navigation}) => ({
headerLeft: <HeaderBackButton onPress={() => navigation.goBack(null)}/>, headerLeft: <HeaderBackButton onPress={() => navigation.goBack(null)}/>,
@ -104,11 +105,8 @@ const AppStack = createBottomTabNavigator(
}, },
{ {
//initialRouteName: 'Home',
initialRouteName: 'Eventos', initialRouteName: 'Eventos',
//initialRouteName: 'Calendário',
tabBarOptions: { tabBarOptions: {
showLabel: true, // hide labels showLabel: true, // hide labels
activeTintColor: '#CC1A17', // active icon color activeTintColor: '#CC1A17', // active icon color
@ -125,7 +123,8 @@ const Stack = createStackNavigator({
screen: AppStack, screen: AppStack,
navigationOptions: ({navigation}) => { navigationOptions: ({navigation}) => {
const index = navigation.state.index; const index = navigation.state.index;
if (navigation.state.routes[index].routeName == 'Home') { if (navigation.state.routes[index].routeName == 'Home') {
return { return {
headerTitle: `${navigation.state.routes[index].routeName}`, headerTitle: `${navigation.state.routes[index].routeName}`,
@ -205,7 +204,13 @@ const Stack = createStackNavigator({
calendarDetail: { calendarDetail: {
screen: calendarDetail, screen: calendarDetail,
}, },
FebradaDetail: {
screen: FebradaDetail,
},
resetPassword:{
screen:resetPassword
}
}); });

View File

@ -19,7 +19,7 @@ import * as Progress from "react-native-progress";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { bindActionCreators } from "redux"; import { bindActionCreators } from "redux";
import PTRView from 'react-native-pull-to-refresh';
import * as Actions from "../store/actions"; //Import your actionss import * as Actions from "../store/actions"; //Import your actionss
const formatObj = obj => { const formatObj = obj => {
@ -72,7 +72,7 @@ class Calendar extends React.Component {
<View style={styles.details}> <View style={styles.details}>
<Progress.Bar <Progress.Bar
color={"#000000"} color={"#000000"}
progress={item.Enrolled / item.MaxAttendees} progress={0}
unfilledColor={"white"} unfilledColor={"white"}
width={210} width={210}
/> />
@ -140,6 +140,10 @@ class Calendar extends React.Component {
constructor() { constructor() {
super(); super();
} }
_refresh=()=>{
this.props.getEvents(this.props.user);
//this.props.getSessions(this.props.userDetails.token);
}
render() { render() {
const ThirdRoute = () => ( const ThirdRoute = () => (
@ -275,7 +279,9 @@ class Calendar extends React.Component {
); );
return ( return (
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<View> <View>
{this.props.careerPath != undefined && ( {this.props.careerPath != undefined && (
<Text <Text
@ -292,6 +298,7 @@ class Calendar extends React.Component {
</Text> </Text>
)} )}
</View> </View>
<TabView <TabView
navigationState={this.state} navigationState={this.state}
renderScene={SceneMap({ renderScene={SceneMap({
@ -310,7 +317,11 @@ class Calendar extends React.Component {
style={{ backgroundColor: "#F2F2F2" }} style={{ backgroundColor: "#F2F2F2" }}
indicatorStyle={{ backgroundColor: "pink" }} indicatorStyle={{ backgroundColor: "pink" }}
/> />
<Button onPress={this._refresh} title="Refresh" color="#841584"
/>
</View> </View>
); );
} }
} }
@ -412,4 +423,4 @@ function mapDispatchToProps(dispatch) {
export default connect( export default connect(
mapStateToProps, mapStateToProps,
mapDispatchToProps mapDispatchToProps
)(Calendar); )(Calendar);

View File

@ -1,5 +1,7 @@
import * as React from "react"; import * as React from "react";
import {View, StyleSheet, Dimensions, Text, Button, ScrollView, ImageBackground} from "react-native";
import {View, StyleSheet, Dimensions, Text, Button, ScrollView, Image, TouchableOpacity} from "react-native";
import {TabView, TabBar, SceneMap} from "react-native-tab-view"; import {TabView, TabBar, SceneMap} from "react-native-tab-view";
import rallyImg from '../assets/rallyTascas.jpg'; import rallyImg from '../assets/rallyTascas.jpg';
@ -36,32 +38,23 @@ export default class Eventos extends React.Component {
}; };
renderFebrada = () => { renderFebrada = (navigate) => {
return ( return (
<View> <View>
<View styles={styles.cardContainer}> <TouchableOpacity onPress={() => navigate('FebradaDetail')}>
<ImageBackground <View style={styles.cardContainer}>
<Image
style={{ style={{
flex: 1, flex: 1,
width: '100%', width: undefined,
height: '100%', height: undefined
}} }}
source={require('../assets/rallyTascas.jpg')} resizeMode="contain"
/> source={require('../assets/altice_logo.png')}
>
</Image>
</View> </View>
</TouchableOpacity>
<View styles={styles.cardContainer}>
<Text>Ola</Text>
<Text style={{color: "black"}}>Local: 1</Text>
</View>
<View styles={styles.cardContainer}>
<Text>Ola</Text>
<Text style={{color: "black"}}>Local: 1</Text>
</View>
</View> </View>
); );
@ -69,25 +62,54 @@ export default class Eventos extends React.Component {
renderRally = () => { 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 = () => { 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() { render() {
const {navigate} = this.props.navigation;
return ( return (
<View> <View style={styles.container}>
<ScrollView> <ScrollView styles={styles.scroll}>
<View style={styles.cardContainer}> {this.renderFebrada(navigate)}
{this.renderFebrada()} {this.renderRally()}
</View> {this.renderCaching()}
<View styles={styles.cardContainer}>
</View>
<View styles={styles.cardContainer}>
</View>
</ScrollView> </ScrollView>
</View> </View>
); );
@ -98,8 +120,11 @@ const styles = StyleSheet.create({
container: { container: {
backgroundColor: '#eee', backgroundColor: '#eee',
flex: 1, flex: 1,
flexGrow: 1,
flexDirection: 'column',
}, },
scroll: { scroll: {
flex: 1, flex: 1,
}, },
@ -110,11 +135,9 @@ const styles = StyleSheet.create({
padding: 10, padding: 10,
margin: 20, margin: 20,
backgroundColor: '#fff', backgroundColor: '#fff',
height: SCREEN_WIDTH * (1 / 2),
borderRadius: 5, borderRadius: 5,
elevation: 2, //borderWidth: 2,
height: (SCREEN_WIDTH * (1 / 2)),
borderWidth: 2,
color: "#000"
}, },
scene: { scene: {

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 { import {
Button, Button,
View, View,
Text, Text,
TouchableOpacity, TouchableOpacity,
FlatList, FlatList,
ActivityIndicator, ActivityIndicator,
Dimensions, Dimensions,
StyleSheet, StyleSheet,
Image, Image,
ImageBackground, ImageBackground,
NetInfo, NetInfo,
AppState AppState
} from 'react-native'; } from "react-native";
import {Shadow} from 'react-native-shadow' import { Shadow } from "react-native-shadow";
import Icon from "react-native-vector-icons/Ionicons" import Icon from "react-native-vector-icons/Ionicons";
import { import { RkButton, RkTheme } from "react-native-ui-kitten";
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 ImageOverlay from "react-native-image-overlay";
import {createStore} from 'redux'; import { createStore } from "redux";
import PTRView from 'react-native-pull-to-refresh'; import PTRView from "react-native-pull-to-refresh";
import {Provider} from 'react-redux' import { Provider } from "react-redux";
import { ScrollView } from 'react-native-gesture-handler'; import { ScrollView } from "react-native-gesture-handler";
const SCREEN_HEIGHT = Dimensions.get("window").height; const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width; const SCREEN_WIDTH = Dimensions.get("window").width;
import {Card, Divider} from 'react-native-elements' import { Card, Divider } from "react-native-elements";
import RNMaterialShadows from 'react-native-material-shadows';
import RNMaterialShadows from "react-native-material-shadows";
import IconFA from "react-native-vector-icons/FontAwesome5";
class Home extends Component { class Home extends Component {
_handleConnectionChange = (isConnected) => { _handleConnectionChange = isConnected => {
// this.props.dispatch(connectionState({ status: isConnected })); // this.props.dispatch(connectionState({ status: isConnected }));
console.log("fck that") console.log("fck that");
}; };
_refresh() { _refresh() {
return new Promise((resolve) => { return new Promise(resolve => {
setTimeout(()=>{resolve()}, 2000) setTimeout(() => {
}); resolve();
} }, 2000);
_callApi(){ });
}
this.props.getUserInfo(this.props.token); _callApi() {
} this.props.getUserInfo(this.props.token);
constructor(props) { }
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}, // this.props.hold();
logged: true, console.log("hold" + this.props.onHold);
onHold: true, //this.props.logoutUser();
user: {Name: ''},
userDetails:{},
appState: AppState.currentState,
};
}
handleConnectivityChange = () => {
console.log("asdasdasdasdasd");
}
componentDidMount() { //console.log(this.props.token);
// NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange);
// 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); 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 ( let a = {};
<View> // this.setState({ user: this.props.user });
<Text>lollsss {this.props.onHold}</Text> // console.log(this.props.user)
<ActivityIndicator size="large" color="#0000ff"/> //
</View>
)
}
if (this.props.logged) {
return ( //var navigate = this.props.navigation.navigate
<PTRView onRefresh={this._update} > }
<ScrollView style={{backgroundColor:'#eeeeee'}}> _update = () => {
<View> this.props.getUserInfo(this.props.userDetails.token);
};
<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>
);
}
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({ const styles = StyleSheet.create({
userBoxText:{ userName:{
color:'white', fontSize:16,
fontWeight:'bold' fontWeight:'bold'
}, },
userStatsBoxIcon:{ userRemove: {
color:'white' alignContent: "center",
}, alignItems: "center",
userStatsBox:{
flex:1, alignSelf:'center'
flexDirection:'row'
}, },
userBox:{ userT: {
alignItems:'center', margin: 10,
justifyContent:'center',
width:'33%',
}, width: "55%",
userCurriculum:{ // backgroundColor: "red"
paddingTop:5, },
color:'red', userLogo: {
fontWeight:'bold', paddingLeft: 10,
fontSize:15
},
userBioRow:{
flex:1,
flexDirection:'row',
padding:10,
},
userBioText:{
}, margin: 10
userBioLogo:{ },
marginLeft: SCREEN_WIDTH*0.05, user: {
width: SCREEN_WIDTH*0.15, alignSelf: "center",
flex: 1,
}, flexDirection: "row",
margin: 10,
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
marginTop: 5,
}, width: "100%"
userStatsTitle:{ },
color:'white', userBoxText: {
fontSize:17, color: "white",
fontWeight:'bold', fontWeight: "bold"
padding:1 },
}, userStatsBoxIcon: {
userImageContainer:{ color: "white"
alignSelf: 'center', },
userStatsBox: {
flex: 1,
backgroundColor:'white',
flexDirection: "row"
},
// transform: [{ rotate: '-15deg'}], 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) { function mapStateToProps(state, props) {
return {
return { token: state.apiReducer.token,
user: state.apiReducer.user,
token: state.apiReducer.token, logged: state.apiReducer.logged,
user: state.apiReducer.user, userDetails: state.apiReducer.userDetails,
logged: state.apiReducer.logged, onHold: state.apiReducer.onHold
userDetails: state.apiReducer.userDetails, };
onHold: state.apiReducer.onHold
}
} }
function mapDispatchToProps(dispatch) { 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

@ -64,7 +64,7 @@ class Profile extends Component {
email: this.props.user.Email, email: this.props.user.Email,
emailError: false, emailError: false,
emailErrorMessage: '', emailErrorMessage: '',
phone: this.props.user.Mobile, phone: this.props.user.Mobile,
phoneError: false, phoneError: false,
@ -78,9 +78,25 @@ class Profile extends Component {
cityError: false, cityError: false,
cityErrorMessage: '', 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 = () => { _logout = () => {
this.props.logoutUser(); this.props.logoutUser();
@ -138,9 +154,9 @@ class Profile extends Component {
saveData() { 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); console.log(formValid);
@ -149,17 +165,16 @@ class Profile extends Component {
this.props.updateUser(this.props.userDetails.token, { this.props.updateUser(this.props.userDetails.token, {
Name: this.state.name, Name: this.state.name,
// LastName: "Último",
Company: jobs, Company: jobs,
// Job: jobs, LastName: curso,
Address: address, Address: address,
City: city, City: city,
// PostalCode: "3000-010",
Mobile: phone, Mobile: phone,
Avatar: "base64" Avatar: "base64",
Url:url,
}); });
this.props.getUserInfo(this.props.userDetails.token);
} }
@ -176,17 +191,13 @@ class Profile extends Component {
<View style={styles.container}> <View style={styles.container}>
<View style={styles.userBioRowHeader}> <View style={styles.userBioRowHeader}>
<View style={styles.userBioRowTitle}> <View style={styles.userBioRowTitle}>
<Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>User Bio</Text> <Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>Informações Pessoais</Text>
</View>
<View>
<TouchableOpacity onPress={() => this.saveData()}>
<Icon name="ios-save" size={30}/><Text>Save</Text>
</TouchableOpacity>
</View> </View>
</View> </View>
<View style={styles.userBio}> <View style={styles.userBio}>
<View style={styles.userBioRow}> <View style={styles.userBioRow}>
<Icon name="ios-person" style={styles.userBioLogo} size={25}/> <Text style={styles.userBioLogo} >Nome</Text>
<TextInput style={styles.userBioText} <TextInput style={styles.userBioText}
onChangeText={(n) => { onChangeText={(n) => {
@ -196,7 +207,18 @@ class Profile extends Component {
</View> </View>
<Divider style={{backgroundColor: 'black'}}/> <Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}> <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} <TextInput style={styles.userBioText}
onChangeText={(job) => { onChangeText={(job) => {
@ -208,7 +230,7 @@ class Profile extends Component {
<View style={styles.userBioRow}> <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} <TextInput style={styles.userBioText}
onChangeText={(phone) => { onChangeText={(phone) => {
@ -220,7 +242,7 @@ class Profile extends Component {
<View style={styles.userBioRow}> <View style={styles.userBioRow}>
<Icon name="ios-map" style={styles.userBioLogo} size={25}/> <Text style={styles.userBioLogo} >Morada</Text>
<TextInput style={styles.userBioText} <TextInput style={styles.userBioText}
onChangeText={(add) => { onChangeText={(add) => {
@ -232,22 +254,19 @@ class Profile extends Component {
<Divider style={{backgroundColor: 'black'}}/> <Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}> <View style={styles.userBioRow}>
<Icon name="ios-map" style={styles.userBioLogo} size={25}/> <Text style={styles.userBioLogo} >LinkedIn</Text>
<TextInput style={styles.userBioText} <TextInput style={styles.userBioText}
onChangeText={(city) => { onChangeText={(u) => {
this.setState({city: city}) this.setState({url: u})
}} }}
value={this.state.city}/> value={this.state.url}/>
</View> </View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}> <Button onPress={() => this.saveData() } title="Guardar Alterações" color="#CC1A17"
<Icon name="ios-person" style={styles.userBioLogo} size={25}/> />
<TouchableOpacity>
<Text style={styles.userCurriculum}>O meu Curriculo</Text>
</TouchableOpacity>
</View>
</View> </View>
</View> </View>
@ -255,51 +274,77 @@ class Profile extends Component {
<View style={styles.container}> <View style={styles.container}>
<View style={styles.userBioRowHeader}> <View style={styles.userBioRowHeader}>
<View style={styles.userBioRowTitle}> <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> </View>
<View style={styles.userBio}> <View style={styles.userBio}>
<View style={styles.userBioRow}>
<Text style={styles.userPassText} size={20}>
Old Password:
</Text>
<View style={styles.userBioRow}>
<TextInput style={styles.userBioText} <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> </View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}> <View style={styles.userBioRow}>
<Text style={styles.userPassText} size={20}>
Nova Password:
</Text>
<TextInput style={styles.userBioText} <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> </View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}> <View style={styles.userBioRow}>
<Text style={styles.userPassText} size={20}>
Repetir Password:
</Text>
<TextInput style={styles.userBioText} <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> </View>
<Button onPress={this._press} title="Alterar Password" color="#CC1A17"
/>
</View> </View>
</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> </ScrollView>
<TouchableOpacity onPress={this._logout} style={{
height: 50,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#CC1A17'
}}>
<Text style={{color: "#fff", fontWeight: 'bold'}}>Logout</Text>
</TouchableOpacity>
</View> </View>
@ -335,14 +380,14 @@ const styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'flex-start', justifyContent: 'flex-start',
padding: 10, padding: 10,
borderWidth: 2, // borderWidth: 2,
alignItems: 'center', alignItems: 'center',
}, },
userBioText: { userBioText: {
width: SCREEN_WIDTH * 0.40, width: SCREEN_WIDTH * 0.40,
flex: 2, flex: 2,
borderWidth: 2, // borderWidth: 2,
}, },
userPassText: { userPassText: {
@ -353,8 +398,8 @@ const styles = StyleSheet.create({
}, },
userBioLogo: { userBioLogo: {
marginLeft: SCREEN_WIDTH * 0.05, marginLeft: 10,
width: SCREEN_WIDTH * 0.15, width:80,
}, },
bottomLogOut: { bottomLogOut: {

View File

@ -32,7 +32,9 @@ import Swiper from 'react-native-swiper';
const SCREEN_HEIGHT = Dimensions.get("window").height; const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width; const SCREEN_WIDTH = Dimensions.get("window").width;
import FitImage from 'react-native-fit-image'; import FitImage from 'react-native-fit-image';
import MapView, {PROVIDER_GOOGLE} from 'react-native-maps'; import MapView, {PROVIDER_GOOGLE} from 'react-native-maps';
const formatObj = (obj) => { const formatObj = (obj) => {
@ -48,11 +50,12 @@ const formatObj = (obj) => {
class calendarDetail extends React.Component { class calendarDetail extends React.Component {
static navigationOptions = ({navigation}) => ({ static navigationOptions = ({navigation}) => ({
header: ( header: (
<NavAbsolute <NavAbsolute
navigation={navigation} navigation={navigation}
title={navigation.state.params.info.name} // title={navigation.state.params.info.name}
/> />
), ),
}); });
@ -65,6 +68,11 @@ class calendarDetail extends React.Component {
this.props.getEvents(this.props.user); this.props.getEvents(this.props.user);
console.log('didMount'); console.log('didMount');
console.log(this.props.events); console.log(this.props.events);
const {navigation} = this.props;
const info = navigation.getParam('info', 'error');
console.log("putas")
console.log(info)
} }
@ -101,29 +109,35 @@ class calendarDetail extends React.Component {
renderDescription = (info) => { renderDescription = (info) => {
return ( return (
<View> <View>
<View style={styles.cardContainer}> <View style={styles.header}>
<View style={{flexDirection: "row", alignItems: 'center', alignSelf:'center'}}> <View style={{flexDirection: "row", alignItems: 'center', alignSelf:'center'}}>
<Text style={styles.ramoText}>Onde está o ramo? xD </Text>
<View style={styles.timeText}> <View style={styles.timeText}>
<Text style={{color: "#CC1A17", fontSize: 15}}> <Text style={{color: "#CC1A17", fontSize: 15}}>
{info.time === info.timeEnd ? info.time : `${info.time} - ${info.timeEnd}`} {info.time === info.timeEnd ? info.time : `${info.time} - ${info.timeEnd}`}
</Text> </Text>
</View> </View>
</View> </View>
<View><Text style={{margin:10,marginTop:0, fontSize:20, color:'#CC1A17'}}>{info.name}</Text></View>
<View style={styles.details}>
<Text style={styles.nameAttendee}>Attendee Name</Text> <View style={{margin:10}}>
<Progress.Bar color={'#000000'} progress={info.Enrolled / info.MaxAttendees} height={10} <Progress.Bar color={'#000000'} progress={info.Enrolled / info.MaxAttendees} height={10}
unfilledColor={'white'} width={210}/> unfilledColor={'white'} width={210}/>
<Text style={{alignSelf: "center"}}>{info.Enrolled} / {info.MaxAttendees}</Text> <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> </View>
<View style={styles.cardContainer}> <View style={styles.block}>
<Text style={{fontSize: 20, color: "#CC1A17"}}>Descrição</Text> <Text style={{fontSize: 20, color: "#CC1A17"}}>Descrição</Text>
<Divider style={{backgroundColor: '#000'}}/> <Divider style={{backgroundColor: '#000'}}/>
<View style={{marginTop: 10}}> <View style={{marginTop: 10}}>
<Text style={{fontSize: 10}}> <Text>
{info.description} {info.description}
</Text> </Text>
</View> </View>
@ -131,7 +145,7 @@ class calendarDetail extends React.Component {
</View> </View>
) )
}; };
/*
renderMap = () => { renderMap = () => {
return ( return (
@ -153,7 +167,7 @@ class calendarDetail extends React.Component {
/> />
) )
}; };
*/
renderAttendee = () => { renderAttendee = () => {
return ( return (
<View style={{backgroundColor: '#fff', height: SCREEN_HEIGHT * 0.1}}> <View style={{backgroundColor: '#fff', height: SCREEN_HEIGHT * 0.1}}>
@ -195,7 +209,7 @@ class calendarDetail extends React.Component {
render() { render() {
const {navigation} = this.props; const {navigation} = this.props;
const info = navigation.getParam('info', 'error'); const info = navigation.getParam('info', 'error');
console.log(info);
return ( return (
@ -207,15 +221,15 @@ class calendarDetail extends React.Component {
</View> </View>
{this.renderDescription(info)} {this.renderDescription(info)}
</View> </View>
<View style={styles.cardContainer}> <View style={styles.block}>
<Text style={{fontSize: 20, color: "#CC1A17"}}>Localização</Text> <Text style={{fontSize: 20, color: "#CC1A17"}}>Localização</Text>
<Divider style={{backgroundColor: '#000', marginBottom: 10}}/> <Divider style={{backgroundColor: '#000', marginBottom: 10}}/>
{this.renderMap()}
</View> </View>
</ScrollView> </ScrollView>
<Divider style={{backgroundColor: 'black'}}/> <Divider style={{backgroundColor: 'black'}}/>
{this.renderAttendee()}
</View> </View>
) )
@ -225,6 +239,12 @@ class calendarDetail extends React.Component {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
block:{
marginTop:15,
backgroundColor:'white',
padding:20
},
AttendeeContainer: { AttendeeContainer: {
flexDirection: 'row', flexDirection: 'row',
height: 55, height: 55,
@ -284,8 +304,8 @@ const styles = StyleSheet.create({
ramoText: { ramoText: {
alignSelf: 'flex-start', alignSelf: 'flex-start',
marginBottom: 5, marginBottom: 5,
color: '#000', color: 'white',
fontSize: 20, fontSize: 17,
fontWeight: '400', fontWeight: '400',
}, },
@ -308,10 +328,17 @@ const styles = StyleSheet.create({
//marginBottom: 55, //marginBottom: 55,
}, },
header:{
flex: 1,
padding: 10,
backgroundColor: 'white',
borderRadius: 0,
},
cardContainer: { cardContainer: {
flex: 1, flex: 1,
padding: 10, padding: 10,
margin: 20, // margin: 20,
backgroundColor: 'white', backgroundColor: 'white',
borderRadius: 5, borderRadius: 5,
}, },
@ -410,7 +437,8 @@ function mapStateToProps(state, props) {
token: state.apiReducer.token, token: state.apiReducer.token,
user: state.apiReducer.user, user: state.apiReducer.user,
logged: state.apiReducer.logged, logged: state.apiReducer.logged,
events: state.apiReducer.events events: state.apiReducer.events,
careerPath: state.apiReducer.careerPath,
} }
} }

View File

@ -261,7 +261,7 @@ class choosePath extends React.Component {
style={{ width: "100%" }} style={{ width: "100%" }}
onValueChange={(itemValue, itemIndex) => { onValueChange={(itemValue, itemIndex) => {
this.setState({ guest: itemValue }); this.setState({ guest: itemValue });
this.props.timerChangeGuest(); // this.props.timerChangeGuest();
this.props.waitChangeGuest(); this.props.waitChangeGuest();
this.props.changeGuestList( this.props.changeGuestList(
@ -324,7 +324,14 @@ class choosePath extends React.Component {
<View style={styles.session}> <View style={styles.session}>
{this._verifySession(item[index].Id) && ( {this._verifySession(item[index].Id) && (
<TouchableOpacity <TouchableOpacity
onPress={() => {}} onPress={() => {
this.props.removeSession(
this.props.user,
this.props.userDetails.token,
item[index].Id
);
}}
style={{ flex: 1, alignSelf: "center" }} style={{ flex: 1, alignSelf: "center" }}
> >
<View> <View>
@ -339,11 +346,14 @@ class choosePath extends React.Component {
{!this._verifySession(item[index].Id) && ( {!this._verifySession(item[index].Id) && (
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
this.props.waitChangeGuest()
//this.props.waitChangeGuest()
this.props.signSession( this.props.signSession(
this.props.user,
this.props.userDetails.token, this.props.userDetails.token,
item[index].Id item[index].Id
); );
}} }}
style={{ flex: 1, alignSelf: "center" }} style={{ flex: 1, alignSelf: "center" }}
> >
@ -395,11 +405,12 @@ class choosePath extends React.Component {
</View> </View>
{(this.props.changingGuest || this.props.Blocks == true) && ( {(this.props.changingGuest || this.props.Blocks == true) && (
<View style={{ flex:1, height:SCREEN_HEIGHT*0.6, alignSelf:'center',}}>
<ActivityIndicator <ActivityIndicator
size="large" size="large"
color="red" color="red"
style={{ flex: 1, alignContent: "center" }} style={{ alignContent: "center" , alignSelf:'center', marginTop:SCREEN_HEIGHT*0.2}}
/> /></View>
)} )}
</ScrollView> </ScrollView>
</View> </View>

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 USER_INFO= 'USER_INFO'
export const HOLD='HOLD' export const HOLD='HOLD'
export const GET_EVENTS='GET_EVENTS' 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 //API BLUETREND CALENDÁRIO
@ -17,7 +23,7 @@ export const CHANGE_GUEST = 'CHANGE_GUEST'
export const GET_SESSIONS= 'GET_SESSIONS' export const GET_SESSIONS= 'GET_SESSIONS'
export const SIGN_SESSION= 'SIGN_SESSION' export const SIGN_SESSION= 'SIGN_SESSION'
export const WAIT_CHANGE='WAIT_CHANGE' export const WAIT_CHANGE='WAIT_CHANGE'
export const REMOVE_SESSION = 'REMOVE_SESSION'
//UI //UI

View File

@ -1,6 +1,6 @@
import { AsyncStorage } from "react-native"; import { AsyncStorage } from "react-native";
import { NetInfo , Alert} from "react-native"; import { NetInfo, Alert } from "react-native";
var _ = require("lodash"); var _ = require("lodash");
@ -20,7 +20,9 @@ import {
WAIT_CHANGE, WAIT_CHANGE,
SIGN_SESSION, SIGN_SESSION,
OPEN_MODAL, OPEN_MODAL,
LOADINGLOGIN LOADINGLOGIN,
REMOVE_SESSION,
UPDATE_USER
} from "./actionTypes"; //Import the actions types constant we defined in our actions } from "./actionTypes"; //Import the actions types constant we defined in our actions
import moment from "moment"; import moment from "moment";
@ -39,43 +41,64 @@ axios.defaults.baseURL = "http://enei2019.uingress.com/internal/api";
const map = require("lodash/fp/map").convert({ cap: false }); const map = require("lodash/fp/map").convert({ cap: false });
export function waitLogin() {
export function waitLogin(){
return dispatch=>{
dispatch({
type: LOADINGLOGIN,
});
}
}
//faz autenticação com API interna
export function loginInternal(userDetails){
axios.defaults.baseURL = "http://127.0.0.1:5000";
return dispatch => { return dispatch => {
axios.post('/api/login',{
"username": "cena",
"password": "password"
}).then(a=>{
console.log("sucesso!")
console.log(a)
}).catch(p=>{
console.log(p)
})
dispatch({ dispatch({
type: OPEN_MODAL, type: LOADINGLOGIN
}); });
}; };
} }
export function changePassword(token, old, new1, new2) {
axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}`
};
axios.defaults.baseURL = "http://enei2019.uingress.com/internal/api";
return dispatch => {
if (new1 != new2) {
Alert.alert("ERRO!", "As passords são diferentes...");
} else {
axios
.post("/User/ChangePassword", {
OldPassword: old,
NewPassword: new1
})
.then(a => {
Alert.alert("Sucesso!", "Password alterada com sucesso")
})
.catch(p => {
Alert.alert("ERRO!", "Erro a alterar a password.\nA palavra original é inválida...\nCaso o erro persista verifica a tua conexão à internet e tenta novamente")
});
dispatch({
type: OPEN_MODAL
});
}
};
}
//faz autenticação com API interna
export function loginInternal(userDetails) {
axios.defaults.baseURL = "http://127.0.0.1:5000";
return dispatch => {
axios
.post("/api/login", {
username: "cena",
password: "password"
})
.then(a => {
console.log("sucesso!");
console.log(a);
})
.catch(p => {
console.log(p);
});
dispatch({
type: OPEN_MODAL
});
};
}
export function openModal(info, t) { export function openModal(info, t) {
return dispatch => { return dispatch => {
@ -97,23 +120,29 @@ export function closeModal() {
} }
export function updateUser(token, user) { export function updateUser(token, user) {
axios.defaults.baseURL = "http://enei2019.uingress.com/internal/api";
axios.defaults.headers.common = { axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}` Authorization: `bearer ${token.access_token}`
}; };
return dispatch => { return dispatch => {
axios axios
.post("/Attendee/Edit", user)
.post("/Attendee/Edit", user)
.then(a => { .then(a => {
console.log(a);
alert("guardado com sucesso"); Alert.alert("Sucesso", "As informações pessoais foram guardadas com sucesso.")
console.log(a.data)
dispatch({ dispatch({
type: UPDATE_USER type: UPDATE_USER,
// guests: response.data user:a.data
}); });
}) })
.catch(b => { .catch(b => {
alert("Erro a guardar os dados"); Alert.alert("ERRO!","Ocorreu um erro a guardar os dados pessoais.")
alert(b)
}); });
}; };
} }
@ -124,27 +153,27 @@ function getCareerPath(sessions) {
for (let key in sessions) { for (let key in sessions) {
if (sessions[key].Name == "IA") { if (sessions[key].Name == "IA") {
careerPath = "Artificial Inteligence"; careerPath = "Artificial Inteligence";
careerColor='#CC1A17' careerColor = "#CC1A17";
} }
if (sessions[key].Name == "IOT") { if (sessions[key].Name == "IOT") {
careerPath = "Internet of Things"; careerPath = "Internet of Things";
careerColor= "green" careerColor = "green";
} }
if (sessions[key].Name == "WEB") { if (sessions[key].Name == "WEB") {
careerPath = "Web Development"; careerPath = "Web Development";
careerColor="purple" careerColor = "purple";
} }
if (sessions[key].Name == "NET") { if (sessions[key].Name == "NET") {
careerPath = "Networking and Security"; careerPath = "Networking and Security";
careerColor="blue" careerColor = "blue";
} }
if (sessions[key].Name == "MOB") { if (sessions[key].Name == "MOB") {
careerPath = "Mobile Development"; careerPath = "Mobile Development";
careerColor="orange" careerColor = "orange";
} }
if(sessions[key].Name=="DS"){ if (sessions[key].Name == "DS") {
careerPath="Data Science" careerPath = "Data Science";
careerColor="yellow" careerColor = "yellow";
} }
} }
return { name: careerPath, color: careerColor }; return { name: careerPath, color: careerColor };
@ -169,8 +198,7 @@ export const connectionState = status => {
return { type: "CHANGE_CONNECTION_STATUS", isConnected: status }; return { type: "CHANGE_CONNECTION_STATUS", isConnected: status };
}; };
//inscrição em palestra através de ID export function removeSession(user, token, idSession) {
export function signSession(token, idSession) {
axios.defaults.headers.common = { axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}` Authorization: `bearer ${token.access_token}`
}; };
@ -183,9 +211,10 @@ export function signSession(token, idSession) {
return dispatch => { return dispatch => {
//adiciona participante a uma palestra //adiciona participante a uma palestra
axios axios
.post("/Session/AddAttendee", obj) .post("/Session/RemoveAttendee", obj)
//se não existir erro na chamada... //se não existir erro na chamada...
.then(a => { .then(a => {
console.log(a);
if (a.data.Success) { if (a.data.Success) {
axios axios
.get("/Attendee/AvailableSessions") .get("/Attendee/AvailableSessions")
@ -204,7 +233,10 @@ export function signSession(token, idSession) {
cenas.push(result[key]); cenas.push(result[key]);
} }
alert("Inscrição efectuada com sucesso"); Alert.alert(
"Sucesso",
"A inscrição na sessão foi removida com sucesso!"
);
//obter informações pessoais: //obter informações pessoais:
axios axios
@ -215,13 +247,14 @@ export function signSession(token, idSession) {
}) })
.then(sucess => { .then(sucess => {
dispatch({ dispatch({
type: SIGN_SESSION, type: REMOVE_SESSION,
sessions: response.data, sessions: response.data,
Blocks: cenas, Blocks: cenas,
changeGuestList: false, changeGuestList: false,
careerPath: careerPath, careerPath: careerPath,
user: sucess.data user: sucess.data
}); });
getEvents(user);
}); });
}) })
.catch(function(error) { .catch(function(error) {
@ -232,7 +265,7 @@ export function signSession(token, idSession) {
} else { } else {
alert("Erro a inscrever na palestra"); alert("Erro a inscrever na palestra");
dispatch({ dispatch({
type: SIGN_SESSION, type: REMOVE_SESSION,
waitChangeGuest: false waitChangeGuest: false
}); });
} }
@ -243,6 +276,91 @@ export function signSession(token, idSession) {
}; };
} }
//inscrição em palestra através de ID
export function signSession(user, token, idSession) {
axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}`
};
var obj = {
IdSession: idSession,
Direction: 0
};
return dispatch => {
//adiciona participante a uma palestra
axios
.post("/Session/AddAttendee", obj)
//se não existir erro na chamada...
.then(a => {
if (a.data.Success) {
axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}`
};
axios
.get("/Attendee/AvailableSessions")
.then(function(response) {
console.log(response);
var sessions = response.data;
var careerPath = getCareerPath(sessions);
var cenas = [];
const result = flow(groupBy("SessionStart"))(response.data);
for (let key in result) {
result[key].option = 0;
cenas.push(result[key]);
}
Alert.alert(
"Sucesso",
"Inscrição na sessão efectuada com sucesso"
);
console.log("aqui1")
//obter informações pessoais:
axios
.get("/Attendee/Detail")
.catch(error => {
alert(error);
})
.then(sucess => {
console.log("aqui2")
var result = getE(user);
dispatch({
type: SIGN_SESSION,
sessions: response.data,
Blocks: cenas,
changeGuestList: false,
careerPath: careerPath,
user: sucess.data,
events: result.a,
day1: result.a,
day2: result.b,
day3: result.c,
day4: result.d
});
});
})
.catch(function(error) {
console.log(error);
});
} else {
Alert.alert("ERRO!!", a.data.Error);
dispatch({
type: SIGN_SESSION,
waitChangeGuest: false
});
}
})
.catch(b => {
// alert("Erro a inscrever na palestra");
});
};
}
export function getSessions(token) { export function getSessions(token) {
axios.defaults.headers.common = { axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}` Authorization: `bearer ${token.access_token}`
@ -324,10 +442,8 @@ export function getAvailableGuestlists(token) {
12 - IOT 12 - IOT
14 - WB 14 - WB
15 - DS 15 - DS
*/ */
export function changeGuestList(token, guestID) { export function changeGuestList(token, guestID) {
//http://enei2019.uingress.com/internal/api/Attendee/ChangeGuestlist/ //http://enei2019.uingress.com/internal/api/Attendee/ChangeGuestlist/
axios.defaults.headers.common = { axios.defaults.headers.common = {
@ -340,7 +456,7 @@ export function changeGuestList(token, guestID) {
axios axios
.get(full) .get(full)
.then(function(response) { .then(function(response) {
console.log(response)
axios.defaults.baseURL = "http://enei2019.uingress.com/internal/api"; axios.defaults.baseURL = "http://enei2019.uingress.com/internal/api";
axios.defaults.headers.common = { axios.defaults.headers.common = {
@ -351,11 +467,13 @@ export function changeGuestList(token, guestID) {
.get("/Attendee/AvailableSessions") .get("/Attendee/AvailableSessions")
.then(function(response) { .then(function(response) {
// handle success // handle success
//console.log(response); //console.log(response);
var cenas = []; var cenas = [];
c= getCareerPath(response.data); c = getCareerPath(response.data);
const result = flow( const result = flow(
groupBy("SessionStart") groupBy("SessionStart")
// map((Id) => ({Id})), // map((Id) => ({Id})),
@ -363,11 +481,14 @@ export function changeGuestList(token, guestID) {
)(response.data); )(response.data);
for (let key in result) { for (let key in result) {
result[key].option = 0; result[key].option = 0;
cenas.push(result[key]); cenas.push(result[key]);
console.log();
} }
console.log("-.-.-..-.-.-.-.-.-.")
console.log(cenas); console.log(cenas);
console.log("-.-.-..-.-.-.-.-.-.")
dispatch({ dispatch({
type: CHANGE_GUEST, type: CHANGE_GUEST,
sessions: response.data, sessions: response.data,
@ -459,111 +580,112 @@ export function getAvailableSessions(token) {
}; };
} }
function getE(user) {
var cenas = [];
let events = [];
var i = 0;
for (let key in user.Sessions) {
events.push({
key: i++,
time: moment(user.Sessions[key].SessionStart).format("HH:mm"),
timeEnd: moment(user.Sessions[key].SessionEnd).format("HH:mm"),
//lineColor:'#009688',
imageUrl:
"https://d2v9y0dukr6mq2.cloudfront.net/video/thumbnail/Vjkyj2hBg/welcome-white-sign-with-falling-colorful-confetti-animation-on-white-background_sglmmh3qm__F0013.png",
description: user.Sessions[key].Description,
name: user.Sessions[key].Name,
Enrolled: user.Sessions[key].Enrolled,
MaxAttendees: user.Sessions[key].MaxAttendees,
day: moment(user.Sessions[key].SessionStart).format("DD")
});
}
const result = flow(groupBy("day"))(events);
for (let key in result) {
cenas.push(result[key]);
}
var a = [],
b = [],
c = [],
d = [];
for (let key in cenas[0]) {
a.push({
time: cenas[0][key].time,
timeEnd: cenas[0][key].timeEnd,
imageUrl: cenas[0][key].imageUrl,
description: cenas[0][key].description,
name: cenas[0][key].name,
Enrolled: cenas[0][key].Enrolled,
MaxAttendees: cenas[0][key].MaxAttendees,
day: cenas[0][key].day
});
}
for (let key in cenas[1]) {
b.push({
time: cenas[1][key].time,
timeEnd: cenas[1][key].timeEnd,
imageUrl: cenas[1][key].imageUrl,
description: cenas[1][key].description,
name: cenas[1][key].name,
Enrolled: cenas[1][key].Enrolled,
MaxAttendees: cenas[1][key].MaxAttendees,
day: cenas[1][key].day
});
}
for (let key in cenas[2]) {
c.push({
time: cenas[2][key].time,
timeEnd: cenas[2][key].timeEnd,
imageUrl: cenas[2][key].imageUrl,
description: cenas[2][key].description,
name: cenas[2][key].name,
Enrolled: cenas[2][key].Enrolled,
MaxAttendees: cenas[2][key].MaxAttendees,
day: cenas[2][key].day
});
}
for (let key in cenas[3]) {
d.push({
time: cenas[3][key].time,
timeEnd: cenas[3][key].timeEnd,
imageUrl: cenas[3][key].imageUrl,
description: cenas[3][key].description,
name: cenas[3][key].name,
Enrolled: cenas[3][key].Enrolled,
MaxAttendees: cenas[3][key].MaxAttendees,
day: cenas[3][key].day
});
}
a = _.sortBy(a, function(o) {
return o.time;
});
b = _.sortBy(b, function(o) {
return o.time;
});
c = _.sortBy(c, function(o) {
return o.time;
});
d = _.sortBy(d, function(o) {
return o.time;
});
return { a, b, c, d };
}
export function getEvents(user) { export function getEvents(user) {
var result = getE(user);
return dispatch => { return dispatch => {
let events = [];
console.log("chegou aqui");
var i=0
for (let key in user.Sessions) {
events.push({
key:i++,
time: moment(user.Sessions[key].SessionStart).format("HH:mm"),
timeEnd: moment(user.Sessions[key].SessionEnd).format("HH:mm"),
//lineColor:'#009688',
imageUrl:
"https://d2v9y0dukr6mq2.cloudfront.net/video/thumbnail/Vjkyj2hBg/welcome-white-sign-with-falling-colorful-confetti-animation-on-white-background_sglmmh3qm__F0013.png",
description: user.Sessions[key].Description,
name: user.Sessions[key].Name,
Enrolled: user.Sessions[key].Enrolled,
MaxAttendees: user.Sessions[key].MaxAttendees,
day: moment(user.Sessions[key].SessionStart).format("DD")
});
}
const result = flow(
groupBy("day")
)(events);
var cenas=[];
for (let key in result) {
cenas.push(result[key]);
console.log();
}
console.log(".--------")
console.log(cenas);
console.log(".--------")
var a=[], b=[],c=[],d=[]
for (let key in cenas[0]) {
a.push({
time:cenas[0][key].time ,
timeEnd: cenas[0][key].timeEnd,
imageUrl:cenas[0][key].imageUrl,
description: cenas[0][key].description,
name:cenas[0][key].name,
Enrolled: cenas[0][key].Enrolled,
MaxAttendees: cenas[0][key].MaxAttendees,
day: cenas[0][key].day
});
}
for (let key in cenas[1]) {
b.push({
time:cenas[1][key].time ,
timeEnd: cenas[1][key].timeEnd,
imageUrl:cenas[1][key].imageUrl,
description: cenas[1][key].description,
name:cenas[1][key].name,
Enrolled: cenas[1][key].Enrolled,
MaxAttendees: cenas[1][key].MaxAttendees,
day: cenas[1][key].day
});
}
for (let key in cenas[2]) {
c.push({
time:cenas[2][key].time ,
timeEnd: cenas[2][key].timeEnd,
imageUrl:cenas[2][key].imageUrl,
description: cenas[2][key].description,
name:cenas[2][key].name,
Enrolled: cenas[2][key].Enrolled,
MaxAttendees: cenas[2][key].MaxAttendees,
day: cenas[2][key].day
});
}
for (let key in cenas[3]) {
d.push({
time:cenas[3][key].time ,
timeEnd: cenas[3][key].timeEnd,
imageUrl:cenas[3][key].imageUrl,
description: cenas[3][key].description,
name:cenas[3][key].name,
Enrolled: cenas[3][key].Enrolled,
MaxAttendees: cenas[3][key].MaxAttendees,
day: cenas[3][key].day
});
}
a=_.sortBy(a, function(o) { return o.time; });
b=_.sortBy(b, function(o) { return o.time; });
c=_.sortBy(c, function(o) { return o.time; });
d=_.sortBy(d, function(o) { return o.time; });
dispatch({ dispatch({
type: GET_EVENTS, type: GET_EVENTS,
events:a, events: result.a,
day1:a, day1: result.a,
day2:b, day2: result.b,
day3:c, day3: result.c,
day4:d day4: result.d
}); });
}; };
} }
@ -653,54 +775,56 @@ export function login(user, pass) {
logged: false, logged: false,
failedAttempt: true, failedAttempt: true,
tokenData: "error", tokenData: "error",
user: { Name: "" }, user: { Name: "" }
}); });
}) })
.catch(err=>{ .catch(err => {
console.log("error") console.log("error");
}) })
.then(res => res.json()) .then(res => res.json())
.then(parsed => { .then(parsed => {
console.log(parsed) console.log(parsed);
if ( if (
parsed.error_description == parsed.error_description ==
"Provided username and password is incorrect" "Provided username and password is incorrect"
) { ) {
Alert.alert("Dados Inválidos","Podes sempre fazer reset da password para o email.") Alert.alert(
"Dados Inválidos",
"Podes sempre fazer reset da password para o email."
);
dispatch({ dispatch({
type: API_LOGIN, type: API_LOGIN,
logged: false, logged: false,
failedAttempt: true, failedAttempt: true,
token: obj, token: obj,
user: { Name: "Henrique" }, user: { Name: "Henrique" },
userDetails:{}, userDetails: {},
waitLogin:false, waitLogin: false,
onHold:false onHold: false
}); });
return; return;
} } else {
else{ var obj = {
var obj = { access_token: parsed.access_token,
access_token: parsed.access_token, expirationDateToken: Math.round(new Date().getTime() / 1000) + 3598,
expirationDateToken: Math.round(new Date().getTime() / 1000) + 3598, refreshToken: parsed.refresh_token,
refreshToken: parsed.refresh_token, valid: true
valid: true };
};
var details = { var details = {
username: user, username: user,
password: pass password: pass
}; };
dispatch({ dispatch({
type: API_LOGIN, type: API_LOGIN,
logged: true, logged: true,
failedAttempt: false, failedAttempt: false,
token: obj, token: obj,
user: { Name: "Henrique" }, user: { Name: "Henrique" },
userDetails: details userDetails: details
});} });
}
}); });
}; };
} }
@ -1000,4 +1124,4 @@ export function checkUser(userDetails) {
//dispatch menu de login //dispatch menu de login
} }
}; };
} }

View File

@ -16,7 +16,11 @@ export {checkUser,
openModal, openModal,
closeModal, closeModal,
loginInternal, loginInternal,
waitLogin waitLogin,
removeSession,
changePassword,
resetPassword
} from "./api" } from "./api"
export { export {

View File

@ -15,7 +15,9 @@ import {
SIGN_SESSION, SIGN_SESSION,
OPEN_MODAL, OPEN_MODAL,
CLOSE_MODAL, CLOSE_MODAL,
LOADINGLOGIN LOADINGLOGIN,
REMOVE_SESSION,
UPDATE_USER,
} from "../actions/actionTypes"; //Import the actions types constant we defined in our actions } from "../actions/actionTypes"; //Import the actions types constant we defined in our actions
@ -42,13 +44,12 @@ let apiState = {
sessions: {}, sessions: {},
Blocks: {}, Blocks: {},
onHoldBlocks: true, onHoldBlocks: true,
careerPath:{name:'Sem Career Path', color:'#eeeeee'}, careerPath: { name: "Sem Career Path", color: "#eeeeee" },
a:{}, a: {},
b:{}, b: {},
c:{}, c: {},
d:{}, d: {},
loadingLogin:false, loadingLogin: false
}; };
const apiReducer = (state = apiState, action) => { const apiReducer = (state = apiState, action) => {
@ -100,8 +101,11 @@ const apiReducer = (state = apiState, action) => {
isConnected: action.isConnected isConnected: action.isConnected
}); });
case UPDATE_USER:
state = Object.assign({}, state, { user:action.user});
return state
case LOADINGLOGIN: case LOADINGLOGIN:
state= Object.assign({}, state, {loadingLogin:true}); state = Object.assign({}, state, { loadingLogin: true });
case HOLD: case HOLD:
state = Object.assign({}, state, { onHold: true }); state = Object.assign({}, state, { onHold: true });
@ -118,7 +122,7 @@ const apiReducer = (state = apiState, action) => {
username: action.userDetails.username, username: action.userDetails.username,
password: action.userDetails.password password: action.userDetails.password
}, },
loadingLogin:false, loadingLogin: false,
onHold: action.onHold onHold: action.onHold
}); });
@ -137,7 +141,11 @@ const apiReducer = (state = apiState, action) => {
return state; return state;
case LOGOUT_USER: case LOGOUT_USER:
state = Object.assign({}, state, { user:{}, userDetails:{}, logged:false}); state = Object.assign({}, state, {
user: {},
userDetails: {},
logged: false
});
return state; return state;
@ -151,12 +159,28 @@ const apiReducer = (state = apiState, action) => {
return state; return state;
case GET_EVENTS: case GET_EVENTS:
state = Object.assign({}, state, { events: action.events , a:action.day1, b:action.day2, c:action.day3, d:action.day4}); state = Object.assign({}, state, {
events: action.events,
a: action.day1,
b: action.day2,
c: action.day3,
d: action.day4
});
return state; 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: case OPEN_MODAL:
console.log("open modal") console.log("open modal");
state = Object.assign({}, state, { state = Object.assign({}, state, {
modalOpen: true, modalOpen: true,
modalInfo: action.modalInfo, modalInfo: action.modalInfo,
@ -173,13 +197,30 @@ const apiReducer = (state = apiState, action) => {
return state; return state;
case SIGN_SESSION: case SIGN_SESSION:
state = Object.assign({}, state, {
if(action.sessions==undefined || action.Blocks==undefined || action.user==undefined){
state = Object.assign({}, state, {
changingGuest: false,
});
}
else{
state = Object.assign({}, state, {
sessions: action.sessions, sessions: action.sessions,
Blocks: action.Blocks, Blocks: action.Blocks,
careerPath: action.careerPath, careerPath: action.careerPath,
changingGuest: action.changingGuest, changingGuest: false,
user:action.user user: action.user,
a:action.day1,
b:action.day2,
c:action.day3,
d:action.day4
}); });
}
return state; return state;
case SESSION_BLOCKS: case SESSION_BLOCKS:
@ -225,4 +266,4 @@ const apiReducer = (state = apiState, action) => {
return state; return state;
} }
}; };
export default apiReducer; export default apiReducer;

5
App/package-lock.json generated
View File

@ -2745,6 +2745,11 @@
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" "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": { "emojis-list": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz",

View File

@ -9,6 +9,7 @@
"dependencies": { "dependencies": {
"@redux-offline/redux-offline": "^2.5.1", "@redux-offline/redux-offline": "^2.5.1",
"axios": "^0.18.0", "axios": "^0.18.0",
"email-validator": "^2.0.4",
"expo": "^32.0.5", "expo": "^32.0.5",
"material-icons-react": "^1.0.4", "material-icons-react": "^1.0.4",
"moment": "^2.24.0", "moment": "^2.24.0",

0
App/{ Normal file
View File

View File

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt; using System.IdentityModel.Tokens.Jwt;
using System.Net.Http;
using System.Security.Claims; using System.Security.Claims;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -14,6 +15,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json.Linq;
namespace api.Controllers namespace api.Controllers
{ {
@ -30,15 +32,18 @@ namespace api.Controllers
public IUsersRepository _repo { get; } public IUsersRepository _repo { get; }
private readonly IMapper _mapper; private readonly IMapper _mapper;
private readonly RoleManager<Role> _roleManager; 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; _mapper = mapper;
_roleManager = roleManager; _roleManager = roleManager;
_repo = repo; _repo = repo;
this.clientFactory = clientFactory;
this.config = config; this.config = config;
_userManager = UserManager; _userManager = UserManager;
_signInManager = SignInManager; _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) private async Task<string> GenerateJwtToken(User user)
{ {
var claims = new List<Claim> 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. // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddHttpClient();
services.AddAutoMapper(); services.AddAutoMapper();
services.AddScoped<IUsersRepository, UsersRepository>(); services.AddScoped<IUsersRepository, UsersRepository>();
services.AddScoped<IEventsRepository, EventsRepository>(); services.AddScoped<IEventsRepository, EventsRepository>();

View File

@ -3,12 +3,13 @@
<TargetFramework>netcoreapp2.1</TargetFramework> <TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Folder Include="wwwroot\"/> <Folder Include="wwwroot\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0"/> <PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1"/> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="5.0.1"/> <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="5.0.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0"/> <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
</ItemGroup> </ItemGroup>
</Project> </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", "TargetFramework": "netcoreapp2.1",
"TagHelpers": [], "TagHelpers": [],
"Configuration": { "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 class="unavailable">Programa</li>
<li><a href="#precos" title="Preços">Preços</a></li> <li><a href="#precos" title="Preços">Preços</a></li>
<li class="unavailable">App</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="#sponsors" title="Sponsors">Sponsors</a></li>
<li><a href="#faqs" title="Faq's">Faq's</a></li> <li><a href="#faqs" title="Faq's">Faq's</a></li>
</ul> </ul>
@ -121,42 +122,53 @@
<h1>Preços</h1> <h1>Preços</h1>
<hr> <hr>
<div class="price-block"> <div class="price-block">
<div class="type">Early-Bird</div> <div class="type">Normal</div>
<div> <div>
<div class="individual-price"> <div class="individual-price">
<div class="price"><span></span>25</div> <div class="price"><span></span>25</div>
<div class="label">Grupo</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>
</div> </div>
<a href="https://tickets.enei.pt/group" title="Comprar" target="_blank" <a href="https://tickets.enei.pt/group" title="Comprar" target="_blank"
class="buy-button">Comprar</a> class="buy-button">Comprar</a>
</div> </div>
<div class="price-block"> <div class="price-block">
<div class="type">Early-Bird</div> <div class="type">Normal</div>
<div> <div>
<div class="individual-price"> <div class="individual-price">
<div class="price"><span></span>30</div> <div class="price"><span></span>30</div>
<div class="label">Individual</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>
</div> </div>
<a href="https://tickets.enei.pt" title="Comprar" target="_blank" class="buy-button">Comprar</a> <a href="https://tickets.enei.pt" title="Comprar" target="_blank" class="buy-button">Comprar</a>
</div> </div>
<div class="price-block disable"> <div class="price-block">
<div class="type">Pontual</div> <div class="type">Pontual</div>
<div class="individual-price"> <div class="individual-price">
<div class="price"><span></span>20</div> <div class="price"><span></span>20</div>
<div class="label">Individual</div> <div class="label">Individual</div>
<span class="options">*Alimentação incluída</span> <span class="options">*Alimentação incluída</span>
</div> </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>
</div> </div>
</div> </div>
</section> </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 --> <!-- sponsors section -->
<section id="sponsors"> <section id="sponsors">
<div class="container"> <div class="container">
@ -173,6 +185,20 @@
</div> </div>
</div> </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> </section>
<!-- faqs section --> <!-- faqs section -->
@ -277,14 +303,12 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <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> <script type="text/javascript" src="js/scripts.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<!-- 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 async src="https://www.googletagmanager.com/gtag/js?id=UA-130588243-1"></script>
<script> <script>
window.dataLayer = window.dataLayer || []; window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); } function gtag() { dataLayer.push(arguments); }
gtag('js', new Date()); gtag('js', new Date());
gtag('config', 'UA-130588243-1'); gtag('config', 'UA-130588243-1');
</script> </script>
</body> </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, #faqs,
#tickets { #tickets {
background: url("imgs/cubes2-image.png") no-repeat bottom right; background: url("imgs/cubes2-image.png") no-repeat bottom right;
@ -971,6 +1026,22 @@ hr {
transform: scale(1.03); 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 { #social-network {