-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.jsx
More file actions
52 lines (45 loc) · 1.49 KB
/
Copy pathindex.jsx
File metadata and controls
52 lines (45 loc) · 1.49 KB
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
42
43
44
45
46
47
48
49
50
51
52
import React from 'react';
import { Button, Label, ListGroupItem, ListGroup } from 'react-bootstrap';
import { Link } from 'react-router';
const ProductItem = ({ product, removeProject }) => {
const users = (product.users || [])
.map(user => <span> <Label bsStyle='default'>{user.name}</Label></span>);
return (
<ListGroupItem>
<div className='clearfix'>
<div className='pull-left'>
<Link to={`/projects/${product.id}/tasks`}>{product.title}</Link>
</div>
<div className='pull-right'>
<Button
onClick={() => removeProject(product)}
bsStyle='danger'
bsSize='xsmall'
>remove</Button>
</div>
<div className='pull-right'>
{users}
</div>
</div>
</ListGroupItem>
);
};
const ProjectsList = ({ openPopup, projects, removeProject }) => (
<ListGroup>
<ListGroupItem>
<div className='clearfix'>
<div className='pull-left'>
<h5>My projects</h5>
</div>
</div>
</ListGroupItem>
{projects.map(product => (
<ProductItem
key={product.id}
product={product}
removeProject={removeProject}
/>)
)}
</ListGroup>
);
export default ProjectsList;