-
-
-
-
-
- {filteredSuggestions.length > 0 && (
-
- {filteredSuggestions.map((suggestion) => (
- - handleSuggestionClick(suggestion)}
- >
- {suggestion.split('-').join(' ')}
-
- ))}
-
- )}
+ <>
+
+
{title}
+
+
+
+
+
+
+
+
+
+ {/* Open Graph */}
+
+
+
+
+
+
+
+ {/* Twitter */}
+
+
+
+
+
+
+
+
+
+
+
+
+ {content}
- {errorMessage &&
{errorMessage}
}
-
- );
-};
+ >
+ )
+}
+
+export default Search
From f725cc3e956077ac80d35bf5b4fed80616912c5d Mon Sep 17 00:00:00 2001
From: Nishitbariya <85815172+Nishitbaria@users.noreply.github.com>
Date: Tue, 8 Aug 2023 14:04:48 +0530
Subject: [PATCH 4/4] Fixing
---
pages/search.tsx | 52 +++++++++++++++++++++++-------------------------
1 file changed, 25 insertions(+), 27 deletions(-)
diff --git a/pages/search.tsx b/pages/search.tsx
index 9ea5f755c..bea5b6097 100644
--- a/pages/search.tsx
+++ b/pages/search.tsx
@@ -1,34 +1,31 @@
-import Head from 'next/head'
-import React, { useEffect } from 'react'
-import { useRouter } from 'next/router'
-
-import CardsList from 'components/Cards/CardsList'
-import { TopBar } from 'components/TopBar/TopBar'
-import ComingSoon from 'components/NewIssue/NewIssue'
-
-import useFilterSearch from 'hooks/useFilterSearch'
+import React, { useEffect } from 'react';
+import { useRouter } from 'next/router';
+import Head from 'next/head';
+import CardsList from 'components/Cards/CardsList';
+import { TopBar } from 'components/TopBar/TopBar';
+import ComingSoon from 'components/NewIssue/NewIssue';
+import useFilterSearch from 'hooks/useFilterSearch';
const Search = () => {
- const router = useRouter()
- const title = `LinksHub - ${router.asPath
- .charAt(1)
- .toUpperCase()}${router.asPath.slice(2)}`
- const query = router.query.query
- const { filterSearch } = useFilterSearch()
+ const router = useRouter();
+ const query = router.query.query;
+ const { filterSearch } = useFilterSearch();
useEffect(() => {
- if (!query || query === '') router.replace('/')
- }, [query, router])
+ if (!query || query === '') router.replace('/');
+ }, [query, router]);
- let content: JSX.Element[] | JSX.Element
+ const data = filterSearch(query as string);
- const data = filterSearch(query as string)
+ const title = `LinksHub - ${
+ router.asPath.charAt(1).toUpperCase() + router.asPath.slice(2)
+ }`;
- if (data.length > 0) {
- content =
- } else {
- content =
- }
+ const content = data.length > 0 ? (
+
+ ) : (
+
+ );
return (
<>
@@ -88,13 +85,14 @@ const Search = () => {
property="discord:invite"
content="https://discord.com/invite/NvK67YnJX5"
/>
+
{content}
>
- )
-}
+ );
+};
-export default Search
+export default Search;