import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import moment from 'moment'; import { Link } from 'react-router'; import * as SketchActions from '../actions/projects'; import * as ProjectActions from '../actions/project'; import InlineSVG from 'react-inlinesvg'; const exitUrl = require('../../../images/exit.svg'); class SketchList extends React.Component { componentDidMount() { this.props.getProjects(this.props.username); } render() { return (

Sketches

{this.props.sketches.map(sketch => )}
Name Created Last Updated
{sketch.name} {moment(sketch.createdAt).format('MMM D, YYYY h:mm:ss A')} {moment(sketch.updatedAt).format('MMM D, YYYY h:mm:ss A')}
); } } SketchList.propTypes = { user: PropTypes.object.isRequired, getProjects: PropTypes.func.isRequired, sketches: PropTypes.array.isRequired, closeSketchList: PropTypes.func.isRequired, username: PropTypes.string }; function mapStateToProps(state) { return { user: state.user, sketches: state.sketches }; } function mapDispatchToProps(dispatch) { return bindActionCreators(Object.assign({}, SketchActions, ProjectActions), dispatch); } export default connect(mapStateToProps, mapDispatchToProps)(SketchList);