File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,14 @@ interface PeerIconProps {
1212 isYou ?: boolean ;
1313 size : number ;
1414 hideFallback ?: boolean ;
15+ hideTooltip ?: boolean ;
1516}
1617
1718export default function PeerIcon ( {
1819 url,
1920 size,
2021 hideFallback,
22+ hideTooltip = false ,
2123 isYou,
2224} : PeerIconProps ) {
2325 const [ globalHasError , setGlobalHasError ] = useAtom (
@@ -31,15 +33,16 @@ export default function PeerIcon({
3133 if ( ! url || hasError ) {
3234 if ( hideFallback ) {
3335 return < div style = { iconStyles } /> ;
34- } else if ( isYou ) {
35- return (
36- < Tooltip content = "Your current validator" >
37- < img src = { privateYouIcon } style = { iconStyles } />
38- </ Tooltip >
39- ) ;
40- } else {
41- return < img src = { privateIcon } alt = "private" style = { iconStyles } /> ;
4236 }
37+
38+ if ( isYou ) {
39+ const img = < img src = { privateYouIcon } style = { iconStyles } /> ;
40+
41+ if ( hideTooltip ) return img ;
42+ return < Tooltip content = "Your current validator" > { img } </ Tooltip > ;
43+ }
44+
45+ return < img src = { privateIcon } alt = "private" style = { iconStyles } /> ;
4346 }
4447
4548 const handleError = ( ) => {
Original file line number Diff line number Diff line change @@ -268,7 +268,12 @@ function SlotIconName({
268268 const { peer, isLeader, name } = useSlotInfo ( slot ) ;
269269 return (
270270 < Flex gap = "4px" minWidth = "0" >
271- < PeerIcon url = { peer ?. info ?. icon_url } size = { iconSize } isYou = { isLeader } />
271+ < PeerIcon
272+ url = { peer ?. info ?. icon_url }
273+ size = { iconSize }
274+ isYou = { isLeader }
275+ hideTooltip
276+ />
272277 < Text className = { clsx ( styles . slotName , styles . ellipsis ) } > { name } </ Text >
273278 </ Flex >
274279 ) ;
You can’t perform that action at this time.
0 commit comments