mirror of
https://github.com/ReVanced/revanced-website.git
synced 2026-01-25 11:51:03 +00:00
feat(footer): use info endpoint
This commit is contained in:
@@ -9,13 +9,15 @@ import type {
|
||||
TeamMember,
|
||||
DonationPlatform,
|
||||
CryptoWallet,
|
||||
Social
|
||||
Social,
|
||||
Info
|
||||
} from '$lib/types';
|
||||
|
||||
export type ReposData = { repositories: Repository[] };
|
||||
export type PatchesData = { patches: Patch[]; packages: string[] };
|
||||
export type ReleaseData = { metadata: Metadata; assets: Asset[] };
|
||||
export type TeamData = { members: TeamMember[] };
|
||||
export type InfoData = { info: Info };
|
||||
export type DonationData = { wallets: CryptoWallet[]; platforms: DonationPlatform[] };
|
||||
export type SocialsData = { socials: Social[] };
|
||||
|
||||
@@ -49,7 +51,7 @@ async function patches(): Promise<PatchesData> {
|
||||
|
||||
// sort packages by patch count to get most relevant apps on top
|
||||
const packages = Object.keys(packagesWithCount);
|
||||
packages.sort((a, b) => packagesWithCount[b] - packagesWithCount[a]);
|
||||
packages.sort((a, b) => packagesWithCount[b] - packagesWithCount[a]);
|
||||
|
||||
return { patches: json.patches, packages };
|
||||
}
|
||||
@@ -59,6 +61,11 @@ async function team(): Promise<TeamData> {
|
||||
return { members: json.members };
|
||||
}
|
||||
|
||||
async function info(): Promise<InfoData> {
|
||||
const json = await get_json('v2/info');
|
||||
return { info: json.info };
|
||||
}
|
||||
|
||||
async function donate(): Promise<DonationData> {
|
||||
const json = await get_json('v2/donations');
|
||||
return { wallets: json.donations.wallets, platforms: json.donations.links };
|
||||
@@ -91,6 +98,11 @@ export const queries = {
|
||||
queryFn: team,
|
||||
staleTime
|
||||
},
|
||||
info: {
|
||||
queryKey: ['info'],
|
||||
queryFn: info,
|
||||
staleTime
|
||||
},
|
||||
donate: {
|
||||
queryKey: ['donate'],
|
||||
queryFn: donate,
|
||||
|
||||
Reference in New Issue
Block a user