From 1143cdfc88fb25a13669f60ca62426d0d79cf5cb Mon Sep 17 00:00:00 2001 From: artur Date: Tue, 7 Mar 2023 08:46:48 +0300 Subject: [PATCH] Add sort order dropbox for people search --- packages/app/src/Pages/SearchPage.tsx | 28 ++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/packages/app/src/Pages/SearchPage.tsx b/packages/app/src/Pages/SearchPage.tsx index f35e4811..70655450 100644 --- a/packages/app/src/Pages/SearchPage.tsx +++ b/packages/app/src/Pages/SearchPage.tsx @@ -20,6 +20,7 @@ const SearchPage = () => { const { formatMessage } = useIntl(); const [search, setSearch] = useState(params.keyword); const [keyword, setKeyword] = useState(params.keyword); + const [sortPopular, setSortPopular] = useState(true); // tabs const SearchTab = { Posts: { text: formatMessage(messages.Posts), value: POSTS }, @@ -60,21 +61,40 @@ const SearchPage = () => { const pf = tab.value == PROFILES; return ( <> + {sortOptions()} ); } + function sortOptions() { + if (tab.value != PROFILES) return null; + return ( +
+ +   + +
+ ); + } + function renderTab(v: Tab) { return ; } @@ -94,9 +114,7 @@ const SearchPage = () => { autoFocus={true} /> -
- {[SearchTab.Posts, SearchTab.Profiles].map(renderTab)} -
+
{[SearchTab.Posts, SearchTab.Profiles].map(renderTab)}
{!keyword && } {tabContent()}