diff --git a/components/organisms/SearchDialog/search-dialog.tsx b/components/organisms/SearchDialog/search-dialog.tsx index b40e3603c..38d4c3721 100644 --- a/components/organisms/SearchDialog/search-dialog.tsx +++ b/components/organisms/SearchDialog/search-dialog.tsx @@ -15,6 +15,7 @@ import useDebounceTerm from "lib/hooks/useDebounceTerm"; import useIsMacOS from "lib/hooks/useIsMacOS"; import useSupabaseAuth from "lib/hooks/useSupabaseAuth"; import { useSearchRepos } from "lib/hooks/useSearchRepos"; +import { Dialog, DialogContent } from "components/molecules/Dialog/dialog"; const SearchDialog = () => { useLockBody(); @@ -26,6 +27,7 @@ const SearchDialog = () => { const [isSearching, setIsSearching] = useState(false); const [isSearchError, setIsSearchError] = useState(false); const setOpenSearch = store((state) => state.setOpenSearch); + const openSearch = store((state) => state.openSearch); const debouncedSearchTerm = useDebounceTerm(searchTerm, 300); const { data: repoData, @@ -136,50 +138,56 @@ const SearchDialog = () => { }; return ( -
-
setOpenSearch(false)} /> -
cursor !== -1 && setCursor(-1)} + + { + setOpenSearch(false); + }} > -
- {isSearching ? ( -
- ) : ( - - )} - { - setSearchTerm(e.target.value); - isSearchError && setIsSearchError(false); - }} - onKeyDown={handleKeyboardCtrl} - /> - - {isMac ? "⌘K" : CTRL+K} - -
-
- {searchTerm.length < 3 ? ( - - ) : isSearchError && !isSearching && (repoDataError || repoData.length === 0) ? ( - - - We couldn't find any users or repositories with that name +
cursor !== -1 && setCursor(-1)} + > +
+ {isSearching ? ( +
+ ) : ( + + )} + { + setSearchTerm(e.target.value); + isSearchError && setIsSearchError(false); + }} + onKeyDown={handleKeyboardCtrl} + /> + + {isMac ? "⌘K" : CTRL+K} - ) : ( - <> -
{renderUserSearchState()}
-
-
{renderRepoSearchState()}
- - )} +
+
+ {searchTerm.length < 3 ? ( + + ) : isSearchError && !isSearching && (repoDataError || repoData.length === 0) ? ( + + + We couldn't find any users or repositories with that name + + ) : ( + <> +
{renderUserSearchState()}
+
+
{renderRepoSearchState()}
+ + )} +
-
-
+ +
); }; @@ -237,13 +245,6 @@ const SearchLoading = () => (
); -const SearchError = () => ( - - - We couldn't find any users or repositories with that name - -); - const SearchResult = ({ result, cursor }: { result: GhUser[]; cursor: number }) => (
Users