Merge branch 'master' into zmiguel
This commit is contained in:
commit
befb0c4f5c
933
App/app/App.js
933
App/app/App.js
|
@ -1,555 +1,504 @@
|
|||
import React, {Component} from 'react';
|
||||
import React, { Component } from "react";
|
||||
import {
|
||||
Platform,
|
||||
StyleSheet,
|
||||
Text,
|
||||
View,
|
||||
StatusBar,
|
||||
Dimensions,
|
||||
Image,
|
||||
ActivityIndicator,
|
||||
Button,
|
||||
TouchableHighlight,
|
||||
Keyboard,
|
||||
ImageBackground,
|
||||
LinearGradient,
|
||||
TouchableOpacity,
|
||||
TextInput,
|
||||
NetInfo,
|
||||
Animated
|
||||
Platform,
|
||||
StyleSheet,
|
||||
Text,
|
||||
View,
|
||||
StatusBar,
|
||||
Dimensions,
|
||||
Image,
|
||||
ActivityIndicator,
|
||||
Button,
|
||||
TouchableHighlight,
|
||||
Keyboard,
|
||||
ImageBackground,
|
||||
LinearGradient,
|
||||
TouchableOpacity,
|
||||
TextInput,
|
||||
NetInfo,
|
||||
Animated
|
||||
} from "react-native";
|
||||
|
||||
} from 'react-native';
|
||||
import { bindActionCreators } from "redux";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import {bindActionCreators} from 'redux';
|
||||
import {connect} from 'react-redux';
|
||||
import QRCodeScanner from "react-native-qrcode-scanner";
|
||||
import { UtilStyles } from "./assets/styles";
|
||||
|
||||
import QRCodeScanner from 'react-native-qrcode-scanner';
|
||||
import {UtilStyles} from './assets/styles'
|
||||
import * as Actions from "./store/actions";
|
||||
|
||||
import * as Actions from './store/actions';
|
||||
|
||||
import {RkButton, RkTheme, RkText, RkTextInput} from 'react-native-ui-kitten';
|
||||
import { RkButton, RkTheme, RkText, RkTextInput } from "react-native-ui-kitten";
|
||||
|
||||
import Modal from "react-native-modal";
|
||||
|
||||
import Router from './Router'
|
||||
import Router from "./Router";
|
||||
|
||||
import Icon from "react-native-vector-icons/Ionicons"
|
||||
import Icon from "react-native-vector-icons/Ionicons";
|
||||
|
||||
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
||||
const SCREEN_WIDTH = Dimensions.get("window").width;
|
||||
|
||||
import Swiper from 'react-native-swiper';
|
||||
var TimerMixin = require('react-timer-mixin');
|
||||
import Swiper from "react-native-swiper";
|
||||
var TimerMixin = require("react-timer-mixin");
|
||||
|
||||
function handleConnectivityChange() {
|
||||
console.log("asdasd");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class App extends Component {
|
||||
handleConnectivityChange = isConnected => {
|
||||
this.setState({ isConnected });
|
||||
}
|
||||
_activate=()=>{
|
||||
|
||||
this.setState({ isModalVisible: !this.state.isModalVisible});
|
||||
this.scanner.reactivate();
|
||||
|
||||
}
|
||||
_scanQr=()=>{
|
||||
this.props.openScannerLogin()
|
||||
console.log(this.props.UI_loginScannerActive)
|
||||
}
|
||||
_tryLogin=()=>{
|
||||
|
||||
//console.log(this.state.text)
|
||||
//this.scanner.reactivate();
|
||||
this.props.login(this.state.username, this.state.text);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
_toggleModal = () =>
|
||||
this.setState({ isModalVisible: !this.state.isModalVisible });
|
||||
|
||||
constructor(props) {
|
||||
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
|
||||
token: {valid: false},
|
||||
tokenData: '',
|
||||
onHold: true,
|
||||
logged: false,
|
||||
isModalVisible: false,
|
||||
state : {text: ''},
|
||||
username:'QR code',
|
||||
failedAttempt: false,
|
||||
push:4,
|
||||
UI_loginScannerActive:false,
|
||||
userDetails:{username:'', password:''},
|
||||
isConnected: true
|
||||
};
|
||||
|
||||
}
|
||||
_print=()=>{
|
||||
console.log("hello")
|
||||
this.setState({push:0})
|
||||
}
|
||||
checkValue=(e)=>{
|
||||
console.log("check"+e)
|
||||
}
|
||||
_handleConnectionChange = (isConnected) => {
|
||||
this.props.connectionState(true);
|
||||
};
|
||||
|
||||
|
||||
componentDidMount() {
|
||||
this.props.hold();
|
||||
NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange);
|
||||
|
||||
this.setState({isModalVisible: false})
|
||||
//verifica se o utilizador tem token guardado
|
||||
this.props.checkUser(this.props.userDetails);
|
||||
this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
|
||||
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
|
||||
|
||||
|
||||
}
|
||||
componentWillUnmount() {
|
||||
NetInfo.isConnected.removeEventListener('connectionChange', this.handleConnectivityChange);
|
||||
}
|
||||
|
||||
_keyboardDidShow () {
|
||||
//alert('Keyboard Shown');
|
||||
// this.setState({push:0})
|
||||
|
||||
}
|
||||
|
||||
_keyboardDidHide () {
|
||||
|
||||
//this.setState({push:4})
|
||||
|
||||
}
|
||||
onSuccess = (e) => {
|
||||
|
||||
// this.setState({ isModalVisible: !this.state.isModalVisible });
|
||||
// this.props.login(e.data, 'f8908cc0');
|
||||
this.props.closeLoginQRScan();
|
||||
this.setState({username:e.data})
|
||||
|
||||
console.log("QR code lido");
|
||||
};
|
||||
_activate = () => {
|
||||
this.setState({ isModalVisible: !this.state.isModalVisible });
|
||||
this.scanner.reactivate();
|
||||
};
|
||||
_scanQr = () => {
|
||||
this.props.openScannerLogin();
|
||||
console.log(this.props.UI_loginScannerActive);
|
||||
};
|
||||
_tryLogin = () => {
|
||||
//console.log(this.state.text)
|
||||
//this.scanner.reactivate();
|
||||
this.props.login(this.state.username, this.state.text);
|
||||
};
|
||||
|
||||
_toggleModal = () =>
|
||||
this.setState({ isModalVisible: !this.state.isModalVisible });
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
token: { valid: false },
|
||||
tokenData: "",
|
||||
onHold: true,
|
||||
logged: false,
|
||||
isModalVisible: false,
|
||||
state: { text: "" },
|
||||
username: "QR code",
|
||||
failedAttempt: false,
|
||||
push: 4,
|
||||
UI_loginScannerActive: false,
|
||||
userDetails: { username: "", password: "" },
|
||||
isConnected: true,
|
||||
modalOpen: false
|
||||
};
|
||||
}
|
||||
_print = () => {
|
||||
console.log("hello");
|
||||
this.setState({ push: 0 });
|
||||
};
|
||||
checkValue = e => {
|
||||
console.log("check" + e);
|
||||
};
|
||||
_handleConnectionChange = isConnected => {
|
||||
this.props.connectionState(true);
|
||||
};
|
||||
|
||||
render() {
|
||||
if (!this.state.isConnected) {
|
||||
return (
|
||||
<View>
|
||||
<Text>cenas da vida</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
if (!this.props.logged && this.props.onHold) {
|
||||
componentDidMount() {
|
||||
//this.props.hold();
|
||||
NetInfo.isConnected.addEventListener(
|
||||
"connectionChange",
|
||||
this.handleConnectivityChange
|
||||
);
|
||||
|
||||
this.setState({ isModalVisible: false });
|
||||
//verifica se o utilizador tem token guardado
|
||||
this.props.checkUser(this.props.userDetails);
|
||||
this.keyboardDidShowListener = Keyboard.addListener(
|
||||
"keyboardDidShow",
|
||||
this._keyboardDidShow
|
||||
);
|
||||
this.keyboardDidHideListener = Keyboard.addListener(
|
||||
"keyboardDidHide",
|
||||
this._keyboardDidHide
|
||||
);
|
||||
}
|
||||
componentWillUnmount() {
|
||||
NetInfo.isConnected.removeEventListener(
|
||||
"connectionChange",
|
||||
this.handleConnectivityChange
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={UtilStyles.containerLoading}>
|
||||
|
||||
<ActivityIndicator size="large" color="red"/>
|
||||
</View>
|
||||
)
|
||||
_keyboardDidShow() {
|
||||
//alert('Keyboard Shown');
|
||||
// this.setState({push:0})
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_keyboardDidHide() {
|
||||
//this.setState({push:4})
|
||||
}
|
||||
onSuccess = e => {
|
||||
// this.setState({ isModalVisible: !this.state.isModalVisible });
|
||||
// this.props.login(e.data, 'f8908cc0');
|
||||
this.props.closeLoginQRScan();
|
||||
this.setState({ username: e.data });
|
||||
|
||||
// console.log('token... '+ this.props.logged)
|
||||
console.log("QR code lido");
|
||||
};
|
||||
|
||||
//se existir token
|
||||
|
||||
if (this.props.logged ) {
|
||||
|
||||
return (
|
||||
|
||||
<Router></Router>
|
||||
)
|
||||
}
|
||||
return (
|
||||
|
||||
|
||||
|
||||
<View style={styles.slide2}>
|
||||
<Modal isVisible={this.props.UI_loginScannerActive}>
|
||||
<View style={{ flex: 1 , backgroundColor:'white'}}>
|
||||
<Button onPress={this.props.closeLoginQRScan} title={"Fechar scanner"}> </Button>
|
||||
|
||||
<QRCodeScanner
|
||||
onRead={this.onSuccess}
|
||||
cameraStyle={ styles.cameraContainer}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/>
|
||||
</View>
|
||||
|
||||
</Modal>
|
||||
<View style={{ width:'100%',
|
||||
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',}}>
|
||||
<Image style={styles.logo2} source={require('./assets/img/logo2.png')}/>
|
||||
|
||||
</View>
|
||||
<View styles={styles.loginContainer}>
|
||||
|
||||
|
||||
|
||||
|
||||
<View style={styles.inputSection}>
|
||||
|
||||
<TextInput
|
||||
style={styles.input}
|
||||
placeholder={this.state.username}
|
||||
onChangeText={(searchString) => {this.setState({searchString})}}
|
||||
maxLength={15}
|
||||
underlineColorAndroid="transparent"
|
||||
/>
|
||||
<TouchableOpacity onPress={this._scanQr}>
|
||||
|
||||
<View style={styles.scanQR}>
|
||||
|
||||
<Icon style={styles.searchIcon} name="ios-qr-scanner" size={30} color="#000"/>
|
||||
<Text>Scan QR</Text>
|
||||
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
|
||||
</View>
|
||||
|
||||
<TextInput style={styles.passwordInput}
|
||||
onFocus={this._print}
|
||||
maxLength={10}
|
||||
blurOnSubmit ={true}
|
||||
secureTextEntry={true}
|
||||
|
||||
onChangeText={(text) => this.setState({text})}
|
||||
clearButtonMode='always'
|
||||
value={this.state.text}
|
||||
clearTextOnFocus={true}
|
||||
onSubmitEditing={Keyboard.dismiss}
|
||||
placeholder='Password' />
|
||||
|
||||
<RkButton rkType='dark' style={styles.loginBtn} onPress={this._tryLogin}>Entrar</RkButton>
|
||||
|
||||
</View>
|
||||
|
||||
<View style={ styles.buttons }>
|
||||
<TouchableOpacity
|
||||
style={styles.button}>
|
||||
|
||||
<Icon name="logo-facebook" size={40}/>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity
|
||||
style={styles.button}>
|
||||
|
||||
<Icon name="logo-instagram" size={40}/>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity
|
||||
style={styles.button}>
|
||||
|
||||
<Icon name="md-heart" size={40}/>
|
||||
|
||||
</TouchableOpacity>
|
||||
|
||||
</View>
|
||||
<View style={styles.footer}>
|
||||
<View style={styles.textRow}>
|
||||
|
||||
<RkText rkType='primary3'>Não sabes a password?</RkText>
|
||||
<RkButton rkType='clear' onPress={this.onSignUpButtonPressed}>
|
||||
|
||||
<TouchableOpacity>
|
||||
<RkText style={{color:'red'}} kType='header6'>Recuperar Password</RkText>
|
||||
</TouchableOpacity>
|
||||
|
||||
</RkButton>
|
||||
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
render() {
|
||||
if (!this.state.isConnected) {
|
||||
return (
|
||||
<View>
|
||||
<Text>cenas da vida</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
if (!this.props.logged && this.props.onHold) {
|
||||
return (
|
||||
<View style={UtilStyles.containerLoading}>
|
||||
<ActivityIndicator size="large" color="red" />
|
||||
</View>
|
||||
);
|
||||
} else {
|
||||
// console.log('token... '+ this.props.logged)
|
||||
|
||||
//se existir token
|
||||
|
||||
if (this.props.logged) {
|
||||
return <Router />;
|
||||
}
|
||||
return (
|
||||
<View style={styles.slide2}>
|
||||
<Modal isVisible={this.props.UI_loginScannerActive}>
|
||||
<View style={{ flex: 1, backgroundColor: "white" }}>
|
||||
<Button
|
||||
onPress={this.props.closeLoginQRScan}
|
||||
title={"Fechar scanner"}
|
||||
>
|
||||
{" "}
|
||||
</Button>
|
||||
|
||||
<QRCodeScanner
|
||||
onRead={this.onSuccess}
|
||||
cameraStyle={styles.cameraContainer}
|
||||
/>
|
||||
</View>
|
||||
</Modal>
|
||||
<View
|
||||
style={{
|
||||
width: "100%",
|
||||
|
||||
justifyContent: "center",
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
style={styles.logo2}
|
||||
source={require("./assets/img/logo2.png")}
|
||||
/>
|
||||
</View>
|
||||
<View styles={styles.loginContainer}>
|
||||
<View style={styles.inputSection}>
|
||||
<TextInput
|
||||
style={styles.input}
|
||||
placeholder={this.state.username}
|
||||
onChangeText={searchString => {
|
||||
this.setState({ searchString });
|
||||
}}
|
||||
maxLength={15}
|
||||
underlineColorAndroid="transparent"
|
||||
/>
|
||||
<TouchableOpacity onPress={this._scanQr}>
|
||||
<View style={styles.scanQR}>
|
||||
<Icon
|
||||
style={styles.searchIcon}
|
||||
name="ios-qr-scanner"
|
||||
size={30}
|
||||
color="#000"
|
||||
/>
|
||||
<Text>Scan QR</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
<TextInput
|
||||
style={styles.passwordInput}
|
||||
onFocus={this._print}
|
||||
maxLength={10}
|
||||
blurOnSubmit={true}
|
||||
secureTextEntry={true}
|
||||
onChangeText={text => this.setState({ text })}
|
||||
clearButtonMode="always"
|
||||
value={this.state.text}
|
||||
clearTextOnFocus={true}
|
||||
onSubmitEditing={Keyboard.dismiss}
|
||||
placeholder="Password"
|
||||
/>
|
||||
|
||||
<RkButton
|
||||
rkType="dark"
|
||||
style={styles.loginBtn}
|
||||
onPress={this._tryLogin}
|
||||
>
|
||||
Entrar
|
||||
</RkButton>
|
||||
</View>
|
||||
|
||||
<View style={styles.buttons}>
|
||||
<TouchableOpacity style={styles.button}>
|
||||
<Icon name="logo-facebook" size={40} />
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={styles.button}>
|
||||
<Icon name="logo-instagram" size={40} />
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={styles.button}>
|
||||
<Icon name="md-heart" size={40} />
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
<View style={styles.footer}>
|
||||
<View style={styles.textRow}>
|
||||
<RkText rkType="primary3">Não sabes a password?</RkText>
|
||||
<RkButton rkType="clear" onPress={this.onSignUpButtonPressed}>
|
||||
<TouchableOpacity>
|
||||
<RkText style={{ color: "red" }} kType="header6">
|
||||
Recuperar Password
|
||||
</RkText>
|
||||
</TouchableOpacity>
|
||||
</RkButton>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RkTheme.setType("RkButton", "dark", {
|
||||
container: {
|
||||
paddingTop: 10,
|
||||
backgroundColor: "gray",
|
||||
|
||||
RkTheme.setType('RkButton', 'dark', {
|
||||
container: {
|
||||
paddingTop: 10,
|
||||
backgroundColor: 'gray',
|
||||
|
||||
borderRadius: 90,
|
||||
}
|
||||
borderRadius: 90
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const rectDimensions = SCREEN_WIDTH * 0.85; // this is equivalent to 255 from a 393 device width
|
||||
|
||||
const overlayColor = 'rgba(0,0,0,0.30)';
|
||||
const overlayColor = "rgba(0,0,0,0.30)";
|
||||
|
||||
const styles = {
|
||||
cameraContainer:{
|
||||
// height: Dimensions.get('window').height ,
|
||||
},
|
||||
passwordInput:{
|
||||
borderRadius: 90,
|
||||
|
||||
borderColor:'#bfbdbd',
|
||||
borderWidth: 1,
|
||||
marginTop:20,
|
||||
marginBottom:20,
|
||||
width:SCREEN_WIDTH*0.8,
|
||||
|
||||
backgroundColor: 'white',
|
||||
cameraContainer: {
|
||||
// height: Dimensions.get('window').height ,
|
||||
},
|
||||
passwordInput: {
|
||||
borderRadius: 90,
|
||||
|
||||
borderRadius: 90,
|
||||
height: SCREEN_HEIGHT*0.08,
|
||||
borderColor:'#bfbdbd',
|
||||
borderWidth: 1,
|
||||
paddingLeft:SCREEN_WIDTH*0.05,
|
||||
|
||||
},
|
||||
scanQRText:{
|
||||
borderColor: "#bfbdbd",
|
||||
borderWidth: 1,
|
||||
marginTop: 20,
|
||||
marginBottom: 20,
|
||||
width: SCREEN_WIDTH * 0.8,
|
||||
|
||||
paddingTop:50
|
||||
// paddingTop:20,
|
||||
|
||||
backgroundColor: "white",
|
||||
|
||||
},
|
||||
scanQR:{
|
||||
|
||||
//flexDirection: 'row',
|
||||
paddingTop:5,
|
||||
backgroundColor:10,
|
||||
|
||||
width:80,
|
||||
paddingLeft:10,
|
||||
backgroundColor:'#f24b4b',
|
||||
borderBottomRightRadius:90,
|
||||
borderTopRightRadius:90,
|
||||
height:'100%',
|
||||
|
||||
},
|
||||
inputSection: {
|
||||
|
||||
flexDirection: 'row',
|
||||
backgroundColor: '#fff',
|
||||
|
||||
backgroundColor: 'white',
|
||||
borderRadius: 90,
|
||||
height: SCREEN_HEIGHT * 0.08,
|
||||
borderColor: "#bfbdbd",
|
||||
borderWidth: 1,
|
||||
paddingLeft: SCREEN_WIDTH * 0.05
|
||||
},
|
||||
scanQRText: {
|
||||
paddingTop: 50
|
||||
// paddingTop:20,
|
||||
},
|
||||
scanQR: {
|
||||
//flexDirection: 'row',
|
||||
paddingTop: 5,
|
||||
backgroundColor: 10,
|
||||
|
||||
borderRadius: 90,
|
||||
height: SCREEN_HEIGHT*0.08,
|
||||
borderColor:'#bfbdbd',
|
||||
borderWidth: 1,
|
||||
|
||||
width: 80,
|
||||
paddingLeft: 10,
|
||||
backgroundColor: "#f24b4b",
|
||||
borderBottomRightRadius: 90,
|
||||
borderTopRightRadius: 90,
|
||||
height: "100%"
|
||||
},
|
||||
inputSection: {
|
||||
flexDirection: "row",
|
||||
backgroundColor: "#fff",
|
||||
|
||||
},
|
||||
searchIcon: {
|
||||
paddingLeft:10
|
||||
},
|
||||
backgroundColor: "white",
|
||||
|
||||
input: {
|
||||
|
||||
|
||||
|
||||
flex: 1,
|
||||
paddingRight: 10,
|
||||
|
||||
|
||||
paddingLeft: 0,
|
||||
paddingLeft:SCREEN_WIDTH*0.05,
|
||||
color: '#424242',
|
||||
|
||||
},
|
||||
textRow:{
|
||||
marginBottom:40
|
||||
},
|
||||
loginContainer:{
|
||||
width: '100%',
|
||||
height: '30%',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center'
|
||||
},
|
||||
loginBtn:{
|
||||
marginTop:10,
|
||||
marginBottom:20,
|
||||
marginLeft: '25%',
|
||||
|
||||
},
|
||||
|
||||
button: {
|
||||
borderWidth:1,
|
||||
borderColor:'rgba(0,0,0,0.2)',
|
||||
alignItems:'center',
|
||||
justifyContent:'center',
|
||||
width:60,
|
||||
height:60,
|
||||
backgroundColor:'#fff',
|
||||
borderRadius:100,
|
||||
marginRight: 10,
|
||||
marginLeft:10
|
||||
},
|
||||
footer: {},
|
||||
borderRadius: 90,
|
||||
height: SCREEN_HEIGHT * 0.08,
|
||||
borderColor: "#bfbdbd",
|
||||
borderWidth: 1
|
||||
},
|
||||
searchIcon: {
|
||||
paddingLeft: 10
|
||||
},
|
||||
|
||||
buttons: {
|
||||
flexDirection: 'row',
|
||||
marginBottom: 24,
|
||||
marginHorizontal: 24,
|
||||
marginTop:24,
|
||||
justifyContent: 'space-around',
|
||||
|
||||
|
||||
},
|
||||
input: {
|
||||
flex: 1,
|
||||
paddingRight: 10,
|
||||
|
||||
logoContainer:{
|
||||
paddingLeft: 0,
|
||||
paddingLeft: SCREEN_WIDTH * 0.05,
|
||||
color: "#424242"
|
||||
},
|
||||
textRow: {
|
||||
marginBottom: 40
|
||||
},
|
||||
loginContainer: {
|
||||
width: "100%",
|
||||
height: "30%",
|
||||
justifyContent: "center",
|
||||
alignItems: "center"
|
||||
},
|
||||
loginBtn: {
|
||||
marginTop: 10,
|
||||
marginBottom: 20,
|
||||
marginLeft: "25%"
|
||||
},
|
||||
|
||||
width:'100%',
|
||||
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
marginTop:200
|
||||
button: {
|
||||
borderWidth: 1,
|
||||
borderColor: "rgba(0,0,0,0.2)",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
width: 60,
|
||||
height: 60,
|
||||
backgroundColor: "#fff",
|
||||
borderRadius: 100,
|
||||
marginRight: 10,
|
||||
marginLeft: 10
|
||||
},
|
||||
footer: {},
|
||||
|
||||
},
|
||||
buttons: {
|
||||
flexDirection: "row",
|
||||
marginBottom: 24,
|
||||
marginHorizontal: 24,
|
||||
marginTop: 24,
|
||||
justifyContent: "space-around"
|
||||
},
|
||||
|
||||
logo2:{
|
||||
|
||||
// flex: 1,
|
||||
// resizeMode: 'contain',
|
||||
width: 200, height: 200,
|
||||
logoContainer: {
|
||||
width: "100%",
|
||||
|
||||
},
|
||||
wrapper: {
|
||||
},
|
||||
slide1: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
backgroundColor: 'white',
|
||||
},
|
||||
slide2: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
backgroundColor: 'white',
|
||||
},
|
||||
slide3: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
color:'black',
|
||||
backgroundColor: 'white',
|
||||
},
|
||||
text: {
|
||||
color: '#fff',
|
||||
fontSize: 30,
|
||||
fontWeight: 'bold',
|
||||
},
|
||||
recover: {
|
||||
paddingTop: 10,
|
||||
color: "red",
|
||||
paddingBottom: 10
|
||||
},
|
||||
manual: {},
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
marginTop: 200
|
||||
},
|
||||
|
||||
logo: {
|
||||
logo2: {
|
||||
// flex: 1,
|
||||
// resizeMode: 'contain',
|
||||
width: 200,
|
||||
height: 200
|
||||
},
|
||||
wrapper: {},
|
||||
slide1: {
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
backgroundColor: "white"
|
||||
},
|
||||
slide2: {
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
backgroundColor: "white"
|
||||
},
|
||||
slide3: {
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
color: "black",
|
||||
backgroundColor: "white"
|
||||
},
|
||||
text: {
|
||||
color: "#fff",
|
||||
fontSize: 30,
|
||||
fontWeight: "bold"
|
||||
},
|
||||
recover: {
|
||||
paddingTop: 10,
|
||||
color: "red",
|
||||
paddingBottom: 10
|
||||
},
|
||||
manual: {},
|
||||
|
||||
height: SCREEN_HEIGHT * 0.35,
|
||||
width: SCREEN_WIDTH,
|
||||
backgroundColor: overlayColor,
|
||||
},
|
||||
rectangleContainer: {
|
||||
logo: {
|
||||
height: SCREEN_HEIGHT * 0.35,
|
||||
width: SCREEN_WIDTH,
|
||||
backgroundColor: overlayColor
|
||||
},
|
||||
rectangleContainer: {
|
||||
flex: 1,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
backgroundColor: "transparent"
|
||||
},
|
||||
|
||||
flex: 1,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
backgroundColor: "transparent",
|
||||
rectangle: {
|
||||
height: rectDimensions,
|
||||
width: rectDimensions,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
backgroundColor: "transparent"
|
||||
},
|
||||
|
||||
},
|
||||
topOverlay: {
|
||||
flex: 1,
|
||||
backgroundColor: overlayColor,
|
||||
justifyContent: "center",
|
||||
alignItems: "center"
|
||||
},
|
||||
|
||||
rectangle: {
|
||||
bottomOverlay: {
|
||||
flex: 1,
|
||||
height: SCREEN_HEIGHT,
|
||||
width: SCREEN_WIDTH,
|
||||
backgroundColor: overlayColor,
|
||||
paddingBottom: SCREEN_WIDTH * 0.2
|
||||
},
|
||||
|
||||
height: rectDimensions,
|
||||
width: rectDimensions,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
backgroundColor: "transparent"
|
||||
},
|
||||
|
||||
topOverlay: {
|
||||
flex: 1,
|
||||
backgroundColor: overlayColor,
|
||||
justifyContent: "center",
|
||||
alignItems: "center"
|
||||
},
|
||||
|
||||
bottomOverlay: {
|
||||
flex: 1,
|
||||
height: SCREEN_HEIGHT,
|
||||
width: SCREEN_WIDTH,
|
||||
backgroundColor: overlayColor,
|
||||
paddingBottom: SCREEN_WIDTH * 0.2
|
||||
},
|
||||
|
||||
leftAndRightOverlay: {
|
||||
height: rectDimensions,
|
||||
width: SCREEN_WIDTH,
|
||||
backgroundColor: overlayColor
|
||||
},
|
||||
leftAndRightOverlay: {
|
||||
height: rectDimensions,
|
||||
width: SCREEN_WIDTH,
|
||||
backgroundColor: overlayColor
|
||||
}
|
||||
};
|
||||
RkTheme.setType('RkTextInput', 'frame', {
|
||||
input: {
|
||||
backgroundColor: 'white',
|
||||
marginLeft: 0,
|
||||
marginHorizontal: 0,
|
||||
borderRadius: 5
|
||||
},
|
||||
color: 'gray',
|
||||
backgroundColor: 'gray',
|
||||
borderRadius: 10,
|
||||
container: {
|
||||
paddingHorizontal: 20
|
||||
}
|
||||
});
|
||||
|
||||
RkTheme.setType("RkTextInput", "frame", {
|
||||
input: {
|
||||
backgroundColor: "white",
|
||||
marginLeft: 0,
|
||||
marginHorizontal: 0,
|
||||
borderRadius: 5
|
||||
},
|
||||
color: "gray",
|
||||
backgroundColor: "gray",
|
||||
borderRadius: 10,
|
||||
container: {
|
||||
paddingHorizontal: 20
|
||||
}
|
||||
});
|
||||
|
||||
mapStateToProps = (state, props) => {
|
||||
|
||||
return {
|
||||
token: state.apiReducer.token,
|
||||
loggedIn: state.apiReducer.loggedIn,
|
||||
onHold: state.apiReducer.onHold,
|
||||
logged: state.apiReducer.logged,
|
||||
failedAttempt:state.apiReducer.failedAttempt,
|
||||
UI_loginScannerActive: state.uiReducer.UI_loginScannerActive,
|
||||
userDetails: state.apiReducer.userDetails,
|
||||
}
|
||||
return {
|
||||
token: state.apiReducer.token,
|
||||
loggedIn: state.apiReducer.loggedIn,
|
||||
onHold: state.apiReducer.onHold,
|
||||
logged: state.apiReducer.logged,
|
||||
failedAttempt: state.apiReducer.failedAttempt,
|
||||
UI_loginScannerActive: state.uiReducer.UI_loginScannerActive,
|
||||
userDetails: state.apiReducer.userDetails,
|
||||
modalOpen: state.apiReducer.modalOpen,
|
||||
modalInfo: state.apiReducer.modalInfo,
|
||||
type: state.apiReducer.type
|
||||
};
|
||||
};
|
||||
|
||||
mapDispatchToProps = (dispatch) => {
|
||||
|
||||
return bindActionCreators(Actions, dispatch);
|
||||
mapDispatchToProps = dispatch => {
|
||||
return bindActionCreators(Actions, dispatch);
|
||||
};
|
||||
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(App);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(App);
|
||||
|
|
|
@ -1,397 +1,415 @@
|
|||
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 {bindActionCreators} from 'redux';
|
||||
import * as Actions from "../store/actions"; //Import your actionss
|
||||
|
||||
import * as Actions from '../store/actions'; //Import your actionss
|
||||
const formatObj = obj => {
|
||||
let a = {};
|
||||
|
||||
a.push({});
|
||||
|
||||
const formatObj = (obj) => {
|
||||
|
||||
let a = {};
|
||||
|
||||
a.push({})
|
||||
|
||||
return a
|
||||
|
||||
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>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
constructor() {
|
||||
|
||||
super()
|
||||
|
||||
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');
|
||||
|
||||
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} />;
|
||||
|
||||
this.data = [
|
||||
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
const FirstRoute = () => (
|
||||
|
||||
<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>
|
||||
|
||||
)
|
||||
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>
|
||||
|
||||
)
|
||||
|
||||
|
||||
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>
|
||||
<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 })}
|
||||
>
|
||||
<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>
|
||||
);
|
||||
};
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
//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",
|
||||
|
||||
height: 100,
|
||||
color: "#CC1A17",
|
||||
padding: 5,
|
||||
|
||||
fontSize: 23
|
||||
|
||||
//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>
|
||||
);
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1 }}>
|
||||
<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" }}
|
||||
/>
|
||||
</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);
|
||||
|
|
|
@ -1,57 +1,47 @@
|
|||
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 } from "react-native";
|
||||
import { TabView, TabBar, SceneMap } from "react-native-tab-view";
|
||||
|
||||
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 {
|
||||
|
||||
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' },
|
||||
index: 0,
|
||||
routes: [
|
||||
{ key: "first", title: "Festarola" },
|
||||
{ key: "second", title: "Febrada" },
|
||||
{ key: "third", title: "Rally" },
|
||||
{ key: "fourth", title: "Peddy" }
|
||||
]
|
||||
};
|
||||
|
||||
],
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Text>asd</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Button
|
||||
title="Febrada"
|
||||
onPress={() => this.props.navigation.navigate("febrada")}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
scene: {
|
||||
flex: 1,
|
||||
},
|
||||
});
|
||||
flex: 1
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,427 +1,508 @@
|
|||
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={() => {}}
|
||||
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.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) && (
|
||||
<ActivityIndicator
|
||||
size="large"
|
||||
color="red"
|
||||
style={{ flex: 1, alignContent: "center" }}
|
||||
/>
|
||||
)}
|
||||
</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);
|
||||
|
|
|
@ -31,4 +31,7 @@ export const UI_LOGIN_NOINTERNET='UI_LOGIN_NOINTERNET'
|
|||
export const UI_LOGIN_OPEN_SCANNER='UI_LOIN_OPEN_SCANNER'
|
||||
|
||||
|
||||
//HOME
|
||||
|
||||
|
||||
export const OPEN_MODAL='OPEN_MODAL'
|
||||
export const CLOSE_MODAL='CLOSE_MODAL'
|
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,20 @@
|
|||
export {checkUser,
|
||||
login,getEvents,
|
||||
hold, getUserInfo,
|
||||
login,
|
||||
getEvents,
|
||||
hold,
|
||||
getUserInfo,
|
||||
logoutUser,
|
||||
getAvailableGuestlists,
|
||||
changeGuestList,
|
||||
waitChangeGuest,
|
||||
getAvailableSessions,
|
||||
updateUser,
|
||||
getSessionBlocks,
|
||||
timerChangeGuest,
|
||||
getSessions,
|
||||
signSession,
|
||||
openModal,
|
||||
closeModal
|
||||
} from "./api"
|
||||
|
||||
export {
|
||||
|
|
|
@ -1,182 +1,219 @@
|
|||
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';
|
||||
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
|
||||
} from "../actions/actionTypes"; //Import the actions types constant we defined in our actions
|
||||
import { REHYDRATE } from "redux-persist";
|
||||
|
||||
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:{}
|
||||
|
||||
let apiState= {
|
||||
|
||||
isConnected:false,
|
||||
logged:false,
|
||||
onHold:true,user:{},
|
||||
events:[],
|
||||
failedAttempt:false,
|
||||
userDetails:{
|
||||
username:'',
|
||||
password:'',
|
||||
token:{
|
||||
expirationDateToken:0,
|
||||
access_token:''
|
||||
}
|
||||
},
|
||||
calendar:{
|
||||
|
||||
},
|
||||
changingGuest:false,
|
||||
sessions:{}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
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)){
|
||||
if (
|
||||
action.payload.apiReducer.userDetails.token.access_token !=
|
||||
undefined
|
||||
) {
|
||||
access_tokenA =
|
||||
action.payload.apiReducer.userDetails.token.access_token;
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
case 'CHANGE_CONNECTION_STATUS':
|
||||
return Object.assign({}, state, {
|
||||
isConnected: action.isConnected,
|
||||
});
|
||||
|
||||
|
||||
case HOLD:
|
||||
case HOLD:
|
||||
state = Object.assign({}, state, { onHold: true });
|
||||
return state;
|
||||
|
||||
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
|
||||
}
|
||||
});
|
||||
|
||||
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},
|
||||
|
||||
|
||||
});
|
||||
return state;
|
||||
|
||||
return state;
|
||||
case CHECK_USER:
|
||||
var u = action.userDetails;
|
||||
if (action.token != undefined) u.token = action.token;
|
||||
|
||||
case CHECK_USER:
|
||||
state = Object.assign({}, state, {
|
||||
logged: action.logged,
|
||||
onHold: action.onHold,
|
||||
userDetails: u
|
||||
});
|
||||
|
||||
var u= action.userDetails;
|
||||
if(action.token!=undefined)
|
||||
u.token= action.token;
|
||||
return state;
|
||||
|
||||
state=Object.assign({},state, {logged:action.logged, onHold:action.onHold, userDetails:u });
|
||||
case LOGOUT_USER:
|
||||
state = Object.assign({}, state, { user:{}, userDetails:{}, logged:false});
|
||||
|
||||
return state;
|
||||
return state;
|
||||
|
||||
case LOGOUT_USER:
|
||||
case USER_INFO:
|
||||
state = Object.assign({}, state, {
|
||||
user: action.user,
|
||||
loggedIn: action.loggedIn,
|
||||
onHold: action.onHold
|
||||
});
|
||||
|
||||
state=Object.assign({},state, { logged:false});
|
||||
return state;
|
||||
|
||||
return state;
|
||||
case GET_EVENTS:
|
||||
state = Object.assign({}, state, { events: action.events , a:action.day1, b:action.day2, c:action.day3, d:action.day4});
|
||||
|
||||
case USER_INFO:
|
||||
return state;
|
||||
|
||||
state=Object.assign({},state, { user: action.user , loggedIn:action.loggedIn, onHold:action.onHold});
|
||||
|
||||
return state;
|
||||
|
||||
case GET_EVENTS:
|
||||
case OPEN_MODAL:
|
||||
console.log("open modal")
|
||||
state = Object.assign({}, state, {
|
||||
modalOpen: true,
|
||||
modalInfo: action.modalInfo,
|
||||
modalType: action.type
|
||||
});
|
||||
return state;
|
||||
|
||||
state=Object.assign({},state, { events: action.events});
|
||||
|
||||
return state;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case GET_CAREERS:
|
||||
var c= {
|
||||
guests:action.guests
|
||||
}
|
||||
state=Object.assign({},state, { calendar:c });
|
||||
case CLOSE_MODAL:
|
||||
state = Object.assign({}, state, {
|
||||
modalOpen: false,
|
||||
modalInfo: "",
|
||||
type: ""
|
||||
});
|
||||
return state;
|
||||
|
||||
return state;
|
||||
|
||||
case CHANGE_GUEST:
|
||||
state=Object.assign({},state, { changingGuest:false});
|
||||
return state;
|
||||
case SIGN_SESSION:
|
||||
state = Object.assign({}, state, {
|
||||
sessions: action.sessions,
|
||||
Blocks: action.Blocks,
|
||||
careerPath: action.careerPath,
|
||||
changingGuest: action.changingGuest,
|
||||
user:action.user
|
||||
});
|
||||
return state;
|
||||
|
||||
case WAIT_CHANGE:
|
||||
state=Object.assign({},state, { changingGuest:true});
|
||||
return state;
|
||||
case SESSION_BLOCKS:
|
||||
state = Object.assign({}, state, {
|
||||
Blocks: action.Blocks,
|
||||
onHoldBlocks: false,
|
||||
changingGuest: false
|
||||
});
|
||||
return state;
|
||||
|
||||
case GET_SESSIONS:
|
||||
state=Object.assign({},state, { changingGuest:false, sessions:action.sessions});
|
||||
return state;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
export default apiReducer;
|
||||
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,
|
||||
sessions: action.sessions,
|
||||
Blocks: action.Blocks,
|
||||
careerPath: action.careerPath
|
||||
});
|
||||
return state;
|
||||
|
||||
case WAIT_CHANGE:
|
||||
state = Object.assign({}, state, { changingGuest: true });
|
||||
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;
|
||||
|
|
|
@ -7840,6 +7840,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",
|
||||
|
|
|
@ -17,6 +17,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",
|
||||
|
|
Loading…
Reference in New Issue