mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* rename feature * rename evn preset * types, mocks and stubs renaming * rename UI components
17 lines
471 B
TypeScript
17 lines
471 B
TypeScript
import { useRouter } from 'next/router';
|
|
import React from 'react';
|
|
|
|
import getQueryParamString from 'lib/router/getQueryParamString';
|
|
|
|
interface Props {
|
|
chainIds: Array<string>;
|
|
}
|
|
export default function useChainSelectErc20({ chainIds }: Props) {
|
|
const router = useRouter();
|
|
const chainId = getQueryParamString(router.query.chain_id);
|
|
|
|
return React.useState<Array<string> | undefined>(
|
|
chainId && chainIds.includes(chainId) ? [ chainId ] : [ 'all' ],
|
|
);
|
|
}
|