[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,
|
common,
|
||||||
services
|
services
|
||||||
} = await strapiApi.getServiceListPage();
|
} = await strapiApi.getServiceListPage();
|
||||||
let sortedServices = services ? [...services] : [];
|
const sortedServices = services ? [...services] : [];
|
||||||
sortedServices.sort( sortServicesByPriority )
|
sortedServices.sort( sortServicesByPriority )
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@ -68,7 +68,7 @@ const OurServiceComponent = ({config: {title,header,description,services}}: Prop
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
let sortedServices = services ? [...services] : [];
|
const sortedServices = services ? [...services] : [];
|
||||||
sortedServices.sort( sortServicesByPriority )
|
sortedServices.sort( sortServicesByPriority )
|
||||||
return (
|
return (
|
||||||
<section className="services_section">
|
<section className="services_section">
|
||||||
|
|||||||
@ -15,13 +15,13 @@ const SingleService = ({config, index}: Props) => {
|
|||||||
return null; // or some fallback UI
|
return null; // or some fallback UI
|
||||||
}
|
}
|
||||||
|
|
||||||
const {article, articleImage, id, header} = config;
|
const {article, articleImage, name, header} = config;
|
||||||
let imageUrl: string | undefined = undefined;
|
let imageUrl: string | undefined = undefined;
|
||||||
const strapiFile = articleImage as StrapiFile;
|
const strapiFile = articleImage as StrapiFile;
|
||||||
imageUrl = strapiApi.getImageUrl(strapiFile?.url);
|
imageUrl = strapiApi.getImageUrl(strapiFile?.url);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BlockWithImageComponent id={id} block={article}
|
<BlockWithImageComponent id={name} block={article}
|
||||||
image={{position: index % 2 ? ImagePosition.Left : ImagePosition.Right, url: imageUrl}}
|
image={{position: index % 2 ? ImagePosition.Left : ImagePosition.Right, url: imageUrl}}
|
||||||
header={header}/>
|
header={header}/>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user