Fix site search (#133)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { CSSReset, ChakraProvider, ColorModeProvider } from '@chakra-ui/core';
|
||||
import { ChakraProvider } from '@chakra-ui/core';
|
||||
import customTheme from '../lib/theme';
|
||||
import '../assets/styling.css';
|
||||
import Head from 'next/head';
|
||||
|
||||
@@ -9,11 +9,27 @@ import Header from '../../components/Header';
|
||||
const IconPage = ({ icon, data }) => {
|
||||
const router = useRouter()
|
||||
|
||||
const onClose = () => {
|
||||
let query = {};
|
||||
|
||||
if(router.query.search) {
|
||||
query = {
|
||||
search: router.query.search
|
||||
};
|
||||
}
|
||||
|
||||
router.push({
|
||||
pathname: '/',
|
||||
query,
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<IconDetailOverlay
|
||||
key={icon.name}
|
||||
icon={icon}
|
||||
onClose={() => router.push('/')}
|
||||
onClose={onClose}
|
||||
/>
|
||||
<Header {...{data}}/>
|
||||
<IconOverview {...{data}}/>
|
||||
|
||||
Reference in New Issue
Block a user