From 9d8e2e9e97ff031cd05e030d43ec5ea2cb535180 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Wed, 12 May 2021 19:59:49 -0300 Subject: [PATCH] Navigator updates --- .../NavigatorSearchResultItemView.tsx | 2 +- .../NavigatorSearchResultView.tsx | 20 +++---- .../views/search/NavigatorSearchView.tsx | 52 ++++++++++++++----- .../views/search/NavigatorSearchView.types.ts | 6 +++ 4 files changed, 54 insertions(+), 26 deletions(-) diff --git a/src/views/navigator/views/search-result-item/NavigatorSearchResultItemView.tsx b/src/views/navigator/views/search-result-item/NavigatorSearchResultItemView.tsx index b40a4cf1..81ae8b20 100644 --- a/src/views/navigator/views/search-result-item/NavigatorSearchResultItemView.tsx +++ b/src/views/navigator/views/search-result-item/NavigatorSearchResultItemView.tsx @@ -56,7 +56,7 @@ export const NavigatorSearchResultItemView: FC
- + { roomData.habboGroupId > 0 && } { roomData.doorMode !== RoomDataParser.OPEN_STATE && diff --git a/src/views/navigator/views/search-result/NavigatorSearchResultView.tsx b/src/views/navigator/views/search-result/NavigatorSearchResultView.tsx index da85031a..08ed6973 100644 --- a/src/views/navigator/views/search-result/NavigatorSearchResultView.tsx +++ b/src/views/navigator/views/search-result/NavigatorSearchResultView.tsx @@ -49,22 +49,16 @@ export const NavigatorSearchResultView: FC = pro } return ( -
+
-
-
- -
{ LocalizeText(getResultTitle()) }
-
- +
+ +
{ LocalizeText(getResultTitle()) }
+ = NavigatorSearchResultViewDisplayMode.THUMBNAILS })}>
{ isExtended && -
= NavigatorSearchResultViewDisplayMode.THUMBNAILS) }) }> - { searchResult.rooms.length && searchResult.rooms.map((room, index) => +
= NavigatorSearchResultViewDisplayMode.THUMBNAILS) }) }> + { searchResult.rooms.length > 0 && searchResult.rooms.map((room, index) => { return }) } diff --git a/src/views/navigator/views/search/NavigatorSearchView.tsx b/src/views/navigator/views/search/NavigatorSearchView.tsx index 18dbaef4..a9714d4e 100644 --- a/src/views/navigator/views/search/NavigatorSearchView.tsx +++ b/src/views/navigator/views/search/NavigatorSearchView.tsx @@ -1,21 +1,49 @@ -import { FC } from 'react'; +import { FC, useState } from 'react'; import { LocalizeText } from '../../../../utils/LocalizeText'; -import { NavigatorSearchViewProps } from './NavigatorSearchView.types'; +import { INavigatorSearchFilter, NavigatorSearchViewProps } from './NavigatorSearchView.types'; export const NavigatorSearchView: FC = props => { + const searchFilters: INavigatorSearchFilter[] = [ + { + name: 'anything', + query: null + }, + { + name: 'room.name', + query: 'roomname' + }, + { + name: 'owner', + query: 'owner' + }, + { + name: 'tag', + query: 'tag' + }, + { + name: 'group', + query: 'group' + } + ]; + + const [ searchFilter, setSearchFilter ] = useState(searchFilters[0]); + const [ searchString, setSearchString ] = useState(null); + return ( -
-
- -
    -
  • -

    { LocalizeText('navigator.filter.') }

    -
  • -
- +
+
+
-
+
+ setSearchString(event.target.value) } /> +
+
diff --git a/src/views/navigator/views/search/NavigatorSearchView.types.ts b/src/views/navigator/views/search/NavigatorSearchView.types.ts index 4ec704bb..e5d5a51b 100644 --- a/src/views/navigator/views/search/NavigatorSearchView.types.ts +++ b/src/views/navigator/views/search/NavigatorSearchView.types.ts @@ -2,3 +2,9 @@ export interface NavigatorSearchViewProps { } + +export interface INavigatorSearchFilter +{ + name: string; + query: string; +}