fix type errors

This commit is contained in:
amirhouieh 2023-08-26 14:27:44 +02:00
parent 684b9fdb0c
commit fd07eb27c5
2 changed files with 7 additions and 9 deletions

View File

@ -19,20 +19,19 @@ export const StaticPage: React.FC<StaticPageProps> = ({
...props
}) => {
const titleBlock = data.page.content.find((block) => {
// TODO @Hossein - type definition for classNames is missing for both block types
// @ts-ignore
return block.classNames && block.classNames.includes('title')
})
return (
block.type === LPE.Post.ContentBlockTypes.Text &&
block.classNames &&
block.classNames.includes('title')
)
}) as LPE.Post.TextBlock | undefined
return (
<Root {...props}>
<article>
{titleBlock && (
<Typography variant={'h1'} genericFontFamily={'serif'}>
{
// @ts-ignore
titleBlock.text
}
{titleBlock.text}
</Typography>
)}
{data.page.content.map((block, idx) => (

View File

@ -52,7 +52,6 @@ export namespace LPE {
} as const
export type ContentBlockType = DictValues<typeof ContentBlockTypes>
export const ContentBlockLabels = {
Title: 'title',
Subtitle: 'subtitle',