[yoga-15] improve service list rendering
This commit is contained in:
parent
1e553380e2
commit
db881cba06
@ -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 (
|
||||
<>
|
||||
|
||||
@ -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">
|
||||
|
||||
@ -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}/>
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user