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
810f4213
Unverified
Commit
810f4213
authored
Apr 11, 2023
by
eddie
Committed by
GitHub
Apr 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: auto-dismiss MP bottom sheet after Buy Crypto click (#6298)
parent
07b7d7f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
wallet-dropdown.test.ts
cypress/e2e/wallet-dropdown.test.ts
+8
-0
AuthenticatedHeader.tsx
src/components/AccountDrawer/AuthenticatedHeader.tsx
+3
-1
No files found.
cypress/e2e/wallet-dropdown.test.ts
View file @
810f4213
...
...
@@ -78,6 +78,14 @@ describe('Wallet Dropdown', () => {
cy
.
get
(
getTestSelector
(
'
wallet-header
'
)).
should
(
'
have.css
'
,
'
color
'
,
'
rgb(119, 128, 160)
'
)
})
it
(
'
should dismiss the wallet bottom sheet when clicking buy crypto
'
,
()
=>
{
visit
(
false
)
cy
.
viewport
(
'
iphone-6
'
)
cy
.
get
(
getTestSelector
(
'
web3-status-connected
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
wallet-buy-crypto
'
)).
click
()
cy
.
contains
(
'
Buy crypto
'
).
should
(
'
not.be.visible
'
)
})
it
(
'
should use a bottom sheet and dismiss when on a mobile screen size
'
,
()
=>
{
visit
(
true
)
cy
.
viewport
(
'
iphone-6
'
)
...
...
src/components/AccountDrawer/AuthenticatedHeader.tsx
View file @
810f4213
...
...
@@ -197,9 +197,10 @@ export default function AuthenticatedHeader({ account, openSettings }: { account
const
openFiatOnrampModal
=
useOpenModal
(
ApplicationModal
.
FIAT_ONRAMP
)
const
openFoRModalWithAnalytics
=
useCallback
(()
=>
{
toggleWalletDrawer
()
sendAnalyticsEvent
(
InterfaceEventName
.
FIAT_ONRAMP_WIDGET_OPENED
)
openFiatOnrampModal
()
},
[
openFiatOnrampModal
])
},
[
openFiatOnrampModal
,
toggleWalletDrawer
])
const
[
shouldCheck
,
setShouldCheck
]
=
useState
(
false
)
const
{
...
...
@@ -302,6 +303,7 @@ export default function AuthenticatedHeader({ account, openSettings }: { account
emphasis=
{
ButtonEmphasis
.
medium
}
onClick=
{
handleBuyCryptoClick
}
disabled=
{
disableBuyCryptoButton
}
data
-
testid=
"wallet-buy-crypto"
>
{
error
?
(
<
ThemedText
.
BodyPrimary
>
{
error
}
</
ThemedText
.
BodyPrimary
>
...
...
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