make #href uniqu

This commit is contained in:
Thomas Ruoff
2018-02-02 23:32:02 +00:00
parent 22b128c1ee
commit 43ed307955

View File

@@ -5,9 +5,10 @@ export default function(props) {
const latest = props.latest || [];
const latestElements = latest.map(item => {
const created = new Date(item.created);
const hrefId = `#item-${item.id}`;
return (
<li key={item.id}>
<a href="#item-{item.id}" onClick={() => props.onSelect(item)}>{created.toLocaleString()}</a>
<a href={hrefId} onClick={() => props.onSelect(item)}>{created.toLocaleString()}</a>
<span> </span>
<Button onClick={() => props.onRemove(item)}>Remove</Button>
</li>