diff --git a/package-lock.json b/package-lock.json index b3eaecea..00f62cbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,9 +32,9 @@ "case-sensitive-paths-webpack-plugin": "2.3.0", "connected-react-router": "^6.9.1", "css-loader": "4.3.0", - "decentraland-dapps": "^13.21.0", + "decentraland-dapps": "^13.25.0", "decentraland-transactions": "^1.22.2", - "decentraland-ui": "^3.66.0", + "decentraland-ui": "^3.69.2", "dotenv": "8.2.0", "dotenv-expand": "5.1.0", "eslint": "^7.11.0", @@ -12265,9 +12265,9 @@ "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" }, "node_modules/decentraland-dapps": { - "version": "13.21.0", - "resolved": "https://registry.npmjs.org/decentraland-dapps/-/decentraland-dapps-13.21.0.tgz", - "integrity": "sha512-u6nHQ+SzU6wo+PFNSyYYWRH2gDtPvbiiEo2spVt+QSy1+/U1muqVs6OKA7nk4qWM1xyYoS1L6mguWEPyg2GReQ==", + "version": "13.25.0", + "resolved": "https://registry.npmjs.org/decentraland-dapps/-/decentraland-dapps-13.25.0.tgz", + "integrity": "sha512-9bmFw1lbZMWJneLHigjZHga5NTL0uaz5Wc3jDdnLYsS0SsSSXceXWVOAdg9sZSxUdYAIr7dBALZCXwwmuWAA6g==", "dependencies": { "@0xsequence/multicall": "^0.25.1", "@0xsequence/relayer": "^0.25.1", @@ -12281,7 +12281,7 @@ "dcl-catalyst-client": "^12.0.1", "decentraland-connect": "^3.3.2", "decentraland-transactions": "^1.35.0", - "decentraland-ui": "^3.65.0", + "decentraland-ui": "^3.69.1", "ethers": "^5.6.8", "events": "^3.3.0", "flat": "^4.1.0", @@ -12362,9 +12362,9 @@ "integrity": "sha512-rPhlk5Xt4BcEpZ8v9jh9TqgbHU4DcmrmdLf1nG3WK8OhVHglPKVGd09Ov9aoCE/v0FKBNTtIfoxzR/D2KWA6iA==" }, "node_modules/decentraland-ui": { - "version": "3.66.0", - "resolved": "https://registry.npmjs.org/decentraland-ui/-/decentraland-ui-3.66.0.tgz", - "integrity": "sha512-oKmCg9CjQYtrYuowdb7uQ8bAXkAlbJaX3XpPsghNPNSe+qW6uIaCVdE3Uk84w4E/73A371gw9/lfBwvHJ+yAFQ==", + "version": "3.69.2", + "resolved": "https://registry.npmjs.org/decentraland-ui/-/decentraland-ui-3.69.2.tgz", + "integrity": "sha512-AMQvTYprOyylCB5GI9nr7cdFqD2i1MqDyM3JcnmM+MAhk7grD+HRN3PslTe+Rf+PgIsomRhp5Y3ydgHdR9Ef/g==", "dependencies": { "@dcl/schemas": "^5.27.0", "balloon-css": "^0.5.0", @@ -12395,9 +12395,9 @@ } }, "node_modules/decentraland-ui/node_modules/@dcl/schemas": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@dcl/schemas/-/schemas-5.29.0.tgz", - "integrity": "sha512-nLGFpIa3wRqlqoBuGpJGxgwsWMcKuTuphq6pf7PPjuv6ZyveUeaklKBl77VEfQvInAexMIqtljxsfA/ISZdkkw==", + "version": "5.31.0", + "resolved": "https://registry.npmjs.org/@dcl/schemas/-/schemas-5.31.0.tgz", + "integrity": "sha512-hptlcPSUWtYgtbXaMYs/znlh1LLb2snBNJYc1u0Ng4wBs4XdpyEN1kgSAsNWUl4XmX5NSoW8t24E+fJ5BjWQIA==", "dependencies": { "ajv": "^8.11.0", "ajv-errors": "^3.0.0", @@ -42449,9 +42449,9 @@ } }, "decentraland-dapps": { - "version": "13.21.0", - "resolved": "https://registry.npmjs.org/decentraland-dapps/-/decentraland-dapps-13.21.0.tgz", - "integrity": "sha512-u6nHQ+SzU6wo+PFNSyYYWRH2gDtPvbiiEo2spVt+QSy1+/U1muqVs6OKA7nk4qWM1xyYoS1L6mguWEPyg2GReQ==", + "version": "13.25.0", + "resolved": "https://registry.npmjs.org/decentraland-dapps/-/decentraland-dapps-13.25.0.tgz", + "integrity": "sha512-9bmFw1lbZMWJneLHigjZHga5NTL0uaz5Wc3jDdnLYsS0SsSSXceXWVOAdg9sZSxUdYAIr7dBALZCXwwmuWAA6g==", "requires": { "@0xsequence/multicall": "^0.25.1", "@0xsequence/relayer": "^0.25.1", @@ -42465,7 +42465,7 @@ "dcl-catalyst-client": "^12.0.1", "decentraland-connect": "^3.3.2", "decentraland-transactions": "^1.35.0", - "decentraland-ui": "^3.65.0", + "decentraland-ui": "^3.69.1", "ethers": "^5.6.8", "events": "^3.3.0", "flat": "^4.1.0", @@ -42524,9 +42524,9 @@ "integrity": "sha512-rPhlk5Xt4BcEpZ8v9jh9TqgbHU4DcmrmdLf1nG3WK8OhVHglPKVGd09Ov9aoCE/v0FKBNTtIfoxzR/D2KWA6iA==" }, "decentraland-ui": { - "version": "3.66.0", - "resolved": "https://registry.npmjs.org/decentraland-ui/-/decentraland-ui-3.66.0.tgz", - "integrity": "sha512-oKmCg9CjQYtrYuowdb7uQ8bAXkAlbJaX3XpPsghNPNSe+qW6uIaCVdE3Uk84w4E/73A371gw9/lfBwvHJ+yAFQ==", + "version": "3.69.2", + "resolved": "https://registry.npmjs.org/decentraland-ui/-/decentraland-ui-3.69.2.tgz", + "integrity": "sha512-AMQvTYprOyylCB5GI9nr7cdFqD2i1MqDyM3JcnmM+MAhk7grD+HRN3PslTe+Rf+PgIsomRhp5Y3ydgHdR9Ef/g==", "requires": { "@dcl/schemas": "^5.27.0", "balloon-css": "^0.5.0", @@ -42545,9 +42545,9 @@ }, "dependencies": { "@dcl/schemas": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@dcl/schemas/-/schemas-5.29.0.tgz", - "integrity": "sha512-nLGFpIa3wRqlqoBuGpJGxgwsWMcKuTuphq6pf7PPjuv6ZyveUeaklKBl77VEfQvInAexMIqtljxsfA/ISZdkkw==", + "version": "5.31.0", + "resolved": "https://registry.npmjs.org/@dcl/schemas/-/schemas-5.31.0.tgz", + "integrity": "sha512-hptlcPSUWtYgtbXaMYs/znlh1LLb2snBNJYc1u0Ng4wBs4XdpyEN1kgSAsNWUl4XmX5NSoW8t24E+fJ5BjWQIA==", "requires": { "ajv": "^8.11.0", "ajv-errors": "^3.0.0", diff --git a/package.json b/package.json index c25a334c..a1f25cf6 100644 --- a/package.json +++ b/package.json @@ -27,9 +27,9 @@ "case-sensitive-paths-webpack-plugin": "2.3.0", "connected-react-router": "^6.9.1", "css-loader": "4.3.0", - "decentraland-dapps": "^13.21.0", + "decentraland-dapps": "^13.25.0", "decentraland-transactions": "^1.22.2", - "decentraland-ui": "^3.66.0", + "decentraland-ui": "^3.69.2", "dotenv": "8.2.0", "dotenv-expand": "5.1.0", "eslint": "^7.11.0", diff --git a/src/components/HomePage/AccountCard/AccountCardHeader/AccountCardHeader.container.tsx b/src/components/HomePage/AccountCard/AccountCardHeader/AccountCardHeader.container.tsx index b06f986a..0c441953 100644 --- a/src/components/HomePage/AccountCard/AccountCardHeader/AccountCardHeader.container.tsx +++ b/src/components/HomePage/AccountCard/AccountCardHeader/AccountCardHeader.container.tsx @@ -1,13 +1,15 @@ -import { getAddress } from 'decentraland-dapps/dist/modules/wallet/selectors' import { connect } from 'react-redux' +import { Network } from '@dcl/schemas' +import { getAddress } from 'decentraland-dapps/dist/modules/wallet/selectors' +import { openBuyManaWithFiatModalRequest } from 'decentraland-dapps/dist/modules/manaFiatGateway/actions' import { openModal } from '../../../../modules/modal/actions' import { RootState } from '../../../../modules/reducer' -import AccountCardHeader from './AccountCardHeader' import { MapDispatch, MapDispatchProps, MapStateProps, } from './AccountCardHeader.types' +import AccountCardHeader from './AccountCardHeader' const mapState = (state: RootState): MapStateProps => ({ address: getAddress(state), @@ -20,6 +22,8 @@ const mapDispatch = (dispatch: MapDispatch): MapDispatchProps => ({ onImportWithdrawal: () => dispatch(openModal('ImportWithdrawalModal')), onReceive: (network, address) => dispatch(openModal('ReceiveManaModal', { network, address })), + onAddTokens: (selectedNetwork: Network) => + dispatch(openBuyManaWithFiatModalRequest(selectedNetwork)), }) export default connect(mapState, mapDispatch)(AccountCardHeader) diff --git a/src/components/HomePage/AccountCard/AccountCardHeader/AccountCardHeader.tsx b/src/components/HomePage/AccountCard/AccountCardHeader/AccountCardHeader.tsx index a8660558..f7d23990 100644 --- a/src/components/HomePage/AccountCard/AccountCardHeader/AccountCardHeader.tsx +++ b/src/components/HomePage/AccountCard/AccountCardHeader/AccountCardHeader.tsx @@ -1,9 +1,8 @@ -import React, { useState } from 'react' +import React from 'react' import { Network } from '@dcl/schemas' import { Button, Dropdown, Popup } from 'decentraland-ui' import { getAnalytics } from 'decentraland-dapps/dist/modules/analytics/utils' import { t } from 'decentraland-dapps/dist/modules/translation/utils' -import BuyManaWithFiatModal from 'decentraland-dapps/dist/containers/BuyManaWithFiatModal' import { Props } from './AccountCardHeader.types' import './AccountCardHeader.css' @@ -16,12 +15,10 @@ const AccountCardHeader = ({ onReceive, onConvert, onImportWithdrawal, + onAddTokens, }: Props) => { const analytics = getAnalytics() - const [isOpenBuyManaWithFiatModal, setIsOpenBuyManaWithFiatModal] = - useState(false) - const handleTransferMana = () => onTransfer(network) const handleReceiveMana = () => { @@ -36,11 +33,7 @@ const AccountCardHeader = ({ const handleAddTokens = () => { analytics.track('Open BUY MANA modal') - setIsOpenBuyManaWithFiatModal(true) - } - - const handleCloseBuyManaWithFiatModal = () => { - setIsOpenBuyManaWithFiatModal(!isOpenBuyManaWithFiatModal) + onAddTokens(network) } const handleConvert = () => onConvert(network) @@ -53,11 +46,6 @@ const AccountCardHeader = ({ return ( <> -
diff --git a/src/components/HomePage/AccountCard/AccountCardHeader/AccountCardHeader.types.tsx b/src/components/HomePage/AccountCard/AccountCardHeader/AccountCardHeader.types.tsx index fb239752..f03aa5d2 100644 --- a/src/components/HomePage/AccountCard/AccountCardHeader/AccountCardHeader.types.tsx +++ b/src/components/HomePage/AccountCard/AccountCardHeader/AccountCardHeader.types.tsx @@ -1,7 +1,11 @@ -import { Network } from '@dcl/schemas' import { Dispatch } from 'redux' +import { Network } from '@dcl/schemas' +import { + openBuyManaWithFiatModalRequest, + OpenBuyManaWithFiatModalRequestAction, + OpenManaFiatGatewayRequestAction, +} from 'decentraland-dapps/dist/modules/manaFiatGateway/actions' import { OpenModalAction } from '../../../../modules/modal/actions' -import { OpenManaFiatGatewayRequestAction } from 'decentraland-dapps/dist/modules/manaFiatGateway/actions' export type Props = { address?: string @@ -12,13 +16,22 @@ export type Props = { onReceive: (network: Network, address: string) => void onConvert: (network: Network) => void onImportWithdrawal: () => void + onAddTokens: ( + selectedNetwork: Network + ) => ReturnType } export type MapStateProps = Pick export type MapDispatchProps = Pick< Props, - 'onTransfer' | 'onReceive' | 'onConvert' | 'onImportWithdrawal' + | 'onTransfer' + | 'onReceive' + | 'onConvert' + | 'onImportWithdrawal' + | 'onAddTokens' > export type MapDispatch = Dispatch< - OpenModalAction | OpenManaFiatGatewayRequestAction + | OpenModalAction + | OpenBuyManaWithFiatModalRequestAction + | OpenManaFiatGatewayRequestAction > diff --git a/src/components/Modals/index.ts b/src/components/Modals/index.ts index 463bf0c0..cd671fd7 100644 --- a/src/components/Modals/index.ts +++ b/src/components/Modals/index.ts @@ -1,3 +1,4 @@ +export { default as BuyManaWithFiatModal } from 'decentraland-dapps/dist/containers/BuyManaWithFiatModal' export { BuyManaWithFiatFeedbackModal } from 'decentraland-dapps/dist/containers/BuyManaWithFiatModal/BuyManaWithFiatFeedbackModal' export { default as TestModal } from './TestModal' export { default as TransactionDetailModal } from './TransactionDetailModal'