File tree Expand file tree Collapse file tree 3 files changed +126
-120
lines changed
containers/AddressContractDetail Expand file tree Collapse file tree 3 files changed +126
-120
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ type TextProps = {
13
13
maxCount ?: number ;
14
14
hoverValue ?: React . ReactNode ;
15
15
hoverValueMaxCount ?: number ;
16
+ getPopupContainer ?: ( elem : React . ReactNode ) => React . ReactNode ;
16
17
} & Partial < ReactUITextProps > ;
17
18
type NativeAttrs = Omit < React . HTMLAttributes < any > , keyof TextProps > ;
18
19
export declare type Props = TextProps & NativeAttrs ;
@@ -30,6 +31,7 @@ export const Text = React.memo(
30
31
maxCount,
31
32
hoverValue,
32
33
hoverValueMaxCount : outerHoverValueMaxCount ,
34
+ getPopupContainer,
33
35
...props
34
36
} : Props ) => {
35
37
const bp = useBreakpoint ( ) ;
@@ -77,18 +79,18 @@ export const Text = React.memo(
77
79
textContent ,
78
80
) ;
79
81
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
+ ] ) ;
92
94
} ,
93
95
) ;
94
96
Original file line number Diff line number Diff line change @@ -119,7 +119,10 @@ function SelectItem({
119
119
const content = (
120
120
< SelectItemContent key = "content" >
121
121
< 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
+ >
123
126
{ formatBalance ( balance , decimal ) + ' ' + symbol }
124
127
</ Text >
125
128
</ SelectItemContentBalance >
@@ -135,6 +138,7 @@ function SelectItem({
135
138
} )
136
139
: '--'
137
140
} `}
141
+ getPopupContainer = { triggerNode => triggerNode }
138
142
>
139
143
{ `${ currencyUnit } ${
140
144
price
You can’t perform that action at this time.
0 commit comments