import React from 'react' import { Helmet } from 'react-helmet' import { connect } from 'react-redux' import ActivityMap from './ActivityMap' import { getData } from '../../actions/index' class ActivityDisplay extends React.Component { componentDidMount() { this.props.loadActivity( this.props.location.pathname.replace('/activities/', '') ) } render() { const { activities, message, sports } = this.props const [activity] = activities return (
{message}
) : (
{' '} Start at {activity.activity_date}
{' '} Duration: {activity.duration} {' '} {activity.pauses !== '0:00:00' && ( `(pauses: ${activity.pauses})` )}
{' '} Distance: {activity.distance} km
{' '} Average speed: {activity.ave_speed} km/h -{' '} Max speed : {activity.max_speed} km/h
{' '} Min altitude: {activity.min_alt}m -{' '} Max altitude: {activity.max_alt}m
{' '} Ascent: {activity.ascent}m -{' '} Descent: {activity.descent}m