website refactor
This commit is contained in:
@@ -11,4 +11,22 @@ export class MedalDisplay {
|
||||
static getMedalIcon(position: number): string | null {
|
||||
return position <= 3 ? '🏆' : null;
|
||||
}
|
||||
|
||||
static getBg(position: number): string {
|
||||
switch (position) {
|
||||
case 1: return 'bg-warning-amber';
|
||||
case 2: return 'bg-gray-300';
|
||||
case 3: return 'bg-orange-700';
|
||||
default: return 'bg-gray-800';
|
||||
}
|
||||
}
|
||||
|
||||
static getColor(position: number): string {
|
||||
switch (position) {
|
||||
case 1: return 'text-warning-amber';
|
||||
case 2: return 'text-gray-300';
|
||||
case 3: return 'text-orange-700';
|
||||
default: return 'text-gray-400';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,4 +52,22 @@ export class SponsorService implements Service {
|
||||
async getSponsorshipPricing(): Promise<any> {
|
||||
return this.apiClient.getPricing();
|
||||
}
|
||||
|
||||
async getAvailableLeagues(): Promise<Result<any[], DomainError>> {
|
||||
try {
|
||||
const data = await this.apiClient.getAvailableLeagues();
|
||||
return Result.ok(data);
|
||||
} catch (error) {
|
||||
return Result.err({ type: 'serverError', message: error instanceof Error ? error.message : 'Unknown error' });
|
||||
}
|
||||
}
|
||||
|
||||
async getLeagueDetail(leagueId: string): Promise<Result<any, DomainError>> {
|
||||
try {
|
||||
const data = await this.apiClient.getLeagueDetail(leagueId);
|
||||
return Result.ok(data);
|
||||
} catch (error) {
|
||||
return Result.err({ type: 'serverError', message: error instanceof Error ? error.message : 'Unknown error' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Export the DTO type that WalletTransactionViewModel expects
|
||||
export type FullTransactionDto = {
|
||||
id: string;
|
||||
type: 'sponsorship' | 'membership' | 'withdrawal' | 'prize';
|
||||
type: 'sponsorship' | 'membership' | 'withdrawal' | 'prize' | 'deposit';
|
||||
description: string;
|
||||
amount: number;
|
||||
fee: number;
|
||||
@@ -13,7 +13,7 @@ export type FullTransactionDto = {
|
||||
|
||||
export class WalletTransactionViewModel {
|
||||
id: string;
|
||||
type: 'sponsorship' | 'membership' | 'withdrawal' | 'prize';
|
||||
type: 'sponsorship' | 'membership' | 'withdrawal' | 'prize' | 'deposit';
|
||||
description: string;
|
||||
amount: number;
|
||||
fee: number;
|
||||
|
||||
Reference in New Issue
Block a user