Skip to content

Commit

Permalink
Merge pull request #1826 from kleros/refactor/court-stats
Browse files Browse the repository at this point in the history
refactor(web): courts-stat
  • Loading branch information
alcercu authored Jan 9, 2025
2 parents 0c67dfa + 743b960 commit f39ef4a
Show file tree
Hide file tree
Showing 6 changed files with 323 additions and 275 deletions.
6 changes: 5 additions & 1 deletion web/src/hooks/useCoinPrice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ const fetchCoinPrices = async (...coinIds) => {
return data.coins;
};

export type Prices = {
[coinId: string]: { price: number };
};

export const useCoinPrice = (coinIds: string[]) => {
const isEnabled = coinIds !== undefined;

const { data: prices, isError } = useQuery({
const { data: prices, isError } = useQuery<Prices>({
queryKey: [`coinPrice${coinIds}`],
enabled: isEnabled,
queryFn: async () => fetchCoinPrices(coinIds),
Expand Down
273 changes: 0 additions & 273 deletions web/src/pages/Courts/CourtDetails/Stats.tsx

This file was deleted.

Loading

0 comments on commit f39ef4a

Please sign in to comment.