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 { RkButton, RkCard, RkText, RkTheme } from "react-native-ui-kitten"; import Timeline from "react-native-timeline-feed"; 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 => { let a = {}; a.push({}); return a; }; 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 } ], CP: "SEM", cpColor: "white", careerPath: { name: "", color: "" } }; componentDidMount() { this.props.getEvents(this.props.user); this.props.getSessions(this.props.userDetails.token); } _openDetails = () => { console.log("los"); }; renderDetail = ({ item, index }) => { const { navigate } = this.props.navigation; // return ( navigate("calendarDetail", { info: item })} > {item.name} Local: 1 {item.description} {item.Enrolled} / {item.MaxAttendees} ); }; _update = () => { this.setState({ user: this.props.user }); console.log(this.props.events); }; _renderTabBar = props => { const inputRange = props.navigationState.routes.map((x, i) => i); return ( {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 ( this.setState({ index: i })} > {route.weekDay} {route.day} ); })} ); }; constructor() { super(); } _refresh=()=>{ this.props.getEvents(this.props.user); this.props.getSessions(this.props.userDetails.token); } render() { const ThirdRoute = () => ( {this.props.events != undefined && ( index.toString()} /> )} ); const FourthRoute = () => ( {this.props.events != undefined && ( index.toString()} /> )} ); const FirstRoute = () => ( {this.props.events != undefined && ( index.toString()} /> )} ); const SecondRoute = () => ( {this.props.events != undefined && ( index.toString()} /> )} ); return ( {this.props.careerPath != undefined && ( {this.props.careerPath.name} )} this.setState({ index })} initialLayout={{ width: Dimensions.get("window").width, height: Dimensions.get("window").height }} style={{ backgroundColor: "#F2F2F2" }} indicatorStyle={{ backgroundColor: "pink" }} />