forked from marijnkoolen/scholarly-web-annotation-client
/
ResourceList.jsx
42 lines (36 loc) · 1.07 KB
/
ResourceList.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'use strict'
import React from 'react';
import AppAnnotationStore from './../../flux/AnnotationStore';
import AnnotationStore from './../../flux/AnnotationStore';
import Resource from './Resource.jsx';
class ResourceList extends React.Component {
constructor(props) {
super(props);
this.state = {
resources: [],
}
}
componentDidMount() {
}
render() {
//console.log(AnnotationStore.resourceIndex);
let resourceItems = Object.keys(AnnotationStore.resourceIndex).map((resourceId) => {
let resource = AnnotationStore.resourceIndex[resourceId];
return (
<Resource
data={resource}
key={resourceId}
/>
)
})
return (
<div className="resourceList">
<h3>Annotatable Resources</h3>
<ul className="list-group annotation-list-scroll">
{resourceItems}
</ul>
</div>
);
}
}
export default ResourceList;