Skip to content

Commit

Permalink
fix: fixing link when search for blocks and adding labels for hash an…
Browse files Browse the repository at this point in the history
…d height (#520)
  • Loading branch information
rodrigobranas authored Sep 14, 2024
1 parent 065634f commit 860cf94
Showing 1 changed file with 32 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,33 +127,38 @@ const SearchResultDropdown = forwardRef<HTMLDivElement, SearchDropdownProps>(
)}
{searchResult?.block && (
<>
<Dropdown.Label>Block</Dropdown.Label>
<Dropdown.Item className={classes.dropdownItem()}>
<Link
as={NextLink}
href={Routes.blockSimple(
searchResult.block.id!,
'',
'after',
)}
onClick={onSelectItem}
>
{shortAddress(searchResult.block.id || '', trimL, trimR)}
</Link>
</Dropdown.Item>
<Dropdown.Item className={classes.dropdownItem()}>
<Link
as={NextLink}
href={Routes.blockSimple(
searchResult.block.height!,
'',
'after',
)}
onClick={onSelectItem}
>
{searchResult.block.height}
</Link>
</Dropdown.Item>
{searchResult.block.id && (
<>
<Dropdown.Label>Block Hash</Dropdown.Label>
<Dropdown.Item className={classes.dropdownItem()}>
<Link
as={NextLink}
href={`/block/${searchResult.block.id}/simple`}
onClick={onSelectItem}
>
{shortAddress(
searchResult.block.id || '',
trimL,
trimR,
)}
</Link>
</Dropdown.Item>
</>
)}
{searchResult.block.height && (
<>
<Dropdown.Label>Block Height</Dropdown.Label>
<Dropdown.Item className={classes.dropdownItem()}>
<Link
as={NextLink}
href={`/block/${searchResult.block.height}/simple`}
onClick={onSelectItem}
>
{searchResult.block.height}
</Link>
</Dropdown.Item>
</>
)}
</>
)}
{searchResult?.contract && (
Expand Down

0 comments on commit 860cf94

Please sign in to comment.