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 { results } = this.props.fareattr const { match } = this.props return ( Fare New fare {results && Object.keys(results).map(i => ( Fare ID {results[i].fare_id} Start {results[i].start_date} End {results[i].end_date} ))} ) } } const mapStateToProps = state => ({ farerule: state.farerule, fareattr: state.fareattr, }) const connectFareList = connect( mapStateToProps, {}, )(FareList) export default styled(connectFareList)` color: palevioletred; font-weight: bold; `
New fare
Fare ID
{results[i].fare_id}
Start
{results[i].start_date}
End
{results[i].end_date}