From d99e7f9e2d611f832426f18bd59f4f68035e77ac Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 10 Aug 2023 02:48:38 +0300 Subject: [PATCH] New: Show successful grabs in Interactive Search with green icon (cherry picked from commit 366b2b8b52d8375f1f41719a09893136009a5b48) Closes #3981 --- .../src/InteractiveSearch/InteractiveSearchRow.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/InteractiveSearch/InteractiveSearchRow.js b/frontend/src/InteractiveSearch/InteractiveSearchRow.js index 7d4bddf9e..ce32f12bd 100644 --- a/frontend/src/InteractiveSearch/InteractiveSearchRow.js +++ b/frontend/src/InteractiveSearch/InteractiveSearchRow.js @@ -32,6 +32,18 @@ function getDownloadIcon(isGrabbing, isGrabbed, grabError) { return icons.DOWNLOAD; } +function getDownloadKind(isGrabbed, grabError, downloadAllowed) { + if (isGrabbed) { + return kinds.SUCCESS; + } + + if (grabError || !downloadAllowed) { + return kinds.DANGER; + } + + return kinds.DEFAULT; +} + function getDownloadTooltip(isGrabbing, isGrabbed, grabError) { if (isGrabbing) { return ''; @@ -212,7 +224,7 @@ class InteractiveSearchRow extends Component { {