diff --git a/App/app/App.js b/App/app/App.js index fbf0aeb1..33efa9f0 100755 --- a/App/app/App.js +++ b/App/app/App.js @@ -39,6 +39,7 @@ const SCREEN_HEIGHT = Dimensions.get("window").height; const SCREEN_WIDTH = Dimensions.get("window").width; import Swiper from "react-native-swiper"; +import resetPassword from "./screens/resetPassword"; var TimerMixin = require("react-timer-mixin"); function handleConnectivityChange() { @@ -46,6 +47,9 @@ function handleConnectivityChange() { } class App extends Component { + + + handleConnectivityChange = isConnected => { this.setState({ isConnected }); }; @@ -83,7 +87,9 @@ class App extends Component { UI_loginScannerActive: false, userDetails: { username: "", password: "" }, isConnected: true, - modalOpen: false + modalOpen: false, + modalResetPassword:false, + resetText:'' }; } _print = () => { @@ -123,6 +129,16 @@ class App extends Component { 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() { //alert('Keyboard Shown'); @@ -142,7 +158,10 @@ class App extends Component { }; render() { + + + if (!this.props.logged && this.props.onHold) { return ( @@ -158,6 +177,7 @@ class App extends Component { return ; } return ( + @@ -174,12 +194,48 @@ class App extends Component { /> + + + + Reset Password + Deves introduzir o email com o qual efectuaste a compra do bilhete. + this.setState({ resetText:r })} + clearButtonMode="always" + value={this.state.resetText} + clearTextOnFocus={true} + onSubmitEditing={Keyboard.dismiss} + placeholder="Email ou Qr code" + /> + + + Caso tenhas problemas com este processo deves contactar a comissão organizadora atravês do email geral. + + + + - Scan QR + @@ -225,13 +281,11 @@ class App extends Component { placeholder="Password" /> { !this.props.loadingLogin && - - Entrar - + + + Login + + } {this.props.alignItems && @@ -253,9 +307,9 @@ class App extends Component { Não sabes a password? - - - Recuperar Password + {this.setState({modalResetPassword:true})}}> + + Reset Password @@ -282,10 +336,30 @@ const overlayColor = "rgba(0,0,0,0.30)"; const styles = { 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: { - borderRadius: 90, + borderColor: "#bfbdbd", borderWidth: 1, @@ -295,7 +369,7 @@ const styles = { backgroundColor: "white", - borderRadius: 90, + borderRadius: 3, height: SCREEN_HEIGHT * 0.08, borderColor: "#bfbdbd", borderWidth: 1, @@ -307,15 +381,19 @@ const styles = { }, scanQR: { //flexDirection: 'row', - paddingTop: 5, + flex:1, +//paddingTop: 5, backgroundColor: 10, + alignItems:'center', + padding:5, + paddingRight:15, - width: 80, - paddingLeft: 10, - backgroundColor: "#f24b4b", - borderBottomRightRadius: 90, - borderTopRightRadius: 90, - height: "100%" + //width: 80, + // paddingLeft: 10, + backgroundColor: "#CC1A17", + borderBottomRightRadius: 3, + borderTopRightRadius: 3, + // height: "100%" }, inputSection: { flexDirection: "row", @@ -323,7 +401,7 @@ const styles = { backgroundColor: "white", - borderRadius: 90, + borderRadius: 3, height: SCREEN_HEIGHT * 0.08, borderColor: "#bfbdbd", borderWidth: 1 @@ -382,7 +460,8 @@ const styles = { justifyContent: "center", alignItems: "center", - marginTop: 200 + marginTop: 200, + }, logo2: { diff --git a/App/app/Router.js b/App/app/Router.js index 96cd8c93..d16952ed 100755 --- a/App/app/Router.js +++ b/App/app/Router.js @@ -36,7 +36,8 @@ import Profile from "./screens/Profile"; import editCalendar from './screens/editCalendar'; import choosePath from './screens/choosePath'; import calendarDetail from './screens/calendarDetail'; - +import FebradaDetail from './screens/FebradaDetail'; +import resetPassword from './screens/resetPassword'; const navigationOptions = ({navigation}) => ({ headerLeft: navigation.goBack(null)}/>, @@ -104,11 +105,8 @@ const AppStack = createBottomTabNavigator( }, { - //initialRouteName: 'Home', initialRouteName: 'Eventos', - //initialRouteName: 'Calendário', - tabBarOptions: { showLabel: true, // hide labels activeTintColor: '#CC1A17', // active icon color @@ -125,7 +123,8 @@ const Stack = createStackNavigator({ screen: AppStack, navigationOptions: ({navigation}) => { const index = navigation.state.index; - + + if (navigation.state.routes[index].routeName == 'Home') { return { headerTitle: `${navigation.state.routes[index].routeName}`, @@ -205,7 +204,13 @@ const Stack = createStackNavigator({ calendarDetail: { screen: calendarDetail, }, + FebradaDetail: { + screen: FebradaDetail, + }, + resetPassword:{ + screen:resetPassword + } }); diff --git a/App/app/screens/Calendar.js b/App/app/screens/Calendar.js index b68a44a0..6d841d91 100644 --- a/App/app/screens/Calendar.js +++ b/App/app/screens/Calendar.js @@ -19,7 +19,7 @@ import * as Progress from "react-native-progress"; import { connect } from "react-redux"; import { bindActionCreators } from "redux"; - +import PTRView from 'react-native-pull-to-refresh'; import * as Actions from "../store/actions"; //Import your actionss const formatObj = obj => { @@ -72,7 +72,7 @@ class Calendar extends React.Component { @@ -140,6 +140,10 @@ class Calendar extends React.Component { constructor() { super(); } + _refresh=()=>{ + this.props.getEvents(this.props.user); + //this.props.getSessions(this.props.userDetails.token); + } render() { const ThirdRoute = () => ( @@ -275,7 +279,9 @@ class Calendar extends React.Component { ); return ( + + {this.props.careerPath != undefined && ( )} + +