Skip to content

Commit

Permalink
πŸ› Fix smallText logs (#2183)
Browse files Browse the repository at this point in the history
* Fix small text logs #2114

* πŸ› Use TitleText instead #2114

* πŸ› Lint error #2114
  • Loading branch information
padms authored Mar 11, 2024
1 parent e8a2bb8 commit 6a73cfb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 34 deletions.
25 changes: 2 additions & 23 deletions web/pageComponents/pageTemplates/NewsRoomPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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;
Expand Down Expand Up @@ -178,27 +177,7 @@ const NewsRoomPage = ({ isServerRendered, locale, pageData, slug, url }: NewsRoo
<main>
<Wrapper>
<Intro ref={resultsRef}>
{title && (
<RichText
value={title}
components={{
block: {
// Overriding the h2. This is the normal text because that's all this text editor allows
normal: ({ children }) => {
// eslint-disable-next-line
// @ts-ignore: Still struggling with the types here :/
if (isEmpty(children)) return null
return (
<Heading level="h1" size="3xl">
{children}
</Heading>
)
},
},
}}
/>
)}

{title && <TitleText value={title} level="h1" size="3xl" />}
{ingress && <UnpaddedText>{ingress && <IngressText value={ingress} />}</UnpaddedText>}
</Intro>
<News>
Expand Down
13 changes: 2 additions & 11 deletions web/pageComponents/shared/Hero/FiftyFiftyHero.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -79,16 +79,7 @@ export const FiftyFiftyHero = ({ title, ingress, link, background, figure, isBig
)}
{ingress && !isBigTitle && (
<StyledIngress>
<IngressText
value={ingress}
components={{
block: {
normal: ({ children }) => {
return <Text size="regular">{children}</Text>
},
},
}}
/>
<RichText value={ingress} />
</StyledIngress>
)}
{link && !isBigTitle && (
Expand Down

0 comments on commit 6a73cfb

Please sign in to comment.