Compare commits
2 Commits
2f2d9db82a
...
dbb74b9ccd
Author | SHA1 | Date |
---|---|---|
dzfelix | dbb74b9ccd | |
dzfelix | 8ee52bc834 |
|
@ -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}/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue