Skip to content

Commit

Permalink
Merge pull request #790 from Conflux-Chain/hotfix-SCAN-4130
Browse files Browse the repository at this point in the history
feat: update i18n
  • Loading branch information
0x74616e67 authored Jun 23, 2022
2 parents 73177fe + b702409 commit 2ae7363
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 120 deletions.
26 changes: 14 additions & 12 deletions src/app/components/Text/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type TextProps = {
maxCount?: number;
hoverValue?: React.ReactNode;
hoverValueMaxCount?: number;
getPopupContainer?: (elem: React.ReactNode) => React.ReactNode;
} & Partial<ReactUITextProps>;
type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof TextProps>;
export declare type Props = TextProps & NativeAttrs;
Expand All @@ -30,6 +31,7 @@ export const Text = React.memo(
maxCount,
hoverValue,
hoverValueMaxCount: outerHoverValueMaxCount,
getPopupContainer,
...props
}: Props) => {
const bp = useBreakpoint();
Expand Down Expand Up @@ -77,18 +79,18 @@ export const Text = React.memo(
textContent,
);

return (
<Tooltip
title={tooltipText}
getPopupContainer={triggerNode => triggerNode}
>
<StyledTextWrapper maxWidth={maxWidth}>
<UIText className={clsx('sirius-text', className)} {...props}>
{child}
</UIText>
</StyledTextWrapper>
</Tooltip>
);
const p = { title: tooltipText };
if (getPopupContainer) {
// @ts-ignore
p.getPopupContainer = getPopupContainer;
}
return React.createElement(Tooltip, p, [
<StyledTextWrapper maxWidth={maxWidth}>
<UIText className={clsx('sirius-text', className)} {...props}>
{child}
</UIText>
</StyledTextWrapper>,
]);
},
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ function SelectItem({
const content = (
<SelectItemContent key="content">
<SelectItemContentBalance key="balance">
<Text hoverValue={formatBalance(balance, decimal, true) + ' ' + symbol}>
<Text
hoverValue={formatBalance(balance, decimal, true) + ' ' + symbol}
getPopupContainer={triggerNode => triggerNode}
>
{formatBalance(balance, decimal) + ' ' + symbol}
</Text>
</SelectItemContentBalance>
Expand All @@ -135,6 +138,7 @@ function SelectItem({
})
: '--'
}`}
getPopupContainer={triggerNode => triggerNode}
>
{`${currencyUnit}${
price
Expand Down
Loading

0 comments on commit 2ae7363

Please sign in to comment.