import React from 'react' import { Helmet } from 'react-helmet' import { withTranslation } from 'react-i18next' import { connect } from 'react-redux' import FormWithGpx from './ActivityForms/FormWithGpx' import FormWithoutGpx from './ActivityForms/FormWithoutGpx' class ActivityAddEdit extends React.Component { constructor(props, context) { super(props, context) this.state = { withGpx: true, } } handleRadioChange(changeEvent) { this.setState({ withGpx: changeEvent.target.name === 'withGpx' ? changeEvent.target.value : !changeEvent.target.value, }) } render() { const { activity, loading, message, sports, t } = this.props const { withGpx } = this.state return (
FitTrackee -{' '} {activity ? t('activities:Edit a workout') : t('activities:Add a workout')}

{message && {t(`messages:${message}`)}}

{activity ? t('activities:Edit a workout') : t('activities:Add a workout')}

{activity ? ( activity.with_gpx ? ( ) : ( ) ) : (
{withGpx ? ( ) : ( )}
)}
) } } export default withTranslation()( connect(state => ({ loading: state.loading, }))(ActivityAddEdit) )