mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
Fix items not defined error in Listview when clicking on trash (#4)
* Fix items not defined error in Listview when clicking on trash * Apply review changes
This commit is contained in:
@@ -20,35 +20,37 @@ function ListView({ type, getItems, menu, button }) {
|
||||
};
|
||||
}, [getItems, type]);
|
||||
return (
|
||||
<ListContainer
|
||||
itemsLength={items.length}
|
||||
item={index => {
|
||||
const item = items[index];
|
||||
return (
|
||||
<ListItem
|
||||
title={item.title}
|
||||
body={item.headline}
|
||||
index={index}
|
||||
onClick={() => {}} //TODO
|
||||
info={
|
||||
<Flex justifyContent="center" alignItems="center">
|
||||
<TimeAgo datetime={item.dateDeleted || item.dateCreated} />
|
||||
<Text as="span" mx={1}>
|
||||
•
|
||||
</Text>
|
||||
<Text color="primary">
|
||||
{item.type[0].toUpperCase() + item.type.substring(1)}
|
||||
</Text>
|
||||
</Flex>
|
||||
}
|
||||
menuData={item}
|
||||
menuItems={menu.menuItems(item)}
|
||||
dropdownRefs={menu.dropdownRefs}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
button={button}
|
||||
/>
|
||||
items && (
|
||||
<ListContainer
|
||||
itemsLength={items.length}
|
||||
item={index => {
|
||||
const item = items[index];
|
||||
return (
|
||||
<ListItem
|
||||
title={item.title}
|
||||
body={item.headline}
|
||||
index={index}
|
||||
onClick={() => {}} //TODO
|
||||
info={
|
||||
<Flex justifyContent="center" alignItems="center">
|
||||
<TimeAgo datetime={item.dateDeleted || item.dateCreated} />
|
||||
<Text as="span" mx={1}>
|
||||
•
|
||||
</Text>
|
||||
<Text color="primary">
|
||||
{item.type[0].toUpperCase() + item.type.substring(1)}
|
||||
</Text>
|
||||
</Flex>
|
||||
}
|
||||
menuData={item}
|
||||
menuItems={menu.menuItems(item)}
|
||||
dropdownRefs={menu.dropdownRefs}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
button={button}
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user