diff --git a/src/lib/components/layout/SearchModal.svelte b/src/lib/components/layout/SearchModal.svelte
new file mode 100644
index 000000000..6ae2f2694
--- /dev/null
+++ b/src/lib/components/layout/SearchModal.svelte
@@ -0,0 +1,180 @@
+
+
+
+
+
diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte
index e9158a396..74b349c21 100644
--- a/src/lib/components/layout/Sidebar.svelte
+++ b/src/lib/components/layout/Sidebar.svelte
@@ -11,6 +11,7 @@
chatId,
tags,
showSidebar,
+ showSearch,
mobile,
showArchivedChats,
pinnedChats,
@@ -58,6 +59,8 @@
import ChannelItem from './Sidebar/ChannelItem.svelte';
import PencilSquare from '../icons/PencilSquare.svelte';
import Home from '../icons/Home.svelte';
+ import MagnifyingGlass from '../icons/MagnifyingGlass.svelte';
+ import SearchModal from './SearchModal.svelte';
const BREAKPOINT = 768;
@@ -204,32 +207,6 @@
chatListLoading = false;
};
- let searchDebounceTimeout;
-
- const searchDebounceHandler = async () => {
- console.log('search', search);
- chats.set(null);
-
- if (searchDebounceTimeout) {
- clearTimeout(searchDebounceTimeout);
- }
-
- if (search === '') {
- await initChatList();
- return;
- } else {
- searchDebounceTimeout = setTimeout(async () => {
- allChatsLoaded = false;
- currentChatPage.set(1);
- await chats.set(await getChatListBySearchText(localStorage.token, search));
-
- if ($chats.length === 0) {
- tags.set(await getAllTags(localStorage.token));
- }
- }, 1000);
- }
- };
-
const importChatHandler = async (items, pinned = false, folderId = null) => {
console.log('importChatHandler', items, pinned, folderId);
for (const item of items) {
@@ -466,6 +443,8 @@
/>
{/if}
+
+