Commit 810f4213 authored by eddie's avatar eddie Committed by GitHub

fix: auto-dismiss MP bottom sheet after Buy Crypto click (#6298)

parent 07b7d7f2
......@@ -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')
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment