Skip to content

Commit 2ae7363

Browse files
authored
Merge pull request #790 from Conflux-Chain/hotfix-SCAN-4130
feat: update i18n
2 parents 73177fe + b702409 commit 2ae7363

File tree

3 files changed

+126
-120
lines changed

3 files changed

+126
-120
lines changed

src/app/components/Text/index.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type TextProps = {
1313
maxCount?: number;
1414
hoverValue?: React.ReactNode;
1515
hoverValueMaxCount?: number;
16+
getPopupContainer?: (elem: React.ReactNode) => React.ReactNode;
1617
} & Partial<ReactUITextProps>;
1718
type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof TextProps>;
1819
export declare type Props = TextProps & NativeAttrs;
@@ -30,6 +31,7 @@ export const Text = React.memo(
3031
maxCount,
3132
hoverValue,
3233
hoverValueMaxCount: outerHoverValueMaxCount,
34+
getPopupContainer,
3335
...props
3436
}: Props) => {
3537
const bp = useBreakpoint();
@@ -77,18 +79,18 @@ export const Text = React.memo(
7779
textContent,
7880
);
7981

80-
return (
81-
<Tooltip
82-
title={tooltipText}
83-
getPopupContainer={triggerNode => triggerNode}
84-
>
85-
<StyledTextWrapper maxWidth={maxWidth}>
86-
<UIText className={clsx('sirius-text', className)} {...props}>
87-
{child}
88-
</UIText>
89-
</StyledTextWrapper>
90-
</Tooltip>
91-
);
82+
const p = { title: tooltipText };
83+
if (getPopupContainer) {
84+
// @ts-ignore
85+
p.getPopupContainer = getPopupContainer;
86+
}
87+
return React.createElement(Tooltip, p, [
88+
<StyledTextWrapper maxWidth={maxWidth}>
89+
<UIText className={clsx('sirius-text', className)} {...props}>
90+
{child}
91+
</UIText>
92+
</StyledTextWrapper>,
93+
]);
9294
},
9395
);
9496

src/app/containers/AddressContractDetail/TokenBalanceSelect.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ function SelectItem({
119119
const content = (
120120
<SelectItemContent key="content">
121121
<SelectItemContentBalance key="balance">
122-
<Text hoverValue={formatBalance(balance, decimal, true) + ' ' + symbol}>
122+
<Text
123+
hoverValue={formatBalance(balance, decimal, true) + ' ' + symbol}
124+
getPopupContainer={triggerNode => triggerNode}
125+
>
123126
{formatBalance(balance, decimal) + ' ' + symbol}
124127
</Text>
125128
</SelectItemContentBalance>
@@ -135,6 +138,7 @@ function SelectItem({
135138
})
136139
: '--'
137140
}`}
141+
getPopupContainer={triggerNode => triggerNode}
138142
>
139143
{`${currencyUnit}${
140144
price

0 commit comments

Comments
 (0)