From 585a2aa0b3591a82800781804d7f77234b6860fa Mon Sep 17 00:00:00 2001
From: Franco Labuschagne <92145222+FrancoLab@users.noreply.github.com>
Date: Wed, 11 Oct 2023 21:24:06 +0200
Subject: [PATCH] feat: Add OS detection hook and update search dialog (#1760)
---
.../organisms/SearchDialog/search-dialog.tsx | 9 ++++++---
lib/hooks/useIsMacOS.ts | 16 ++++++++++++++++
2 files changed, 22 insertions(+), 3 deletions(-)
create mode 100644 lib/hooks/useIsMacOS.ts
diff --git a/components/organisms/SearchDialog/search-dialog.tsx b/components/organisms/SearchDialog/search-dialog.tsx
index 41dc6f95ce..dea81f7187 100644
--- a/components/organisms/SearchDialog/search-dialog.tsx
+++ b/components/organisms/SearchDialog/search-dialog.tsx
@@ -12,6 +12,7 @@ import useLockBody from "lib/hooks/useLockBody";
import { getAvatarByUsername } from "lib/utils/github";
import { searchUsers } from "lib/hooks/search-users";
import useDebounceTerm from "lib/hooks/useDebounceTerm";
+import useIsMacOS from "lib/hooks/useIsMacOS";
const SearchDialog = () => {
useLockBody();
@@ -23,6 +24,7 @@ const SearchDialog = () => {
const setOpenSearch = store((state) => state.setOpenSearch);
const debouncedSearchTerm = useDebounceTerm(searchTerm, 300);
const [searchResult, setSearchResult] = useState<{ data: DbUserSearch[]; meta: {} }>();
+ const isMac = useIsMacOS();
useEffect(() => {
document.addEventListener("keydown", handleCloseSearch);
@@ -94,7 +96,7 @@ const SearchDialog = () => {
onKeyDown={handleKeyboardCtrl}
/>