diff -r c77570164050 -r c653f49fabfb client/src/components/SessionSummary.js --- a/client/src/components/SessionSummary.js Thu Jul 20 11:23:08 2017 +0200 +++ b/client/src/components/SessionSummary.js Thu Jul 20 23:37:58 2017 +0200 @@ -1,32 +1,20 @@ -import React, { Component } from 'react'; -import { connect } from 'react-redux'; +import React from 'react'; import { ListGroup, ListGroupItem } from 'react-bootstrap'; import _ from 'lodash'; import '../App.css'; import {formatTimestamp} from '../utils'; -class SessionSummary extends Component { - render() { - return ( - - {this.props.notes.map((note) => - - - {formatTimestamp(note.startedAt)} → {formatTimestamp(note.finishedAt)} - {_.words(note.plain).length} words - - - )} - - ); - } -} +const SessionSummary = ({notes}) => ( + + {notes.map((note) => + + + {formatTimestamp(note.startedAt)} → {formatTimestamp(note.finishedAt)} + {_.words(note.plain).length} words + + + )} + +) -function mapStateToProps(state, props) { - return { - ...props, - notes : props.notes.filter(note => !note.deleted) - }; -} - -export default connect(mapStateToProps)(SessionSummary); +export default SessionSummary;