fix type errors
This commit is contained in:
parent
684b9fdb0c
commit
fd07eb27c5
|
@ -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) => (
|
||||||
|
|
|
@ -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',
|
||||||
|
|
Loading…
Reference in New Issue