From 9fca93b5a3955747be8d3d5920cbe0258d9933fb Mon Sep 17 00:00:00 2001 From: sina_sajjadi Date: Mon, 6 Jan 2025 14:10:22 +0330 Subject: [PATCH] fix : use the search param in url for searching duas --- src/components/context/search-context.tsx | 26 ----------------------- src/pages/_app.tsx | 2 -- 2 files changed, 28 deletions(-) delete mode 100644 src/components/context/search-context.tsx diff --git a/src/components/context/search-context.tsx b/src/components/context/search-context.tsx deleted file mode 100644 index 3632bb7..0000000 --- a/src/components/context/search-context.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React, { createContext, useContext, useState, ReactNode } from 'react'; - -interface SearchContextProps { - searchTerm: string; - setSearchTerm: (term: string) => void; -} - -const SearchContext = createContext(undefined); - -export const SearchProvider: React.FC<{ children: ReactNode }> = ({ children }) => { - const [searchTerm, setSearchTerm] = useState(''); - - return ( - - {children} - - ); -}; - -export const useSearch = (): SearchContextProps => { - const context = useContext(SearchContext); - if (!context) { - throw new Error('useSearch must be used within a SearchProvider'); - } - return context; -}; \ No newline at end of file diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 7f2d42d..c1024a5 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -24,7 +24,6 @@ function App({ Component, pageProps }: AppProps) { -
{" "} @@ -43,7 +42,6 @@ function App({ Component, pageProps }: AppProps) {
-