From d897b50f808edcdcca91005fc09d2770a1e6c25c Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 1 Aug 2023 13:29:12 +0300 Subject: [PATCH] New: (UI) Show Magnet Link in search results if any --- frontend/src/Helpers/Props/icons.js | 2 ++ .../src/Search/Mobile/SearchIndexOverview.js | 19 +++++++----- .../src/Search/Mobile/SearchIndexOverviews.js | 2 +- frontend/src/Search/Table/SearchIndexRow.css | 1 + frontend/src/Search/Table/SearchIndexRow.js | 29 +++++++++++++++---- 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/frontend/src/Helpers/Props/icons.js b/frontend/src/Helpers/Props/icons.js index 589add5a8..834452242 100644 --- a/frontend/src/Helpers/Props/icons.js +++ b/frontend/src/Helpers/Props/icons.js @@ -75,6 +75,7 @@ import { faListCheck as fasListCheck, faLocationArrow as fasLocationArrow, faLock as fasLock, + faMagnet as fasMagnet, faMedkit as fasMedkit, faMinus as fasMinus, faMusic as fasMusic, @@ -181,6 +182,7 @@ export const INTERACTIVE = fasUser; export const KEYBOARD = farKeyboard; export const LOCK = fasLock; export const LOGOUT = fasSignOutAlt; +export const MAGNET = fasMagnet; export const MANAGE = fasListCheck; export const MEDIA_INFO = farFileInvoice; export const MISSING = fasExclamationTriangle; diff --git a/frontend/src/Search/Mobile/SearchIndexOverview.js b/frontend/src/Search/Mobile/SearchIndexOverview.js index de3e276b6..235ceb65d 100644 --- a/frontend/src/Search/Mobile/SearchIndexOverview.js +++ b/frontend/src/Search/Mobile/SearchIndexOverview.js @@ -76,6 +76,7 @@ class SearchIndexOverview extends Component { infoUrl, protocol, downloadUrl, + magnetUrl, categories, seeders, leechers, @@ -121,12 +122,15 @@ class SearchIndexOverview extends Component { onPress={this.onGrabPress} /> - + { + downloadUrl || magnetUrl ? + : + null + }
@@ -188,7 +192,8 @@ SearchIndexOverview.propTypes = { publishDate: PropTypes.string.isRequired, title: PropTypes.string.isRequired, infoUrl: PropTypes.string.isRequired, - downloadUrl: PropTypes.string.isRequired, + downloadUrl: PropTypes.string, + magnetUrl: PropTypes.string, indexerId: PropTypes.number.isRequired, indexer: PropTypes.string.isRequired, size: PropTypes.number.isRequired, diff --git a/frontend/src/Search/Mobile/SearchIndexOverviews.js b/frontend/src/Search/Mobile/SearchIndexOverviews.js index 7fadb51e0..671c8e9fd 100644 --- a/frontend/src/Search/Mobile/SearchIndexOverviews.js +++ b/frontend/src/Search/Mobile/SearchIndexOverviews.js @@ -195,7 +195,7 @@ class SearchIndexOverviews extends Component { SearchIndexOverviews.propTypes = { items: PropTypes.arrayOf(PropTypes.object).isRequired, sortKey: PropTypes.string, - scrollTop: PropTypes.number.isRequired, + scrollTop: PropTypes.number, jumpToCharacter: PropTypes.string, scroller: PropTypes.instanceOf(Element).isRequired, showRelativeDates: PropTypes.bool.isRequired, diff --git a/frontend/src/Search/Table/SearchIndexRow.css b/frontend/src/Search/Table/SearchIndexRow.css index 2e8282268..342092b81 100644 --- a/frontend/src/Search/Table/SearchIndexRow.css +++ b/frontend/src/Search/Table/SearchIndexRow.css @@ -59,6 +59,7 @@ margin: 0 2px; width: 22px; color: var(--textColor); + text-align: center; } .externalLinks { diff --git a/frontend/src/Search/Table/SearchIndexRow.js b/frontend/src/Search/Table/SearchIndexRow.js index ffa98447e..5d1920cc9 100644 --- a/frontend/src/Search/Table/SearchIndexRow.js +++ b/frontend/src/Search/Table/SearchIndexRow.js @@ -91,6 +91,8 @@ class SearchIndexRow extends Component { const { guid, protocol, + downloadUrl, + magnetUrl, categories, age, ageHours, @@ -308,12 +310,27 @@ class SearchIndexRow extends Component { onPress={this.onGrabPress} /> - + { + downloadUrl ? + : + null + } + + { + magnetUrl ? + : + null + } ); }