From be725639d3187c590f941970720e0275292b14bb Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Sat, 11 Sep 2021 21:09:09 +0800 Subject: [PATCH] Blocklist: don't show pagination widget when searching. Also, re-use existing strings instead. --- static/app-strings.json | 3 +-- ui/component/blockList/view.jsx | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index cba7d161b..e1abc146d 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1917,6 +1917,7 @@ "e.g. John Doe": "e.g. John Doe", "e.g. john@example.com": "e.g. john@example.com", "e.g. satoshi@example.com": "e.g. satoshi@example.com", + "e.g. odysee": "e.g. odysee", "Your channel": "Your channel", "Set to \"Anonymous\" if you do not want to associate your channel in this report.": "Set to \"Anonymous\" if you do not want to associate your channel in this report.", "Send report?": "Send report?", @@ -2168,7 +2169,5 @@ "Content Page": "Content Page", "Card Last 4": "Card Last 4", "Search blocked channel name": "Search blocked channel name", - "e.g. odysee": "e.g. odysee", - "No results found": "No results found", "--end--": "--end--" } diff --git a/ui/component/blockList/view.jsx b/ui/component/blockList/view.jsx index 3df4fb6db..4a45f8f95 100644 --- a/ui/component/blockList/view.jsx +++ b/ui/component/blockList/view.jsx @@ -47,8 +47,9 @@ export default function BlockList(props: Props) { const hasLocalList = localList && localList.length > 0; const justBlocked = list && localList && localList.length < list.length; - const [searchList, setSearchList] = React.useState(null); // null: not searching; []: no results; const [page, setPage] = React.useState(1); + const [searchList, setSearchList] = React.useState(null); // null: not searching; []: no results; + const isShowingSearchResults = searchList !== null; let totalPages = 0; let paginatedLocalList; @@ -134,7 +135,7 @@ export default function BlockList(props: Props) { renderActions={getRenderActions()} /> - setPage(p)} /> + {!isShowingSearchResults && setPage(p)} />} ); } @@ -182,7 +183,7 @@ function SearchList(props: LsbProps) { ))} ) : ( - {__('No results found')} + {__('No results')} )} )}