| author | ymh <ymh.work@gmail.com> |
| Fri, 16 Nov 2018 17:01:19 +0100 | |
| changeset 174 | ac1a026edd58 |
| parent 170 | 7da1d5137b0b |
| child 190 | 01ad654237d5 |
| permissions | -rw-r--r-- |
|
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'; |
| 174 | 3 |
import Color from 'color'; |
|
63
4088f8dc6b52
Improve session page layout, introduce summary.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff
changeset
|
4 |
import '../App.css'; |
|
161
a642639dbc07
Split scss files and adapt session page design
salimr <riwad.salim@yahoo.fr>
parents:
151
diff
changeset
|
5 |
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
|
6 |
import {formatTimestamp} from '../utils'; |
|
63
4088f8dc6b52
Improve session page layout, introduce summary.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff
changeset
|
7 |
|
|
125
c653f49fabfb
remove unecessary dependencies to Redux
ymh <ymh.work@gmail.com>
parents:
124
diff
changeset
|
8 |
const SessionSummary = ({notes}) => ( |
| 174 | 9 |
<div className="session-summary-list"> |
10 |
<ul className="list-group sticky-left"> |
|
11 |
{notes.map((note) => { |
|
12 |
const bgColor = note.categories.length > 0 ? Color(note.categories[0].color).lighten(0.5).hex() : "transparent"; |
|
13 |
return ( |
|
14 |
<li className="list-group-item border-0 py-1" key={note._id}> |
|
15 |
<a href={'#note-' + note._id}> |
|
16 |
<small className="note-time text-irinotes-time px-1 bg-irinotes-headers border-0 text-center">{formatTimestamp(note.startedAt)}</small> |
|
17 |
<small className="note-length font-weight-bold text-muted text-center badge" style={{ backgroundColor: bgColor }}>{_.words(note.plain).length} mots</small> |
|
18 |
<small className="note-time text-irinotes-time px-1 bg-irinotes-headers border-0 text-center">{formatTimestamp(note.finishedAt)}</small> |
|
19 |
</a> |
|
20 |
</li> |
|
21 |
) |
|
22 |
})} |
|
23 |
</ul> |
|
24 |
</div> |
|
|
125
c653f49fabfb
remove unecessary dependencies to Redux
ymh <ymh.work@gmail.com>
parents:
124
diff
changeset
|
25 |
) |
|
63
4088f8dc6b52
Improve session page layout, introduce summary.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff
changeset
|
26 |
|
|
125
c653f49fabfb
remove unecessary dependencies to Redux
ymh <ymh.work@gmail.com>
parents:
124
diff
changeset
|
27 |
export default SessionSummary; |