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
1c2842e5
Commit
1c2842e5
authored
Dec 19, 2022
by
Jordan Frankfurt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: analytics account dropdown click
parent
841ea7f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
index.tsx
src/components/Web3Status/index.tsx
+9
-6
No files found.
src/components/Web3Status/index.tsx
View file @
1c2842e5
import
{
Trans
}
from
'
@lingui/macro
'
import
{
TraceEvent
}
from
'
@uniswap/analytics
'
import
{
sendAnalyticsEvent
,
TraceEvent
}
from
'
@uniswap/analytics
'
import
{
BrowserEvent
,
ElementName
,
EventName
}
from
'
@uniswap/analytics-events
'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
FiatOnrampAnnouncement
}
from
'
components/FiatOnrampAnnouncement
'
...
...
@@ -10,7 +10,7 @@ import { Portal } from 'nft/components/common/Portal'
import
{
useIsNftClaimAvailable
}
from
'
nft/hooks/useIsNftClaimAvailable
'
import
{
getIsValidSwapQuote
}
from
'
pages/Swap
'
import
{
darken
}
from
'
polished
'
import
{
useMemo
,
useRef
}
from
'
react
'
import
{
use
Callback
,
use
Memo
,
useRef
}
from
'
react
'
import
{
AlertTriangle
,
ChevronDown
,
ChevronUp
}
from
'
react-feather
'
import
{
useAppSelector
}
from
'
state/hooks
'
import
{
useDerivedSwapInfo
}
from
'
state/swap/hooks
'
...
...
@@ -206,6 +206,10 @@ function Web3StatusInner() {
const
validSwapQuote
=
getIsValidSwapQuote
(
trade
,
tradeState
,
swapInputError
)
const
theme
=
useTheme
()
const
toggleWalletDropdown
=
useToggleWalletDropdown
()
const
handleWalletDropdownClick
=
useCallback
(()
=>
{
sendAnalyticsEvent
(
'
FOR Account Dropdown Button Clicks
'
)
toggleWalletDropdown
()
},
[
toggleWalletDropdown
])
const
toggleWalletModal
=
useToggleWalletModal
()
const
walletIsOpen
=
useModalIsOpen
(
ApplicationModal
.
WALLET_DROPDOWN
)
const
isClaimAvailable
=
useIsNftClaimAvailable
((
state
)
=>
state
.
isClaimAvailable
)
...
...
@@ -222,13 +226,12 @@ function Web3StatusInner() {
const
pending
=
sortedRecentTransactions
.
filter
((
tx
)
=>
!
tx
.
receipt
).
map
((
tx
)
=>
tx
.
hash
)
const
hasPendingTransactions
=
!!
pending
.
length
const
toggleWallet
=
toggleWalletDropdown
if
(
!
chainId
)
{
return
null
}
else
if
(
error
)
{
return
(
<
Web3StatusError
onClick=
{
toggleWallet
}
>
<
Web3StatusError
onClick=
{
handleWalletDropdownClick
}
>
<
NetworkIcon
/>
<
Text
>
<
Trans
>
Error
</
Trans
>
...
...
@@ -244,7 +247,7 @@ function Web3StatusInner() {
return
(
<
Web3StatusConnected
data
-
testid=
"web3-status-connected"
onClick=
{
toggleWallet
}
onClick=
{
handleWalletDropdownClick
}
pending=
{
hasPendingTransactions
}
isClaimAvailable=
{
isClaimAvailable
}
>
...
...
@@ -282,7 +285,7 @@ function Web3StatusInner() {
<
Trans
>
Connect
</
Trans
>
</
StyledConnectButton
>
<
VerticalDivider
/>
<
ChevronWrapper
onClick=
{
toggleWalletDropdown
}
data
-
testid=
"navbar-toggle-dropdown"
>
<
ChevronWrapper
onClick=
{
handleWalletDropdownClick
}
data
-
testid=
"navbar-toggle-dropdown"
>
{
walletIsOpen
?
<
ChevronUp
{
...
chevronProps
}
/>
:
<
ChevronDown
{
...
chevronProps
}
/>
}
</
ChevronWrapper
>
</
Web3StatusConnectWrapper
>
...
...
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