Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
HowardBraham committed Oct 1, 2024
1 parent 6854762 commit 80ac2ea
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
5 changes: 2 additions & 3 deletions ui/components/app/assets/nfts/nft-details/nft-full-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ import { useI18nContext } from '../../../../../hooks/useI18nContext';
import { ASSET_ROUTE } from '../../../../../helpers/constants/routes';
import useGetAssetImageUrl from '../../../../../hooks/useGetAssetImageUrl';

type Params = { asset: string; id: string };

export default function NftFullImage() {
const t = useI18nContext();
const { asset, id } = useParams<Params>() as Params;
const { asset, id } = useParams<{ asset: string; id: string }>();
const nfts = useSelector(getNfts);
const nft = nfts.find(
({ address, tokenId }: { address: string; tokenId: string }) =>
// @ts-expect-error TODO: Fix this type error by handling undefined parameters
isEqualCaseInsensitive(address, asset) && id === tokenId.toString(),
);

Expand Down
5 changes: 2 additions & 3 deletions ui/components/multichain/pages/connections/connections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ import {
} from './components/connections.types';
import { NoConnectionContent } from './components/no-connection';

type Params = { origin: string };

export const Connections = () => {
const t = useI18nContext();
const dispatch = useDispatch();
Expand All @@ -87,7 +85,8 @@ export const Connections = () => {
setShowDisconnectedAllAccountsUpdatedToast,
] = useState(false);

const urlParams = useParams<Params>() as Params;
const urlParams = useParams<{ origin: string }>();
// @ts-expect-error TODO: Fix this type error by handling undefined parameters
const activeTabOrigin = decodeURIComponent(urlParams.origin);

// TODO: Replace `any` with type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ import { MergedInternalAccount } from '../../../../selectors/selectors.types';
import { TEST_CHAINS } from '../../../../../shared/constants/network';
import { SiteCell } from '.';

type Params = { origin: string };

export const ReviewPermissions = () => {
const t = useI18nContext();
const dispatch = useDispatch();
const history = useHistory();
const urlParams = useParams<Params>() as Params;
const urlParams = useParams<{ origin: string }>();
// @ts-expect-error TODO: Fix this type error by handling undefined parameters
const securedOrigin = decodeURIComponent(urlParams.origin);
const [showAccountToast, setShowAccountToast] = useState(false);
const [showNetworkToast, setShowNetworkToast] = useState(false);
Expand Down
6 changes: 3 additions & 3 deletions ui/pages/asset/asset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ import { DEFAULT_ROUTE } from '../../helpers/constants/routes';
import NativeAsset from './components/native-asset';
import TokenAsset from './components/token-asset';

type Params = { asset: string; id: string };

/** A page representing a native, token, or NFT asset */
const Asset = () => {
const nativeCurrency = useSelector(getNativeCurrency);
const tokens = useSelector(getTokens);
const nfts = useSelector(getNfts);
const { asset, id } = useParams<Params>() as Params;
const { asset, id } = useParams<{ asset: string; id: string }>();

const token = tokens.find(({ address }: { address: string }) =>
// @ts-expect-error TODO: Fix this type error by handling undefined parameters
isEqualCaseInsensitive(address, asset),
);

const nft = nfts.find(
({ address, tokenId }: { address: string; tokenId: string }) =>
// @ts-expect-error TODO: Fix this type error by handling undefined parameters
isEqualCaseInsensitive(address, asset) && id === tokenId.toString(),
);

Expand Down

0 comments on commit 80ac2ea

Please sign in to comment.