Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
267e7de2
Unverified
Commit
267e7de2
authored
Mar 24, 2023
by
eddie
Committed by
GitHub
Mar 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: remove unicon tooltip entirely (#6250)
parent
ab9f2af0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
56 deletions
+4
-56
StatusIcon.tsx
src/components/Identicon/StatusIcon.tsx
+3
-53
index.tsx
src/components/Web3Status/index.tsx
+1
-3
No files found.
src/components/Identicon/StatusIcon.tsx
View file @
267e7de2
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
MouseoverTooltip
}
from
'
components/Tooltip
'
import
{
Unicon
}
from
'
components/Unicon
'
import
{
Unicon
}
from
'
components/Unicon
'
import
{
Connection
,
ConnectionType
}
from
'
connection
'
import
{
Connection
,
ConnectionType
}
from
'
connection
'
import
useENSAvatar
from
'
hooks/useENSAvatar
'
import
useENSAvatar
from
'
hooks/useENSAvatar
'
import
{
useIsMobile
}
from
'
nft/hooks
'
import
{
PropsWithChildren
}
from
'
react
'
import
styled
from
'
styled-components/macro
'
import
styled
from
'
styled-components/macro
'
import
{
ThemedText
}
from
'
theme
'
import
{
flexColumnNoWrap
}
from
'
theme/styles
'
import
{
flexColumnNoWrap
}
from
'
theme/styles
'
import
sockImg
from
'
../../assets/svg/socks.svg
'
import
sockImg
from
'
../../assets/svg/socks.svg
'
...
@@ -69,72 +65,26 @@ const MiniWalletIcon = ({ connection, side }: { connection: Connection; side: 'l
...
@@ -69,72 +65,26 @@ const MiniWalletIcon = ({ connection, side }: { connection: Connection; side: 'l
)
)
}
}
const
Divider
=
styled
.
div
`
const
MainWalletIcon
=
({
connection
,
size
}:
{
connection
:
Connection
;
size
:
number
})
=>
{
border-bottom: 1px solid
${({
theme
})
=>
theme
.
backgroundOutline
}
;
margin: 12px 0;
`
function
UniconTooltip
({
children
,
enabled
}:
PropsWithChildren
<
{
enabled
?:
boolean
}
>
)
{
return
(
<
MouseoverTooltip
offsetY=
{
8
}
disableHover=
{
!
enabled
}
text=
{
// TODO(cartcrom): add Learn More link when unicon microsite is polished
<>
<
ThemedText
.
SubHeaderSmall
color=
"textPrimary"
paddingTop=
"4px"
>
This is your Unicon
</
ThemedText
.
SubHeaderSmall
>
<
Divider
/>
<
ThemedText
.
Caption
paddingBottom=
"4px"
>
Unicons are avatars for your wallet, generated from your address.
</
ThemedText
.
Caption
>
</>
}
placement=
"bottom"
>
<
div
>
{
children
}
</
div
>
</
MouseoverTooltip
>
)
}
const
MainWalletIcon
=
({
connection
,
size
,
enableInfotips
,
}:
{
connection
:
Connection
size
:
number
enableInfotips
?:
boolean
})
=>
{
const
{
account
}
=
useWeb3React
()
const
{
account
}
=
useWeb3React
()
const
{
avatar
}
=
useENSAvatar
(
account
??
undefined
)
const
{
avatar
}
=
useENSAvatar
(
account
??
undefined
)
const
isMobile
=
useIsMobile
()
if
(
!
account
)
{
if
(
!
account
)
{
return
null
return
null
}
else
if
(
avatar
||
(
connection
.
type
===
ConnectionType
.
INJECTED
&&
connection
.
name
===
'
MetaMask
'
))
{
}
else
if
(
avatar
||
(
connection
.
type
===
ConnectionType
.
INJECTED
&&
connection
.
name
===
'
MetaMask
'
))
{
return
<
Identicon
size=
{
size
}
/>
return
<
Identicon
size=
{
size
}
/>
}
else
{
}
else
{
return
isMobile
?
(
return
<
Unicon
address=
{
account
}
size=
{
size
}
/>
<
Unicon
address=
{
account
}
size=
{
size
}
/>
)
:
(
<
UniconTooltip
enabled=
{
enableInfotips
}
>
<
Unicon
address=
{
account
}
size=
{
size
}
/>
</
UniconTooltip
>
)
}
}
}
}
export
default
function
StatusIcon
({
export
default
function
StatusIcon
({
connection
,
connection
,
size
=
16
,
size
=
16
,
enableInfotips
,
showMiniIcons
=
true
,
showMiniIcons
=
true
,
}:
{
}:
{
connection
:
Connection
connection
:
Connection
size
?:
number
size
?:
number
enableInfotips
?:
boolean
showMiniIcons
?:
boolean
showMiniIcons
?:
boolean
})
{
})
{
const
hasSocks
=
useHasSocks
()
const
hasSocks
=
useHasSocks
()
...
@@ -142,7 +92,7 @@ export default function StatusIcon({
...
@@ -142,7 +92,7 @@ export default function StatusIcon({
return
(
return
(
<
IconWrapper
size=
{
size
}
>
<
IconWrapper
size=
{
size
}
>
{
hasSocks
&&
showMiniIcons
&&
<
Socks
/>
}
{
hasSocks
&&
showMiniIcons
&&
<
Socks
/>
}
<
MainWalletIcon
connection=
{
connection
}
size=
{
size
}
enableInfotips=
{
enableInfotips
}
/>
<
MainWalletIcon
connection=
{
connection
}
size=
{
size
}
/>
{
showMiniIcons
&&
<
MiniWalletIcon
connection=
{
connection
}
side=
"right"
/>
}
{
showMiniIcons
&&
<
MiniWalletIcon
connection=
{
connection
}
side=
"right"
/>
}
</
IconWrapper
>
</
IconWrapper
>
)
)
...
...
src/components/Web3Status/index.tsx
View file @
267e7de2
...
@@ -202,9 +202,7 @@ function Web3StatusInner() {
...
@@ -202,9 +202,7 @@ function Web3StatusInner() {
pending=
{
hasPendingTransactions
}
pending=
{
hasPendingTransactions
}
isClaimAvailable=
{
isClaimAvailable
}
isClaimAvailable=
{
isClaimAvailable
}
>
>
{
!
hasPendingTransactions
&&
(
{
!
hasPendingTransactions
&&
<
StatusIcon
size=
{
24
}
connection=
{
connection
}
showMiniIcons=
{
false
}
/>
}
<
StatusIcon
enableInfotips=
{
true
}
size=
{
24
}
connection=
{
connection
}
showMiniIcons=
{
false
}
/>
)
}
{
hasPendingTransactions
?
(
{
hasPendingTransactions
?
(
<
RowBetween
>
<
RowBetween
>
<
Text
>
<
Text
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment