mirror of
https://github.com/ReVanced/revanced-website.git
synced 2026-01-22 18:43:57 +00:00
feat: add donation page (#117)
* feat: add donation page * fix: add src to `AnimatedImage` (#139) * feat: redesign page * feat: use api for donations, add QR code * tweak qr code modal and team member design * make team look better at different screen sizes * feat: use api for donations * fix: filled button comes first * feat: use better QR lib * list of crypto instead of table * feat: make crypto card expandable * feat: add donate back to footer-bottom * feat: add expand animation to crypto card * feat: accept an array of queries for prefetch * feat: use api for friendly crypto names * refactor: currency_codes are already uppercase * fix: capitalize crypto icon filenames * feat: use generic crypto icon when no icon is available * feat: add the pulsating heart animated image back * feat: improve animation of pulsating image * feat: decrease donation page top margin * feat: use preferred field to determine button type * use cards for donation methods * optimize images, improve accessibility, add crypto icon to dialogue * update cryptocurrencies modal title * clean up and add comments * add card image fallback * feat: dont hide heart on phones * feat: improve top margin on main class * GRAHH * feat: improve animations * add webp images with png fallbacks --------- Co-authored-by: ᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠ <29128703+milksense@users.noreply.github.com> Co-authored-by: afn <hey@afn.im> Co-authored-by: Ushie <ushiekane@gmail.com>
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
import * as settings from './settings';
|
||||
|
||||
// API Endpoints
|
||||
import type { Patch, Repository, Metadata, Asset } from '$lib/types';
|
||||
import type {
|
||||
Patch,
|
||||
Repository,
|
||||
Metadata,
|
||||
Asset,
|
||||
TeamMember,
|
||||
DonationPlatform,
|
||||
CryptoWallet
|
||||
} from '$lib/types';
|
||||
|
||||
export type ReposData = Repository[];
|
||||
export type PatchesData = { patches: Patch[]; packages: string[] };
|
||||
export type ReleaseData = { metadata: Metadata; assets: Asset[] };
|
||||
export type TeamData = { members: TeamMember[] };
|
||||
export type DonationData = { wallets: CryptoWallet[]; platforms: DonationPlatform[] };
|
||||
|
||||
async function get_json(endpoint: string) {
|
||||
const url = `${settings.api_base_url()}/${endpoint}`;
|
||||
@@ -42,6 +52,17 @@ async function patches(): Promise<PatchesData> {
|
||||
return { patches: json.patches, packages };
|
||||
}
|
||||
|
||||
async function team(): Promise<TeamData> {
|
||||
const json = await get_json('v2/team/members');
|
||||
return { members: json.members };
|
||||
}
|
||||
|
||||
async function donate(): Promise<DonationData> {
|
||||
const json = await get_json('v2/donations');
|
||||
|
||||
return { wallets: json.donations.wallets, platforms: json.donations.links };
|
||||
}
|
||||
|
||||
export const staleTime = 5 * 60 * 1000;
|
||||
export const queries = {
|
||||
manager: {
|
||||
@@ -58,5 +79,15 @@ export const queries = {
|
||||
queryKey: ['repositories'],
|
||||
queryFn: repositories,
|
||||
staleTime
|
||||
},
|
||||
team: {
|
||||
queryKey: ['team'],
|
||||
queryFn: team,
|
||||
staleTime
|
||||
},
|
||||
donate: {
|
||||
queryKey: ['donate'],
|
||||
queryFn: donate,
|
||||
staleTime
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user