client/src/components/SessionSummary.js
author salimr <riwad.salim@yahoo.fr>
Tue, 09 Oct 2018 10:52:23 +0200
changeset 162 1fd73fdaf4c6
parent 161 a642639dbc07
child 168 ea92f4fe783d
permissions -rw-r--r--
Add ReadOnlySession component and message when session list is empty
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
125
c653f49fabfb remove unecessary dependencies to Redux
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
     1
import React from 'react';
63
4088f8dc6b52 Improve session page layout, introduce summary.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     2
import _ from 'lodash';
4088f8dc6b52 Improve session page layout, introduce summary.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     3
import '../App.css';
161
a642639dbc07 Split scss files and adapt session page design
salimr <riwad.salim@yahoo.fr>
parents: 151
diff changeset
     4
import './SessionSummary.css'
74
043477fd5c5c add api call to save notes. internally use ts for time data for notes and session
ymh <ymh.work@gmail.com>
parents: 73
diff changeset
     5
import {formatTimestamp} from '../utils';
63
4088f8dc6b52 Improve session page layout, introduce summary.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     6
125
c653f49fabfb remove unecessary dependencies to Redux
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
     7
const SessionSummary = ({notes}) => (
161
a642639dbc07 Split scss files and adapt session page design
salimr <riwad.salim@yahoo.fr>
parents: 151
diff changeset
     8
  <ul className="list-group sticky-left">
125
c653f49fabfb remove unecessary dependencies to Redux
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
     9
    {notes.map((note) =>
161
a642639dbc07 Split scss files and adapt session page design
salimr <riwad.salim@yahoo.fr>
parents: 151
diff changeset
    10
      <li className="list-group-item border-0" key={note.get('_id')}>
a642639dbc07 Split scss files and adapt session page design
salimr <riwad.salim@yahoo.fr>
parents: 151
diff changeset
    11
          <a href={'#note-' + note.get('_id')}>
a642639dbc07 Split scss files and adapt session page design
salimr <riwad.salim@yahoo.fr>
parents: 151
diff changeset
    12
            <small className="note-time text-warning bg-success border-0 text-center">{formatTimestamp(note.startedAt)}</small>
a642639dbc07 Split scss files and adapt session page design
salimr <riwad.salim@yahoo.fr>
parents: 151
diff changeset
    13
            <small className="note-length font-weight-bold px-2 text-muted text-center">{_.words(note.plain).length} mots</small>
a642639dbc07 Split scss files and adapt session page design
salimr <riwad.salim@yahoo.fr>
parents: 151
diff changeset
    14
            <small className="note-time text-warning bg-success border-0 text-center">{formatTimestamp(note.finishedAt)}</small>
a642639dbc07 Split scss files and adapt session page design
salimr <riwad.salim@yahoo.fr>
parents: 151
diff changeset
    15
          </a>
143
cfcbf4bc66f1 Remove react-bootstrap from components except Modal, Collapse and Dropdown
salimr <riwad.salim@yahoo.fr>
parents: 125
diff changeset
    16
      </li>
125
c653f49fabfb remove unecessary dependencies to Redux
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    17
    )}
143
cfcbf4bc66f1 Remove react-bootstrap from components except Modal, Collapse and Dropdown
salimr <riwad.salim@yahoo.fr>
parents: 125
diff changeset
    18
  </ul>
125
c653f49fabfb remove unecessary dependencies to Redux
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    19
)
63
4088f8dc6b52 Improve session page layout, introduce summary.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
    20
125
c653f49fabfb remove unecessary dependencies to Redux
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    21
export default SessionSummary;