Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed typos names: useAverageBlockTime, useAverageFees, loadingAvеra… #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions services/explorer-ui/src/hooks/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ export const useTotalContracts = (): UseQueryResult<string, Error> => {
});
};

export const useAvarageFees = (): UseQueryResult<string, Error> => {
export const useAverageFees = (): UseQueryResult<string, Error> => {
return useQuery<string, Error>({
queryKey: ["useAvarageFees"],
queryKey: ["useAverageFees"],
queryFn: statsL2Api.getL2AverageFees,
});
};

export const useAvarageBlockTime = (): UseQueryResult<string, Error> => {
export const useAverageBlockTime = (): UseQueryResult<string, Error> => {
return useQuery<string, Error>({
queryKey: ["useAvarageBlockTime"],
queryKey: ["useAverageBlockTime"],
queryFn: statsL2Api.getL2AverageBlockTime,
});
};
28 changes: 14 additions & 14 deletions services/explorer-ui/src/pages/landing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { BlocksTable } from '~/components/blocks/blocks-table';
import { TxEffectsTable } from '~/components/tx-effects/tx-effects-table';
import { useLatestBlocks } from '~/hooks';
import {
useAvarageBlockTime,
useAvarageFees,
useAverageBlockTime,
useAverageFees,
useTotalContracts,
useTotalTxEffects,
useTotalTxEffectsLast24h,
Expand All @@ -24,20 +24,20 @@ export const Landing: FC = () => {
error: errorTotalEffects24h,
} = useTotalTxEffectsLast24h();
const {
data: avarageFees,
isLoading: loadingAvarageFees,
error: errorAvarageFees,
} = useAvarageFees();
data: averageFees,
isLoading: loadingAverageFees,
error: errorAverageFees,
} = useAverageFees();
const {
data: totalAmountOfContracts,
isLoading: loadingAmountContracts,
error: errorAmountContracts,
} = useTotalContracts();
const {
data: avarageBlockTime,
isLoading: loadingAvarageBlockTime,
error: errorAvarageBlockTime,
} = useAvarageBlockTime();
data: averageBlockTime,
isLoading: loadingAverageBlockTime,
error: errorAverageBlockTime,
} = useAverageBlockTime();

if (isLoading) return <p>Loading...</p>;
if (error) return <p className="text-red-500">{error.message}</p>;
Expand Down Expand Up @@ -82,14 +82,14 @@ export const Landing: FC = () => {
</div>
<div className="bg-white w-3/12 rounded-lg shadow-md p-4">
<p>Average fee's</p>
{getStatsData(loadingAvarageFees, errorAvarageFees, avarageFees)}
{getStatsData(loadingAverageFees, errorAverageFees, averageFees)}
</div>
<div className="bg-white w-3/12 rounded-lg shadow-md p-4">
<p>Average block time</p>
{getStatsData(
loadingAvarageBlockTime,
errorAvarageBlockTime,
avarageBlockTime,
loadingAverageBlockTime,
errorAverageBlockTime,
averageBlockTime,
)}
ms
</div>
Expand Down