Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Gege Li authored and Gege Li committed Aug 13, 2024
1 parent 841617b commit 9dee479
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/app/(defi)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ChainId } from '@/types/chains';
import MigrationPopover from '@/components/migration-popover';

// TODO: add chain id into array when rolling out V2 in the chain
export const v2ChainId: ChainId[] = [ChainId.KOI]
const v2ChainId: ChainId[] = [ChainId.KOI]

const Stake = dynamic(() => import('@/components/stake'), {
ssr: false,
Expand Down
8 changes: 5 additions & 3 deletions src/components/migrate.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { useAccount } from "wagmi";
import { useEffect } from "react";

import { useBigIntContractQuery } from "@/hooks/useBigIntContractQuery";
import { useChain } from "@/hooks/useChain";
import { ActionProps } from "@/types/action";
import { useAccount } from "wagmi";
import { abi } from '@/config/abi/KTONStakingRewards';
import { usePoolAmount } from "@/hooks/usePoolAmount";
import { useMigrate } from "@/hooks/useMigrate";
import { useMigrateState } from "@/hooks/useMigrateState";
import { formatNumericValue } from "@/utils";
import { useEffect } from "react";
import Loading from "./loading";
import { Button } from '@/components/ui/button';
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';

import Loading from "./loading";

const newPoolButtonText = "Stake in new pool";
const newPoolUrl = "https://kton-staking-v2.darwinia.network"

Expand Down
4 changes: 3 additions & 1 deletion src/components/migration-popover.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"use client";
import { useState } from 'react';
import { Button } from './ui/button';

import { cn } from '@/lib/utils';

import { Button } from './ui/button';

const title = "We are migrating";
const instruction = "Please migrate to new KTON Pool and get your gKTON reward. To migrate, please follow steps below:"
const stepContents = [`Step 1:Click \"Unstake\" button to unstake your KTON`, `Step 2:Click \"Stake in new pool\" button to stake your KTON`];
Expand Down
2 changes: 1 addition & 1 deletion src/components/stake.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import { useTokenAllowanceAndApprove } from '@/hooks/useTokenAllowanceAndApprove
import { useStake } from '@/hooks/useStake';
import { usePoolAmount } from '@/hooks/usePoolAmount';
import { useStakeState } from '@/hooks/useStakeState';
import { ActionProps } from '@/types/action';

import AmountInputForm from './amount-input-form';
import KTONBalance from './kton-balance';

import type { Form, SubmitData } from './amount-input-form';
import { ActionProps } from '@/types/action';

const Stake = ({ onTransactionActiveChange }: ActionProps) => {
const formRef: MutableRefObject<Form | null> = useRef(null);
Expand Down
2 changes: 1 addition & 1 deletion src/components/unstake.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { usePoolAmount } from '@/hooks/usePoolAmount';
import { useUnStake } from '@/hooks/useUnStake';
import { useUnStakeState } from '@/hooks/useUnstakeState';
import { cn } from '@/lib/utils';
import { ActionProps } from '@/types/action';

import AmountInputForm from './amount-input-form';
import KTONBalance from './kton-balance';

import { ActionProps } from '@/types/action';
import type { Form, SubmitData } from './amount-input-form';

const UnStake = ({ onTransactionActiveChange }: ActionProps) => {
Expand Down
6 changes: 4 additions & 2 deletions src/hooks/useMigrate.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { useWriteContract } from "wagmi";
import { useCallback, useRef } from "react";
import { parseEther, WriteContractReturnType } from "viem";
import { toast } from "sonner";

import { abi } from "@/config/abi/KTONStakingRewards";

import { getOperationStatus, useAppState } from "./useAppState";
import { useChain } from "./useChain";
import { useLatestCallback } from "./useLatestCallback";
import { ErrorType, SuccessType, useTransactionStatus, UseTransactionStatusProps } from "./useTransactionStatus";
import { abi } from "@/config/abi/KTONStakingRewards";
import { useWalletInteractionToast } from "./useWalletInteractionToast";
import { useInstructionToast } from "./useInstructionToast";
import { toast } from "sonner";


interface UseMigrateProps extends Pick<UseTransactionStatusProps, 'onError' | 'onSuccess'> {
ownerAddress: `0x${string}`;
Expand Down

0 comments on commit 9dee479

Please sign in to comment.