import React, { Component, PropTypes } from 'react';
import moment from 'moment';

class Activity extends Component {

  render() {
    const { timestamp, activity, deleteActivity } = this.props;

    return (
      <div className="row row--middle">
        <div className="col--2">
          <p>{moment(+timestamp).format('MMMM DD, YYYY')}</p>
        </div>
        <div className="col--4">
          <span>{activity.description}</span>
          <span className="pl" onClick={() => deleteActivity(timestamp)}>Delete</span>
        </div>
      </div>
    );
  }
}

Activity.propTypes = {
  timestamp: PropTypes.string.isRequired,
  activity: PropTypes.object.isRequired,
  deleteActivity: PropTypes.func.isRequired,
}

export default Activity;

import React, { Component, PropTypes } from 'react';
import moment from 'moment';

class Activity extends Component {

  render() {
    const { timestamp, activity, deleteActivity } = this.props;

    return (
      <div className="row row--middle">
        <div className="col--4">
          <p>
            {activity.description}
            <span className="pl" onClick={() => deleteActivity(timestamp)}>Delete</span>
          </p>
        </div>
      </div>
    );
  }
}

Activity.propTypes = {
  timestamp: PropTypes.string.isRequired,
  activity: PropTypes.object.isRequired,
  deleteActivity: PropTypes.func.isRequired,
}

export default Activity;

Remove date string from activity
Remove date string from activity
