import React, { Component } from 'react' import styled from 'styled-components' import { connect } from 'react-redux' import { Link } from 'react-router-dom' import { getCalendar } from '../actions/calendar' import store from '../store' const StyledBox = styled.div` padding: 1rem; background: #fafafa; ` const GapBox = styled.span` margin-right: 5px; color: ${props => props.checked ? 'green' : 'gray'};; ` const FakeRow = styled.nav` padding-top: 5px; padding-bottom: 5px; background: white; margin-bottom: 1rem; ` const CheckboxIcon = (props) => ( {props.checked === true && } {props.checked !== true && } ) class FareList extends Component { componentWillMount() { const { count } = this.props.fareattr if (count === 0) store.dispatch(getCalendar()) } render() { const { fareattr, farerule } = this.props const { match } = this.props return (

Fare

{fareattr.results && Object.keys(farerule.results).map(i => (

Fare ID

{fareattr.results[i].fare_id}

Origin ID

{fareattr.results[i].origin_id}

Destination ID (or contains)

{fareattr.results[i].destination_id} {fareattr.results[i].contains_id}

Route ID

{fareattr.results[i].route_id}

))}
{fareattr.results && Object.keys(fareattr.results).map(i => (

Fare ID

{fareattr.results[i].fare_id}

Price

{fareattr.results[i].price}

Currency

{fareattr.results[i].currency_type}

Payment Method

{fareattr.results[i].payment_method}

Transfer

{fareattr.results[i].transfer}

Duration

{fareattr.results[i].transfer_duration}

Agency

{fareattr.results[i].agency_id}

))}
) } } const mapStateToProps = state => ({ farerule: state.farerule, fareattr: state.fareattr, }) const connectFareList = connect( mapStateToProps, {}, )(FareList) export default styled(connectFareList)` color: palevioletred; font-weight: bold; `