clean up, optimise homepage layout
This commit is contained in:
@@ -15,21 +15,20 @@ export default async function Home() {
|
||||
return (
|
||||
<ContentLayout>
|
||||
<Stack gap={5}>
|
||||
|
||||
<NodeAndAddressSearch />
|
||||
</Stack>
|
||||
<Grid container columnSpacing={5} rowSpacing={5}>
|
||||
<Grid size={12}>
|
||||
<SectionHeading title="Noise Generating Network Overview" />
|
||||
</Grid>
|
||||
<Grid size={{ xs: 12, sm: 6, md: 3 }}>
|
||||
<Grid size={{ xs: 12, sm: 6, lg: 3 }}>
|
||||
<NoiseCard />
|
||||
</Grid>
|
||||
<Grid
|
||||
container
|
||||
columnSpacing={5}
|
||||
rowSpacing={5}
|
||||
size={{ xs: 12, sm: 6, md: 3 }}
|
||||
size={{ xs: 12, sm: 6, lg: 3 }}
|
||||
>
|
||||
<Grid size={12}>
|
||||
<RewardsCard />
|
||||
@@ -39,10 +38,10 @@ export default async function Home() {
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid size={{ xs: 12, sm: 6, md: 3 }}>
|
||||
<Grid size={{ xs: 12, sm: 6, lg: 3 }}>
|
||||
<NetworkStakeCard />
|
||||
</Grid>
|
||||
<Grid size={{ xs: 12, sm: 6, md: 3 }}>
|
||||
<Grid size={{ xs: 12, sm: 6, lg: 3 }}>
|
||||
<TokenomicsCard />
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -4,17 +4,7 @@ let queryClient: QueryClient | null = null;
|
||||
|
||||
export function getQueryClient() {
|
||||
if (!queryClient) {
|
||||
queryClient = new QueryClient(
|
||||
// {
|
||||
// defaultOptions: {
|
||||
// queries: {
|
||||
// staleTime: 10 * 60 * 1000, // 10 mins
|
||||
// refetchOnWindowFocus: false,
|
||||
// refetchOnReconnect: false,
|
||||
// },
|
||||
// },
|
||||
// }
|
||||
);
|
||||
queryClient = new QueryClient();
|
||||
}
|
||||
return queryClient;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import { useCallback, useState } from "react";
|
||||
import { useChain } from "@cosmos-kit/react";
|
||||
import { GasPrice } from "@cosmjs/stargate";
|
||||
import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate";
|
||||
import { Button, Stack } from "@mui/material";
|
||||
import type { Delegation } from "@nymproject/contract-clients/Mixnet.types";
|
||||
import { useCallback, useState } from "react";
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { fetchTotalStakerRewards } from "../../app/api";
|
||||
import type { NodeRewardDetails } from "../../app/api/types";
|
||||
@@ -12,25 +14,6 @@ import { useNymClient } from "../../hooks/useNymClient";
|
||||
import Loading from "../loading";
|
||||
import InfoModal, { type InfoModalProps } from "../modal/InfoModal";
|
||||
import RedeemRewardsModal from "../redeemRewards/RedeemRewardsModal";
|
||||
import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate";
|
||||
import { GasPrice } from "@cosmjs/stargate";
|
||||
|
||||
|
||||
|
||||
// const fee = { gas: "1000000", amount: [{ amount: "1000000", denom: "unym" }] };
|
||||
// function createFee(gas: number, gasPrice: number, denom: string) {
|
||||
// return {
|
||||
// gas: gas.toString(),
|
||||
// amount: [
|
||||
// {
|
||||
// amount: Math.ceil(gas * gasPrice).toString(),
|
||||
// denom,
|
||||
// },
|
||||
// ],
|
||||
// };
|
||||
// }
|
||||
|
||||
// const fee = createFee(1_000_000, 0.025, "unym");
|
||||
|
||||
|
||||
// Fetch delegations
|
||||
@@ -54,10 +37,6 @@ const SubHeaderRowActions = () => {
|
||||
const { address, nymClient } = useNymClient();
|
||||
const { getSigningCosmWasmClient, getOfflineSigner } = useChain(COSMOS_KIT_USE_CHAIN);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
// Fetch delegations using React Query
|
||||
@@ -104,10 +83,10 @@ const SubHeaderRowActions = () => {
|
||||
const gasPrice = GasPrice.fromString("0.025unym");
|
||||
|
||||
const client = await SigningCosmWasmClient.connectWithSigner(
|
||||
"https://rpc.nymtech.net/", // rpc endpoint from CosmosKit
|
||||
signer,
|
||||
{ gasPrice }
|
||||
);
|
||||
"https://rpc.nymtech.net/",
|
||||
signer,
|
||||
{ gasPrice }
|
||||
);
|
||||
|
||||
const messages = delegations.map((delegation: NodeRewardDetails) => ({
|
||||
contractAddress: NYM_MIXNET_CONTRACT,
|
||||
@@ -119,9 +98,6 @@ const SubHeaderRowActions = () => {
|
||||
},
|
||||
}));
|
||||
|
||||
// const cosmWasmSigningClient = await getSigningCosmWasmClient();
|
||||
|
||||
|
||||
const result = await client.executeMultiple(
|
||||
address,
|
||||
messages,
|
||||
|
||||
Reference in New Issue
Block a user