mirror of https://github.com/VERT-sh/VERT.git
Fetch github contributors
This commit is contained in:
parent
2a460c4275
commit
8ec9546b7e
|
@ -1,102 +1,74 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { log } from "$lib/logger";
|
||||||
import * as About from "$lib/sections/about";
|
import * as About from "$lib/sections/about";
|
||||||
import { InfoIcon } from "lucide-svelte";
|
import { InfoIcon } from "lucide-svelte";
|
||||||
|
import { onMount } from "svelte";
|
||||||
|
|
||||||
const donors = [
|
interface Donator {
|
||||||
{
|
name: string;
|
||||||
name: "John Doe",
|
amount?: string | number;
|
||||||
amount: "5",
|
avatar: string;
|
||||||
avatar: "https://avatars.githubusercontent.com/u/45893380?v=4",
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "John Smith",
|
|
||||||
amount: "1",
|
|
||||||
avatar: "https://avatars.githubusercontent.com/u/62841684?v=4",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Jane Doe",
|
|
||||||
amount: "10",
|
|
||||||
avatar: "https://avatars.githubusercontent.com/u/163438634?v=4",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "John Smith",
|
|
||||||
amount: "1",
|
|
||||||
avatar: "https://avatars.githubusercontent.com/u/62841684?v=4",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "John Doe",
|
|
||||||
amount: "5",
|
|
||||||
avatar: "https://avatars.githubusercontent.com/u/45893380?v=4",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "John Smith",
|
|
||||||
amount: "1",
|
|
||||||
avatar: "https://avatars.githubusercontent.com/u/62841684?v=4",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Jane Doe",
|
|
||||||
amount: "10",
|
|
||||||
avatar: "https://avatars.githubusercontent.com/u/163438634?v=4",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "John Smith",
|
|
||||||
amount: "1",
|
|
||||||
avatar: "https://avatars.githubusercontent.com/u/62841684?v=4",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const mainContribs = [
|
interface Contributor {
|
||||||
|
name: string;
|
||||||
|
github?: string;
|
||||||
|
role?: string;
|
||||||
|
avatar: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const donors: Donator[] = [];
|
||||||
|
|
||||||
|
const mainContribs: Contributor[] = [
|
||||||
{
|
{
|
||||||
name: "nullptr",
|
name: "nullptr",
|
||||||
|
github: "not-nullptr",
|
||||||
role: "Lead developer; conversion backend, UI implementation",
|
role: "Lead developer; conversion backend, UI implementation",
|
||||||
avatar: "https://avatars.githubusercontent.com/u/62841684?v=4",
|
avatar: "https://avatars.githubusercontent.com/u/62841684?v=4",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Realmy",
|
name: "Realmy",
|
||||||
|
github: "RealmyTheMan",
|
||||||
role: "Lead designer; logo and branding, user interface design",
|
role: "Lead designer; logo and branding, user interface design",
|
||||||
avatar: "https://avatars.githubusercontent.com/u/163438634?v=4",
|
avatar: "https://avatars.githubusercontent.com/u/163438634?v=4",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "JovannMC",
|
name: "JovannMC",
|
||||||
|
github: "JovannMC",
|
||||||
role: "Developer; lorem ipsum, UI implementation",
|
role: "Developer; lorem ipsum, UI implementation",
|
||||||
avatar: "https://avatars.githubusercontent.com/u/45893380?v=4",
|
avatar: "https://avatars.githubusercontent.com/u/45893380?v=4",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const ghContribs = [
|
let ghContribs: Contributor[] = [];
|
||||||
{
|
|
||||||
name: "John Doe",
|
onMount(async () => {
|
||||||
avatar: "https://avatars.githubusercontent.com/u/45893380?v=4",
|
try {
|
||||||
},
|
const response = await fetch(
|
||||||
{
|
"https://api.github.com/repos/not-nullptr/VERT/contributors",
|
||||||
name: "John Smith",
|
);
|
||||||
avatar: "https://avatars.githubusercontent.com/u/62841684?v=4",
|
if (!response.ok) {
|
||||||
},
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
{
|
}
|
||||||
name: "Jane Doe",
|
const allContribs = await response.json();
|
||||||
avatar: "https://avatars.githubusercontent.com/u/163438634?v=4",
|
|
||||||
},
|
// Filter out main contributors
|
||||||
{
|
const mainContribNames = mainContribs.map(
|
||||||
name: "John Smith",
|
(contrib) => contrib.github,
|
||||||
avatar: "https://avatars.githubusercontent.com/u/62841684?v=4",
|
);
|
||||||
},
|
ghContribs = allContribs
|
||||||
{
|
.filter(
|
||||||
name: "John Doe",
|
(contrib: { login: string }) =>
|
||||||
avatar: "https://avatars.githubusercontent.com/u/45893380?v=4",
|
!mainContribNames.includes(contrib.login),
|
||||||
},
|
)
|
||||||
{
|
.map((contrib: { login: string; avatar_url: string }) => ({
|
||||||
name: "John Smith",
|
name: contrib.login,
|
||||||
avatar: "https://avatars.githubusercontent.com/u/62841684?v=4",
|
avatar: contrib.avatar_url,
|
||||||
},
|
}));
|
||||||
{
|
} catch (error) {
|
||||||
name: "Jane Doe",
|
log("general", `Error fetching GitHub contributors: ${error}`);
|
||||||
avatar: "https://avatars.githubusercontent.com/u/163438634?v=4",
|
}
|
||||||
},
|
});
|
||||||
{
|
|
||||||
name: "John Smith",
|
|
||||||
avatar: "https://avatars.githubusercontent.com/u/62841684?v=4",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col h-full items-center">
|
<div class="flex flex-col h-full items-center">
|
||||||
|
|
Loading…
Reference in New Issue