From 7c436b2748f629367bed0565a4d33a4067579a18 Mon Sep 17 00:00:00 2001 From: Hossein Mehrabi Date: Mon, 28 Aug 2023 03:08:05 +0330 Subject: [PATCH] fix: default layout's broken spacing --- src/components/Main/Main.tsx | 4 ++-- src/components/SearchBox/SearchBox.tsx | 2 +- src/pages/search.tsx | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/Main/Main.tsx b/src/components/Main/Main.tsx index ff1680a..4d73b4a 100644 --- a/src/components/Main/Main.tsx +++ b/src/components/Main/Main.tsx @@ -16,11 +16,11 @@ export const Main = ({ } const Container = styled.main<{ - spacing: 'default' | false + spacing: 'default' | boolean }>` --main-margin-top: ${(props) => props.spacing - ? uiConfigs.postSectionMargin + ? uiConfigs.postSectionMargin + uiConfigs.navbarRenderedHeight : uiConfigs.navbarRenderedHeight}px; --main-content-padding: 16px; diff --git a/src/components/SearchBox/SearchBox.tsx b/src/components/SearchBox/SearchBox.tsx index ee6b37b..a33cdc0 100644 --- a/src/components/SearchBox/SearchBox.tsx +++ b/src/components/SearchBox/SearchBox.tsx @@ -352,7 +352,7 @@ const Container = styled.div` flex-direction: column; gap: 12px; border-bottom: 1px solid rgba(var(--lsd-text-primary), 1); - padding: 0 0 14px 14px; + padding: 8px 0 14px 14px; position: sticky; z-index: 1; diff --git a/src/pages/search.tsx b/src/pages/search.tsx index 81b826c..cc1792b 100644 --- a/src/pages/search.tsx +++ b/src/pages/search.tsx @@ -1,16 +1,12 @@ import { SearchBox } from '@/components/SearchBox' -import { - extractQueryFromQuery, - extractTopicsFromQuery, -} from '@/utils/search.utils' -import { useRouter } from 'next/router' +import { SearchResultsExploreView } from '@/containers/Search/ExploreView' +import { SearchResultsListView } from '@/containers/Search/ListView' +import { LPE } from '@/types/lpe.types' import { useEffect, useState } from 'react' import SEO from '../components/SEO/SEO' +import { DefaultLayout } from '../layouts/DefaultLayout' import { api } from '../services/api.service' import unbodyApi from '../services/unbody/unbody.service' -import { LPE } from '@/types/lpe.types' -import { SearchResultsListView } from '@/containers/Search/ListView' -import { SearchResultsExploreView } from '@/containers/Search/ExploreView' interface SearchPageProps { topics: string[] @@ -82,6 +78,10 @@ export default function SearchPage({ topics, shows }: SearchPageProps) { ) } +SearchPage.getLayout = function getLayout(page: React.ReactNode) { + return {page} +} + export async function getStaticProps() { // const { data: articles = [] } = await unbodyApi.searchArticles() // const { data: blocks = [] } = await unbodyApi.searchBlocks()