Skip to content

Commit

Permalink
chore: various type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Picodes committed Jan 15, 2025
1 parent e79baff commit dd3c918
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 14 deletions.
5 changes: 1 addition & 4 deletions src/components/element/chain/ChainTableRow.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import type { Chain } from "@merkl/api";
import { Link } from "@remix-run/react";
import { Group, Icon } from "dappkit";
import type { BoxProps } from "dappkit";
import { Title } from "dappkit";
import { mergeClass } from "dappkit";
import { type BoxProps, Group, Icon, Title, mergeClass } from "dappkit";
import type { TagTypes } from "../Tag";
import { ChainRow } from "./ChainTable";

Expand Down
19 changes: 16 additions & 3 deletions src/components/element/opportunity/OpportunityCell.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
import { Link } from "@remix-run/react";
import type { BoxProps } from "dappkit";
import { Box, Button, Divider, Dropdown, Fmt, Group, Icon, Icons, PrimitiveTag, Text, Title, Value } from "dappkit";
import { mergeClass } from "dappkit";
import { useOverflowingRef } from "dappkit";
import {
Box,
Button,
Divider,
Dropdown,
Fmt,
Group,
Icon,
Icons,
PrimitiveTag,
Text,
Title,
Value,
mergeClass,
useOverflowingRef,
} from "dappkit";
import { useMemo } from "react";
import merklConfig from "../../../config";
import type { OpportunityNavigationMode } from "../../../config/opportunity";
Expand Down
3 changes: 1 addition & 2 deletions src/components/element/opportunity/OpportunityTableRow.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Link } from "@remix-run/react";
import type { BoxProps } from "dappkit";
import { Dropdown, Group, Icon, Icons, PrimitiveTag, Text, Title, Value } from "dappkit";
import { FormatterService as Fmt, mergeClass } from "dappkit";
import { Dropdown, Fmt, Group, Icon, Icons, PrimitiveTag, Text, Title, Value, mergeClass } from "dappkit";
import { EventBlocker } from "dappkit";
import { useOverflowingRef } from "dappkit";
import { useMemo } from "react";
Expand Down
9 changes: 7 additions & 2 deletions src/components/element/participate/Participate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function Participate({
displayLinks,
hideInteractor,
}: ParticipateProps) {
const [tokenAddress, setTokenAddress] = useState();
const [tokenAddress, setTokenAddress] = useState("");
const [amount, setAmount] = useState<bigint>();
const [mode] = useState<"deposit" | "withdraw">(typeof displayMode === "string" ? displayMode : "deposit");

Expand Down Expand Up @@ -130,7 +130,12 @@ export default function Participate({
<Text>Slippage</Text>
<Input.BigInt
base={2}
state={[slippage, setSlippage]}
state={[
slippage,
v => {
if (!!v) setSlippage(v);
},
]}
size="sm"
className="max-w-[20ch] !rounded-sm+sm"
prefix={
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/resources/useReward.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { InteractionService } from "../../modules/interaction/interaction.servic
export default function useReward(reward?: Reward, userAddress?: string, tokenAddresses?: Set<string>) {
const [claimTransaction, setClaimTransaction] = useState();
const { sponsorTransactions, chainId } = useWalletContext();
const [loading, setLoading] = useState();
const [loading, setLoading] = useState(false);

const payload = useMemo(() => {
if (!userAddress || !reward) return;
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useBalances.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useWalletContext } from "dappkit";
import { useCallback, useEffect, useMemo, useState } from "react";
import { create } from "zustand";
import type { api as clientApi } from "../api/index.client";
import type { api as clientApi } from "../api/index";
import { InteractionService } from "../modules/interaction/interaction.service";

type TokenBalances = Awaited<ReturnType<typeof clientApi.v4.tokens.balances.get>>["data"];
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useMerklSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function useMerklSearch(input: string, include?: Searchable[]) {
const fetchers: {
[S in Searchable]: (i: string) => Promise<Results[S] | null>;
} = {
chain: async i => (await api.v4.chains.index.get({ query: { search: i } }))?.data,
chain: async i => (await api.v4.chains.index.get({ query: { name: i } }))?.data,
opportunity: async i => (await api.v4.opportunities.index.get({ query: { name: i } }))?.data,
protocol: async i => (await api.v4.protocols.index.get({ query: { name: i } }))?.data,
};
Expand Down

0 comments on commit dd3c918

Please sign in to comment.