Skip to content

Commit

Permalink
fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hu-ke committed Nov 22, 2024
1 parent 3ca4e0f commit 39ceceb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions templates/connect-chain/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ function CreateCosmosApp({ Component, pageProps }: AppProps) {
return (
<ThemeProvider>
<ChainProvider
// @ts-ignore
chains={chains}
// @ts-ingore
assetLists={assets}
wallets={wallets}
walletConnectOptions={{
Expand Down
12 changes: 6 additions & 6 deletions templates/connect-multi-chain/components/wallet/Chain.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useMemo, useState } from 'react';
import { Chains } from '@chain-registry/types';
import { Chain } from '@chain-registry/types';
import { matchSorter } from 'match-sorter';
import {
Avatar,
Expand All @@ -13,15 +13,15 @@ import {
} from '@interchain-ui/react';

export type ChainSelectProps = {
chains: Chains;
chains: Chain[];
chainName?: string;
onChange?: (chainName?: string) => void;
};

export function ChainSelect({
chainName,
chains = [],
onChange = () => {},
onChange = () => { },
}: ChainSelectProps) {
const { themeClass } = useTheme();
const [value, setValue] = useState<string>();
Expand All @@ -31,7 +31,7 @@ export function ChainSelect({
() =>
chains.reduce(
(cache, chain) => ((cache[chain.chain_name] = chain), cache),
{} as Record<string, Chains[number]>
{} as Record<string, Chain[][number]>
),
[chains]
);
Expand Down Expand Up @@ -60,7 +60,7 @@ export function ChainSelect({

if (chain) {
setValue(chain.chain_name);
setInput(chain.pretty_name);
setInput(chain.pretty_name || '');
}
}
}, [chains, chainName]);
Expand Down Expand Up @@ -123,7 +123,7 @@ export function ChainSelect({
>
{options.map((option) => (
<Combobox.Item key={option.value} textValue={option.label}>
<ChainOption logo={option.logo ?? ''} label={option.label} />
<ChainOption logo={option.logo ?? ''} label={option.label ?? ''} />
</Combobox.Item>
))}
</Combobox>
Expand Down
2 changes: 2 additions & 0 deletions templates/connect-multi-chain/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ function CreateCosmosApp({ Component, pageProps }: AppProps) {
return (
<ThemeProvider>
<ChainProvider
// @ts-ignore
chains={chains}
// @ts-ignore
assetLists={assets}
wallets={wallets}
walletConnectOptions={{
Expand Down

0 comments on commit 39ceceb

Please sign in to comment.