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

View File

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