From 116fc1b3a97b6eb6b54e022b5330febe7f0c3707 Mon Sep 17 00:00:00 2001 From: henrydays Date: Tue, 12 Mar 2019 03:34:40 +0000 Subject: [PATCH] calendar v3 --- App/app/Router.js | 8 +- App/app/screens/Calendar.js | 13 +- App/app/screens/Home.js | 5 +- App/app/screens/calendarDetail.js | 60 +++- App/app/screens/choosePath.js | 19 +- App/app/store/actions/actionTypes.js | 1 + App/app/store/actions/api.js | 316 +++++++++++------- App/app/store/actions/index.js | 4 +- App/app/store/reducers/api.js | 65 +++- api/Controllers/AuthController.cs | 41 ++- api/Dtos/tokenDto.cs | 23 ++ api/Dtos/userDetails.cs | 18 + api/Startup.cs | 2 +- api/api.csproj | 11 +- .../Debug/netcoreapp2.1/project.razor.json | 2 +- 15 files changed, 412 insertions(+), 176 deletions(-) create mode 100644 api/Dtos/tokenDto.cs create mode 100644 api/Dtos/userDetails.cs diff --git a/App/app/Router.js b/App/app/Router.js index 511994d6..4fa334cd 100755 --- a/App/app/Router.js +++ b/App/app/Router.js @@ -104,10 +104,7 @@ const AppStack = createBottomTabNavigator( }, { - //initialRouteName: 'Home', - initialRouteName: 'Eventos', - - //initialRouteName: 'Calendário', + initialRouteName: 'Home', tabBarOptions: { showLabel: true, // hide labels @@ -125,7 +122,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}`, diff --git a/App/app/screens/Calendar.js b/App/app/screens/Calendar.js index b68a44a0..25d9720d 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 => { @@ -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 && ( )} + +