client/src/components/SessionSummary.js
changeset 125 c653f49fabfb
parent 124 c77570164050
child 143 cfcbf4bc66f1
--- 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 (
-      <ListGroup>
-        {this.props.notes.map((note) =>
-          <ListGroupItem key={note.get('_id')}>
-            <a href={'#note-' + note.get('_id')}>
-              <span className="text-muted">{formatTimestamp(note.startedAt)} → {formatTimestamp(note.finishedAt)}</span>
-              <span className="pull-right">{_.words(note.plain).length} words</span>
-            </a>
-          </ListGroupItem>
-        )}
-      </ListGroup>
-    );
-  }
-}
+const SessionSummary = ({notes}) => (
+  <ListGroup>
+    {notes.map((note) =>
+      <ListGroupItem key={note.get('_id')}>
+        <a href={'#note-' + note.get('_id')}>
+          <span className="text-muted">{formatTimestamp(note.startedAt)} → {formatTimestamp(note.finishedAt)}</span>
+          <span className="pull-right">{_.words(note.plain).length} words</span>
+        </a>
+      </ListGroupItem>
+    )}
+  </ListGroup>
+)
 
-function mapStateToProps(state, props) {
-    return {
-    ...props,
-    notes : props.notes.filter(note => !note.deleted)
-  };
-}
-
-export default connect(mapStateToProps)(SessionSummary);
+export default SessionSummary;