Skip to content

Commit

Permalink
feat: Update token element's info
Browse files Browse the repository at this point in the history
  • Loading branch information
wenty22 committed Dec 25, 2024
1 parent 68a8453 commit c4f3ee7
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .release/.changeset/hungry-doors-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@bnb-chain/canonical-bridge-widget": patch
"@bnb-chain/canonical-bridge-sdk": patch
---

Update token element's info
1 change: 1 addition & 0 deletions .release/.changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
},
"changesets": [
"bright-impalas-sniff",
"hungry-doors-lick",
"serious-cars-worry"
]
}
6 changes: 6 additions & 0 deletions packages/canonical-bridge-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @bnb-chain/canonical-bridge-sdk

## 0.4.6-alpha.1

### Patch Changes

- Update token element's info

## 0.4.6-alpha.0

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/canonical-bridge-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bnb-chain/canonical-bridge-sdk",
"version": "0.4.6-alpha.0",
"version": "0.4.6-alpha.1",
"description": "canonical bridge sdk",
"author": "bnb-chain",
"private": false,
Expand Down
6 changes: 6 additions & 0 deletions packages/canonical-bridge-widget/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @bnb-chain/canonical-bridge-widget

## 0.5.16-alpha.2

### Patch Changes

- Update token element's info

## 0.5.16-alpha.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/canonical-bridge-widget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bnb-chain/canonical-bridge-widget",
"version": "0.5.16-alpha.1",
"version": "0.5.16-alpha.2",
"description": "canonical bridge widget",
"author": "bnb-chain",
"private": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export function TokenSelectButton(props: SelectButtonProps) {
tokenInfo={token}
tokenLinkUrl={tokenUrl}
offset={[-20, 6]}
data-address={token?.address}
data-name={token?.name}
data-symbol={token?.symbol}
data-display-symbol={token?.displaySymbol}
>
<Box>
<IconImage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export const RouteTitle = ({
tokenInfo={toTokenInfo}
tokenLinkUrl={tokenUrl}
isReceiveArea={true}
data-to-address={toTokenInfo?.address}
data-to-name={toTokenInfo?.name}
data-to-symbol={toTokenInfo?.symbol}
data-to-display-symbol={toTokenInfo?.displaySymbol}
>
<ToTokenInfo
toTokenInfo={toTokenInfo}
Expand Down Expand Up @@ -124,10 +128,10 @@ export const ToTokenInfo = React.forwardRef(
color={theme.colors[colorMode].text.tertiary}
justifyContent="flex-start"
className="bccb-widget-route-token-to-address"
data-address={toTokenInfo.address}
data-name={toTokenInfo.name}
data-symbol={toTokenInfo.symbol}
data-display-symbol={toTokenInfo.displaySymbol}
data-to-address={toTokenInfo.address}
data-to-name={toTokenInfo.name}
data-to-symbol={toTokenInfo.symbol}
data-to-display-symbol={toTokenInfo.displaySymbol}
>
<Link
href={tokenUrl}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ import {
useTheme,
LightMode,
Portal,
PopoverProps,
} from '@bnb-chain/space';
import { useMemo } from 'react';

import { isNativeToken } from '@/core/utils/address.ts';
import { ChainType, IBridgeTokenBaseInfo } from '@/modules/aggregator';

interface TokenTooltipProps extends PopoverProps {
interface TokenTooltipProps {
tokenLinkUrl: string;
tokenInfo?: IBridgeTokenBaseInfo;
children: React.ReactNode;
isReceiveArea?: boolean;
chainType?: ChainType;
offset?: [number, number];
}

export const TokenInfoTooltip = ({
Expand All @@ -31,6 +31,7 @@ export const TokenInfoTooltip = ({
tokenLinkUrl,
isReceiveArea,
chainType = 'evm',
offset,
...restProps
}: TokenTooltipProps) => {
const tokenAddress = tokenInfo?.address ?? '';
Expand All @@ -44,20 +45,17 @@ export const TokenInfoTooltip = ({
return (
<Flex
className="bccb-widget-route-token-tooltip"
data-address={tokenInfo?.address}
data-name={tokenInfo?.name}
data-symbol={tokenInfo?.symbol}
data-display-symbol={tokenInfo?.displaySymbol}
display={'inline-block'}
w={'auto'}
{...restProps}
>
<LightMode>
<Popover
placement="top-start"
trigger={'hover'}
strategy={'fixed'}
autoFocus={false}
{...restProps}
offset={offset}
>
<PopoverTrigger>{children}</PopoverTrigger>
<Portal>
Expand Down

0 comments on commit c4f3ee7

Please sign in to comment.