diff --git a/client/src/pages/donate-other.js b/client/src/pages/donate-other.js index a5cc3a1f98..54d4abd66b 100644 --- a/client/src/pages/donate-other.js +++ b/client/src/pages/donate-other.js @@ -1,7 +1,9 @@ /* eslint-disable max-len */ import React, { Component, Fragment } from 'react'; import Helmet from 'react-helmet'; +import ReactGA from 'react-ga'; import { Grid, Col, Row } from '@freecodecamp/react-bootstrap'; + import Spacer from '../components/helpers/Spacer'; const payPalPayments = [ @@ -45,53 +47,48 @@ const payPalPayments = [ class IndexPage extends Component { constructor(props, context) { super(props, context); - this.state = { - category: '', - action: '', - label: '' - }; } formbuilder(eventLabel, eventValue, defaultValueHash, defaultValue) { return ( -
- {' '} - {' '} - -
+
ReactGA.event({category: 'Donation', action: 'paypal', label: eventValue.toString()})}> +
+ {' '} + {' '} + +
+
); } formfilter = (array, frequency) => { - let returnVal; if (frequency === 'monthly') { - returnVal = array + return array .filter(item => item.eventValue > 0) .map((item) => { return this.formbuilder(item.eventLabel, item.eventValue, item.defaultValueHash, item.defaultValue); }); } else { - returnVal = array + return array .filter(item => item.eventValue === 0) .map((item) => { return this.formbuilder(item.eventLabel, item.eventValue, item.defaultValueHash, item.defaultValue); }); } - return returnVal; } render() {