Merge branch 'refs/heads/blog' into develop

This commit is contained in:
dzfelix 2024-08-22 17:28:23 +03:00
commit 5844bd9e7c
2 changed files with 7 additions and 6 deletions

View File

@ -27,20 +27,20 @@ export async function generateMetadata({ params }: BlogPostPageProps, parent: Re
}
function renderWidget (widget: Widget) {
function renderWidget (widget: Widget, index: number) {
switch (widget.type){
case 'widgetParagraph':
return (
<>
<div key={'widget'+index} >
<h2 className="title-h2">
{widget.widget.subTitle}
</h2>
<RichText document={widget.widget.body} />
</>
</div>
)
case 'widgetMedia':
return (
<img src={widget.widget.file?.src}/>
<img key={'widget'+index} src={widget.widget.file?.src}/>
)
}
}

View File

@ -13,7 +13,8 @@ type Props = {
basePath: string;
locale: string;
data: BlogPost[],
total: number
total: number,
pageSize: number
};
export const BlogPostsList = ({ basePath = '/', locale, pageSize = DEFAULT_PAGE_SIZE, data = [], total= 0 }: Props) => {
@ -28,7 +29,7 @@ export const BlogPostsList = ({ basePath = '/', locale, pageSize = DEFAULT_PAGE
<div className="news-list">
{data.map((item, i) => (
<li key={'blog'+i} className="list-sidebar__item">
<Link href={`${item.slug}`} className="news-item">
<Link href={`/${locale}/blog/${item.slug}`} className="news-item">
<div className="news-item__image">
<img className="" src={item.listImage?.src} alt={item.listImage?.alt}/>
</div>