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">
|
<script lang="ts">
|
||||||
export let username: string;
|
export let name: string;
|
||||||
export let pfp: string;
|
export let pfp: string;
|
||||||
export let url: string;
|
export let url: string;
|
||||||
let alt = `${username}'s contributor profile picture`
|
let alt = `${name}'s profile picture`
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a href={url} target="_blank">
|
<a href={url} target="_blank">
|
||||||
<button>
|
<button>
|
||||||
<img src={pfp} alt={alt}><slot/>
|
<img src={pfp} alt={alt}><slot/>
|
||||||
</button>
|
</button>
|
||||||
<h2>{username}</h2>
|
<h2>{name}</h2>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
onMount (() => {
|
onMount (() => {
|
||||||
ContributorsStore.subscribe(async (data) => {
|
ContributorsStore.subscribe(async (data) => {
|
||||||
contribs = await data;
|
contribs = await data;
|
||||||
contribs = contribs[repo]
|
contribs = contribs[repo].contributors
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -29,7 +29,7 @@
|
|||||||
<div class="contrib-host">
|
<div class="contrib-host">
|
||||||
{#each contribs as contrib}
|
{#each contribs as contrib}
|
||||||
{#if !usersIwantToExplodeSoBadly.includes(contrib.login)}
|
{#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}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,25 +1,11 @@
|
|||||||
import { readable } from "svelte/store";
|
import { readable } from "svelte/store";
|
||||||
|
|
||||||
const fetchContributors = async () => {
|
const fetchContributors = async () => {
|
||||||
let cli,
|
|
||||||
patcher,
|
|
||||||
patches,
|
|
||||||
integrations,
|
|
||||||
manager;
|
|
||||||
|
|
||||||
const response = await fetch('https://releases.rvcd.win/contributors');
|
const response = await fetch('https://releases.rvcd.win/contributors');
|
||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
|
|
||||||
({ 0: cli, 1: patcher, 2: patches, 3: integrations, 4: manager } = json.repositories);
|
let { 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
|
|
||||||
|
|
||||||
return {cli, patcher, patches, integrations, manager};
|
return {cli, patcher, patches, integrations, manager};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const ContributorsStore = readable(fetchContributors());
|
const ContributorsStore = readable(fetchContributors());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user