moment dependencia

This commit is contained in:
João Borges 2019-02-08 18:56:38 +00:00
parent 094b5ee5bb
commit 338bee8192
7 changed files with 411 additions and 426 deletions

View File

@ -1,4 +1,3 @@
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, StatusBar, Dimensions, Image, ActivityIndicator} from 'react-native';
@ -55,12 +54,10 @@ const SCREEN_WIDTH = Dimensions.get("window").width;
return (
<View>
<View style={UtilStyles.containerLoading}>
<Text>CARREGANDO {this.props.onHold}</Text>
<ActivityIndicator size="large" color="#0000ff"/>
</View>
)
}
@ -77,9 +74,7 @@ const SCREEN_WIDTH = Dimensions.get("window").width;
return (
<Router></Router>
)
}
else {
@ -132,13 +127,7 @@ const SCREEN_WIDTH = Dimensions.get("window").width;
)
}
}
}
}
@ -163,11 +152,7 @@ const styles = {
color: "red",
paddingBottom: 10
},
manual:{
},
manual: {},
logo: {
@ -215,23 +200,20 @@ const styles = {
},
};
function mapStateToProps(state, props) {
mapStateToProps = (state, props) => {
return {
token: state.apiReducer.token,
loggedIn: state.apiReducer.loggedIn,
onHold: state.apiReducer.onHold,
logged: state.apiReducer.logged
}
}
};
function mapDispatchToProps(dispatch) {
mapDispatchToProps = (dispatch) => {
return bindActionCreators(Actions, dispatch);
}
};
export default connect(mapStateToProps, mapDispatchToProps)(App);

View File

@ -14,6 +14,8 @@ import { AsyncStorage } from 'react-native';
import Data from '../intructions.json';
import Login from '../screens/Login.js';
import moment from 'moment'
export function getData(){
return (dispatch) => {
@ -30,15 +32,15 @@ export function getData(){
export function getEvents(user){
return (dispatch)=>{
var o=[];
let events = [];
console.log("chegou aqui")
for(var key in user.Sessions){
for(let key in user.Sessions){
o.push({
time:user.Sessions[key].SessionStart.substr(11, 14),
timeEnd: user.Sessions[key].SessionEnd.substr(11, 14),
events.push({
time: moment(user.Sessions[key].SessionStart).format('h:mm'),
timeEnd: moment(user.Sessions[key].SessionEnd).format('h: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,
@ -51,8 +53,7 @@ export function getEvents(user){
dispatch({
type: GET_EVENTS,
events: o
events: events
});
@ -89,7 +90,6 @@ const saveToken = async token => {
obj={}
try {
obj.access_token = await AsyncStorage.getItem('userToken') || 'none';
obj.expirationDateToken = await AsyncStorage.getItem('expirationDateToken') || 'none';
obj.refreshToken = await AsyncStorage.getItem('refreshToken') || 'none';

View File

@ -17,20 +17,15 @@ import {bindActionCreators} from 'redux';
import * as Actions from '../actions'; //Import your actionss
const formatObj = (obj) => {
let a = {};
a.push({
})
a.push({})
return a
}
};
const ThirdRoute = () => (
@ -43,8 +38,6 @@ const FourthRoute = () => (
);
class Calendar extends React.Component {
state = {
@ -66,7 +59,6 @@ componentDidMount(){
}
renderDetail = ({item, index}) => {
// <Image source={{ uri:item.imageUrl, width:'100%' , height:100 }} style={{borderRadius:0}}/>
return (
@ -99,7 +91,6 @@ renderEvents = ({ item, index })=> {
<Image source={{uri: item.imageUrl, width: '100%', height: 100}} style={{borderRadius: 0}}/>
<Text style={styles.description}>{item.description}</Text>
<View style={styles.details}>
<Progress.Bar color={'#42a5f5'} progress={0.3} unfilledColor={'white'} width={210}/>
@ -117,13 +108,11 @@ _update=()=>{
}
constructor() {
super()
const archeryImgSource = require('../assets/img/archery.png');
const badmintonImgSource = require('../assets/img/badminton.png');
const lunchImgSource = require('../assets/img/lunch.png');
@ -189,12 +178,16 @@ render() {
<Button onPress={this._update} title="LOGOUT"/>
<Timeline
data={this.props.events}
timeContainerStyle={{minWidth: 52, marginTop: 5}}
timeStyle={{textAlign: 'center', backgroundColor:'#ff9797', color:'white', padding:5, borderRadius:13}}
timeStyle={{
textAlign: 'center',
backgroundColor: '#ff9797',
color: 'white',
padding: 5,
borderRadius: 13
}}
descriptionStyle={{color: 'gray'}}
renderDetail={this.renderDetail}
@ -217,20 +210,25 @@ render() {
</ScrollView>
)
const SecondRoute = () => (
<ScrollView contentContainerStyle={styles.contentContainer}>
<Timeline
data={this.props.events}
timeContainerStyle={{minWidth: 52, marginTop: 5}}
timeStyle={{textAlign: 'center', backgroundColor:'#ff9797', color:'white', padding:5, borderRadius:13}}
timeStyle={{
textAlign: 'center',
backgroundColor: '#ff9797',
color: 'white',
padding: 5,
borderRadius: 13
}}
descriptionStyle={{color: 'gray'}}
renderDetail={this.renderDetail}
@ -255,7 +253,6 @@ render() {
)
return (
<TabView
navigationState={this.state}
renderScene={SceneMap({
@ -298,7 +295,8 @@ const styles = StyleSheet.create({
contentContainer: {
paddingVertical: 20
}
});RkTheme.setType('RkCard', 'story', {
});
RkTheme.setType('RkCard', 'story', {
img: {
height: 100,
opacity: 0.7
@ -312,7 +310,6 @@ const styles = StyleSheet.create({
});
function mapStateToProps(state, props) {
return {

View File

@ -102,8 +102,8 @@ class Home extends Component {
}
console.log(this.props.user.Sessions);
}
render() {
render() {
const {navigate} = this.props.navigation;

5
App/package-lock.json generated
View File

@ -6076,6 +6076,11 @@
}
}
},
"moment": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
},
"morgan": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.1.tgz",

View File

@ -8,8 +8,9 @@
},
"dependencies": {
"axios": "^0.18.0",
"prop-types": "^15.6.2",
"material-icons-react": "^1.0.4",
"moment": "^2.24.0",
"prop-types": "^15.6.2",
"react": "16.6.3",
"react-native": "0.57.8",
"react-native-app-intro-slider": "^1.0.1",