Skip to content

Commit

Permalink
[skip ci] fix link in TokenSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Dec 29, 2023
1 parent c31b779 commit 4afed28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions ui/address/tokenSelect/TokenSelectItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React from 'react';
import { route } from 'nextjs-routes';

import TokenEntity from 'ui/shared/entities/token/TokenEntity';
import LinkInternal from 'ui/shared/LinkInternal';
import TruncatedValue from 'ui/shared/TruncatedValue';

import type { TokenEnhancedData } from '../utils/tokenUtils';
Expand Down Expand Up @@ -47,11 +48,10 @@ const TokenSelectItem = ({ data }: Props) => {
}
})();

// TODO add filter param when token page is ready
const url = route({ pathname: '/token/[hash]', query: { hash: data.token.address } });

return (
<Flex
<LinkInternal
px={ 1 }
py="10px"
display="flex"
Expand All @@ -62,9 +62,8 @@ const TokenSelectItem = ({ data }: Props) => {
_hover={{
bgColor: useColorModeValue('blue.50', 'gray.800'),
}}
color="initial"
fontSize="sm"
cursor="pointer"
as="a"
href={ url }
>
<Flex alignItems="center" w="100%" overflow="hidden">
Expand All @@ -80,7 +79,7 @@ const TokenSelectItem = ({ data }: Props) => {
<Flex alignItems="center" justifyContent="space-between" w="100%" whiteSpace="nowrap">
{ secondRow }
</Flex>
</Flex>
</LinkInternal>
);
};

Expand Down
1 change: 0 additions & 1 deletion ui/shared/LinkInternal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import NextLink from 'next/link';
import type { LegacyRef } from 'react';
import React from 'react';

// NOTE! use this component only for links to pages that are completely implemented in new UI
const LinkInternal = ({ isLoading, ...props }: LinkProps & { isLoading?: boolean }, ref: LegacyRef<HTMLAnchorElement>) => {
if (isLoading) {
return <Flex alignItems="center" { ...props as FlexProps }>{ props.children }</Flex>;
Expand Down

0 comments on commit 4afed28

Please sign in to comment.