feat: remove download history items on long press

This commit is contained in:
Adrian Castro
2024-03-20 20:07:23 +01:00
parent fe93b9a92f
commit 66344d552b
3 changed files with 49 additions and 33 deletions

View File

@@ -6,13 +6,13 @@ import ScreenLayout from "~/components/layout/ScreenLayout";
import { useDownloadManager } from "~/hooks/DownloadManagerContext";
const DownloadsScreen: React.FC = () => {
const { downloads } = useDownloadManager();
const { downloads, removeDownload } = useDownloadManager();
return (
<ScreenLayout title="Downloads">
<ScrollView>
{downloads.map((item) => (
<DownloadItem key={item.id} {...item} />
<DownloadItem key={item.id} {...item} onLongPress={removeDownload} />
))}
</ScrollView>
</ScreenLayout>