From 6a73cfb21fddfdc9eb6a50459f53928c98ec18cc Mon Sep 17 00:00:00 2001 From: Padmaja Date: Mon, 11 Mar 2024 17:37:12 +0530 Subject: [PATCH] :bug: Fix smallText logs (#2183) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix small text logs #2114 * 🐛 Use TitleText instead #2114 * 🐛 Lint error #2114 --- .../pageTemplates/NewsRoomPage.tsx | 25 ++----------------- .../shared/Hero/FiftyFiftyHero.tsx | 13 ++-------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/web/pageComponents/pageTemplates/NewsRoomPage.tsx b/web/pageComponents/pageTemplates/NewsRoomPage.tsx index 2fa8fbae8..4ab36129c 100644 --- a/web/pageComponents/pageTemplates/NewsRoomPage.tsx +++ b/web/pageComponents/pageTemplates/NewsRoomPage.tsx @@ -7,9 +7,7 @@ import { searchClient } from '../../lib/algolia' import usePaginationPadding from '../../lib/hooks/usePaginationPadding' import { getIsoFromLocale } from '../../lib/localization' import type { NewsRoomPageType } from '../../types' -import isEmpty from '../shared/portableText/helpers/isEmpty' import IngressText from '../shared/portableText/IngressText' -import RichText from '../shared/portableText/RichText' import { Pagination } from '../shared/search/pagination/Pagination' import { PaginationContextProvider } from '../shared/search/pagination/PaginationContext' import Seo from '../shared/Seo' @@ -21,6 +19,7 @@ import { createInstantSearchRouterNext } from 'react-instantsearch-router-nextjs import singletonRouter from 'next/router' import type { UiState } from 'instantsearch.js' import { Configure, InstantSearch } from 'react-instantsearch' +import TitleText from '../shared/portableText/TitleText' const NewsRoomContent = styled.div` display: grid; @@ -178,27 +177,7 @@ const NewsRoomPage = ({ isServerRendered, locale, pageData, slug, url }: NewsRoo
- {title && ( - { - // eslint-disable-next-line - // @ts-ignore: Still struggling with the types here :/ - if (isEmpty(children)) return null - return ( - - {children} - - ) - }, - }, - }} - /> - )} - + {title && } {ingress && {ingress && }} diff --git a/web/pageComponents/shared/Hero/FiftyFiftyHero.tsx b/web/pageComponents/shared/Hero/FiftyFiftyHero.tsx index 465e46832..9e7bdb331 100644 --- a/web/pageComponents/shared/Hero/FiftyFiftyHero.tsx +++ b/web/pageComponents/shared/Hero/FiftyFiftyHero.tsx @@ -1,10 +1,10 @@ import styled from 'styled-components' import Image from '../SanityImage' -import IngressText from '../portableText/IngressText' import TitleText from '../portableText/TitleText' import type { HeroType } from '../../../types/types' import { BackgroundContainer, Text } from '@components' import ReadMoreLink from '../ReadMoreLink' +import RichText from '../portableText/RichText' const StyledHero = styled(BackgroundContainer)` display: grid; @@ -79,16 +79,7 @@ export const FiftyFiftyHero = ({ title, ingress, link, background, figure, isBig )} {ingress && !isBigTitle && ( - { - return {children} - }, - }, - }} - /> + )} {link && !isBigTitle && (