Fixed the order for the coreContributors.

This commit is contained in:
NoobDeveloper412 2024-10-03 00:01:04 +05:00
parent 27c03e1f9f
commit cf2b728cfc

View file

@ -3,13 +3,27 @@ import { parseAndWrapCaptions } from "../../utils/captionParser";
const { people, team, core, contributors } = Astro.props; const { people, team, core, contributors } = Astro.props;
// Filter based on the `core` parameter const coreContributorsOrder = [
const members = core ? people.filter((p) => { 'mykola-siusko',
return team.includes(p.id) 'pg',
}).filter((p) => p.imageUrl) : team; 'michael-parenti',
'coinmandeer',
'robert',
'cat',
'odd',
'mf'
];
// Filter based on the `core` parameter
const members = core
? people.filter((p) => team.includes(p.id)).filter((p) => p.imageUrl)
: team;
// Filter and sort `filteredPeople` based on `coreContributorsOrder`
const filteredPeople = members.filter((p) => p.imageUrl).sort((a, b) => {
return coreContributorsOrder.indexOf(a.id) - coreContributorsOrder.indexOf(b.id);
});
// const filteredPeople = members.filter((p) => p.imageUrl).slice(0, 12);
const filteredPeople = members.filter((p) => p.imageUrl);
function personLink(person) { function personLink(person) {
if (person.refs?.twitter) { if (person.refs?.twitter) {
@ -32,6 +46,7 @@ function personLink(person) {
} }
--- ---
<div <div
class="grid grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 place-items-start" class="grid grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 place-items-start"
> >