-
Notifications
You must be signed in to change notification settings - Fork 684
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add buy with crypto button to ENS detail page
- Loading branch information
1 parent
fe5d9d5
commit 4a01bb4
Showing
3 changed files
with
24 additions
and
10 deletions.
There are no files selected for viewing
14 changes: 11 additions & 3 deletions
14
webapp/src/components/AssetPage/Actions/Actions.container.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
import { connect } from 'react-redux' | ||
import { Order } from '@dcl/schemas' | ||
import { openModal } from 'decentraland-dapps/dist/modules/modal/actions' | ||
import { RootState } from '../../../modules/reducer' | ||
import { getWallet } from '../../../modules/wallet/selectors' | ||
import { getCurrentOrder } from '../../../modules/order/selectors' | ||
import { getNFTBids } from '../../../modules/ui/nft/bid/selectors' | ||
import { NFT } from '../../../modules/nft/types' | ||
import Actions from './Actions' | ||
import { MapDispatch, MapDispatchProps, MapStateProps } from './Actions.types' | ||
import { MapDispatch, MapDispatchProps, MapStateProps, OwnProps } from './Actions.types' | ||
|
||
const mapState = (state: RootState): MapStateProps => ({ | ||
wallet: getWallet(state), | ||
order: getCurrentOrder(state), | ||
bids: getNFTBids(state) | ||
}) | ||
|
||
const mapDispatch = (dispatch: MapDispatch): MapDispatchProps => ({ | ||
onLeavingSite: (nft: NFT) => dispatch(openModal('LeavingSiteModal', { nft })) | ||
const mapDispatch = (dispatch: MapDispatch, ownProps: OwnProps): MapDispatchProps => ({ | ||
onLeavingSite: (nft: NFT) => dispatch(openModal('LeavingSiteModal', { nft })), | ||
onBuyWithCrypto: (order: Order) => | ||
dispatch( | ||
openModal('BuyNftWithCryptoModal', { | ||
nft: ownProps.nft, | ||
order | ||
}) | ||
) | ||
}) | ||
|
||
export default connect(mapState, mapDispatch)(Actions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters