mirror of
https://github.com/revanced/revanced-website.git
synced 2025-04-30 06:34:35 +02:00
refactor: remove repo name repitition
This commit is contained in:
parent
3dbf275443
commit
7328c700f5
@ -1,15 +1,15 @@
|
||||
<script lang="ts">
|
||||
export let username: string;
|
||||
export let name: string;
|
||||
export let pfp: string;
|
||||
export let url: string;
|
||||
let alt = `${username}'s contributor profile picture`
|
||||
let alt = `${name}'s profile picture`
|
||||
</script>
|
||||
|
||||
<a href={url} target="_blank">
|
||||
<button>
|
||||
<img src={pfp} alt={alt}><slot/>
|
||||
</button>
|
||||
<h2>{username}</h2>
|
||||
<h2>{name}</h2>
|
||||
</a>
|
||||
|
||||
<style>
|
||||
|
@ -11,7 +11,7 @@
|
||||
onMount (() => {
|
||||
ContributorsStore.subscribe(async (data) => {
|
||||
contribs = await data;
|
||||
contribs = contribs[repo]
|
||||
contribs = contribs[repo].contributors
|
||||
});
|
||||
});
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
<div class="contrib-host">
|
||||
{#each contribs as contrib}
|
||||
{#if !usersIwantToExplodeSoBadly.includes(contrib.login)}
|
||||
<ContributorButton username={contrib.login} pfp={contrib.avatar_url} url={contrib.html_url} />
|
||||
<ContributorButton name={contrib.login} pfp={contrib.avatar_url} url={contrib.html_url} />
|
||||
{/if}
|
||||
{/each}
|
||||
</div>
|
||||
|
@ -1,25 +1,11 @@
|
||||
import { readable } from "svelte/store";
|
||||
|
||||
const fetchContributors = async () => {
|
||||
let cli,
|
||||
patcher,
|
||||
patches,
|
||||
integrations,
|
||||
manager;
|
||||
|
||||
const response = await fetch('https://releases.rvcd.win/contributors');
|
||||
const json = await response.json();
|
||||
|
||||
({ 0: cli, 1: patcher, 2: patches, 3: integrations, 4: manager } = json.repositories);
|
||||
|
||||
cli = cli.contributors
|
||||
patcher = patcher.contributors
|
||||
patches = patches.contributors
|
||||
integrations = integrations.contributors
|
||||
manager = manager.contributors
|
||||
|
||||
let { 0: cli, 1: patcher, 2: patches, 3: integrations, 4: manager } = json.repositories;
|
||||
return {cli, patcher, patches, integrations, manager};
|
||||
|
||||
};
|
||||
|
||||
const ContributorsStore = readable(fetchContributors());
|
||||
|
Loading…
x
Reference in New Issue
Block a user