[yoga-15] improve service list rendering

This commit is contained in:
Schneider Roland 2025-09-10 22:49:36 +02:00
parent 1e553380e2
commit db881cba06
3 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ export default async function Services() {
common,
services
} = await strapiApi.getServiceListPage();
let sortedServices = services ? [...services] : [];
const sortedServices = services ? [...services] : [];
sortedServices.sort( sortServicesByPriority )
return (
<>

View File

@ -68,7 +68,7 @@ const OurServiceComponent = ({config: {title,header,description,services}}: Prop
}
]
};
let sortedServices = services ? [...services] : [];
const sortedServices = services ? [...services] : [];
sortedServices.sort( sortServicesByPriority )
return (
<section className="services_section">

View File

@ -15,13 +15,13 @@ const SingleService = ({config, index}: Props) => {
return null; // or some fallback UI
}
const {article, articleImage, id, header} = config;
const {article, articleImage, name, header} = config;
let imageUrl: string | undefined = undefined;
const strapiFile = articleImage as StrapiFile;
imageUrl = strapiApi.getImageUrl(strapiFile?.url);
return (
<BlockWithImageComponent id={id} block={article}
<BlockWithImageComponent id={name} block={article}
image={{position: index % 2 ? ImagePosition.Left : ImagePosition.Right, url: imageUrl}}
header={header}/>
);