diff --git a/webapp/src/components/Modals/ConfirmRentModal/ConfirmRentModal.tsx b/webapp/src/components/Modals/ConfirmRentModal/ConfirmRentModal.tsx index 2f9ba37d4..2d0c0d859 100644 --- a/webapp/src/components/Modals/ConfirmRentModal/ConfirmRentModal.tsx +++ b/webapp/src/components/Modals/ConfirmRentModal/ConfirmRentModal.tsx @@ -62,7 +62,7 @@ const ConfirmRentModal = ({ size="small" className={styles.modal} name={t('rental_modal.confirm_rent_step.title')} - onClose={onClose} + onClose={!isLoading ? onClose : undefined} > diff --git a/webapp/src/components/Modals/RentalListingModal/AuthorizationStep/AuthorizationStep.tsx b/webapp/src/components/Modals/RentalListingModal/AuthorizationStep/AuthorizationStep.tsx index ff1e88a5b..2eab42a06 100644 --- a/webapp/src/components/Modals/RentalListingModal/AuthorizationStep/AuthorizationStep.tsx +++ b/webapp/src/components/Modals/RentalListingModal/AuthorizationStep/AuthorizationStep.tsx @@ -30,6 +30,7 @@ const AuthorizationStep = (props: Props) => { // State const [showError, setShowError] = useState(false) + const isLoading = isConfirmingAuthorization || isAuthorizing // Authorization const rentalContractData = getContract(ContractName.Rentals, nft.chainId) @@ -70,7 +71,7 @@ const AuthorizationStep = (props: Props) => { <>
@@ -133,17 +134,14 @@ const AuthorizationStep = (props: Props) => { ) : ( )} - {showError && ( diff --git a/webapp/src/components/Modals/RentalListingModal/ConfirmationStep/ConfirmationStep.tsx b/webapp/src/components/Modals/RentalListingModal/ConfirmationStep/ConfirmationStep.tsx index 6dd6911f9..6cdc52c44 100644 --- a/webapp/src/components/Modals/RentalListingModal/ConfirmationStep/ConfirmationStep.tsx +++ b/webapp/src/components/Modals/RentalListingModal/ConfirmationStep/ConfirmationStep.tsx @@ -35,7 +35,7 @@ const ConfirmationStep = (props: Props) => { <>
diff --git a/webapp/src/components/Modals/RentalListingModal/EditConfirmationStep/EditConfirmationStep.tsx b/webapp/src/components/Modals/RentalListingModal/EditConfirmationStep/EditConfirmationStep.tsx index 399cb1ad8..d8209a3ef 100644 --- a/webapp/src/components/Modals/RentalListingModal/EditConfirmationStep/EditConfirmationStep.tsx +++ b/webapp/src/components/Modals/RentalListingModal/EditConfirmationStep/EditConfirmationStep.tsx @@ -22,6 +22,10 @@ const EditConfirmationStep = (props: Props) => { const [hasTriggeredStepOne, setHasTriggeredStepOne] = useState(false) const [isStepOneCompleted, setIsStepOneCompleted] = useState(false) + const isLoading = + isSubmittingRemoveTransaction || + isRemoveTransactionBeingConfirmed || + isSigning useEffect(() => { if (isRemoveTransactionBeingConfirmed) { @@ -59,7 +63,7 @@ const EditConfirmationStep = (props: Props) => { <>
diff --git a/webapp/src/components/Modals/RentalListingModal/RentalListingModal.tsx b/webapp/src/components/Modals/RentalListingModal/RentalListingModal.tsx index f45e24957..e4b02a732 100644 --- a/webapp/src/components/Modals/RentalListingModal/RentalListingModal.tsx +++ b/webapp/src/components/Modals/RentalListingModal/RentalListingModal.tsx @@ -77,7 +77,7 @@ const RentalListingModal = (props: Props) => { styles.modal, isConfirmingEditingStep && styles.editingModal )} - onClose={onClose} + onClose={() => undefined} > {!isAuthorized ? ( diff --git a/webapp/src/components/Modals/SubmitTransactionModal/SubmitTransactionModal.tsx b/webapp/src/components/Modals/SubmitTransactionModal/SubmitTransactionModal.tsx index 6a3eb43ca..21e5fcd6b 100644 --- a/webapp/src/components/Modals/SubmitTransactionModal/SubmitTransactionModal.tsx +++ b/webapp/src/components/Modals/SubmitTransactionModal/SubmitTransactionModal.tsx @@ -21,11 +21,7 @@ const SubmitTransactionModal = ({ const isLoading = isTransactionBeingConfirmed || isSubmittingTransaction return ( - undefined : onClose} - > + {children} diff --git a/webapp/src/components/Modals/TestModal/TestModal.container.ts b/webapp/src/components/Modals/TestModal/TestModal.container.ts deleted file mode 100644 index a44070222..000000000 --- a/webapp/src/components/Modals/TestModal/TestModal.container.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { connect } from 'react-redux' -import { Dispatch } from 'redux' -import { getAddress } from 'decentraland-dapps/dist/modules/wallet/selectors' -import { MapStateProps, MapDispatchProps } from './TestModal.types' -import TestModal from './TestModal' -import { RootState } from '../../../modules/reducer' -import { closeModal } from '../../../modules/modal/actions' - -const mapState = (state: RootState): MapStateProps => { - return { - address: getAddress(state) || '0xUnD3f1n3D' - } -} - -const mapDispatch = (dispatch: Dispatch): MapDispatchProps => { - return { - onConfirm: () => dispatch(closeModal('TestModal')) - } -} - -export default connect(mapState, mapDispatch)(TestModal) diff --git a/webapp/src/components/Modals/TestModal/TestModal.tsx b/webapp/src/components/Modals/TestModal/TestModal.tsx deleted file mode 100644 index d5b7276e1..000000000 --- a/webapp/src/components/Modals/TestModal/TestModal.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react' -import { Button, ModalNavigation } from 'decentraland-ui' -import { Modal } from 'decentraland-dapps/dist/containers' -import { t } from 'decentraland-dapps/dist/modules/translation/utils' -import { Props } from './TestModal.types' - -const TestModal = ({ name, metadata, address, onConfirm, onClose }: Props) => { - const { title, subtitle } = metadata - - return ( - - - -

- This modal is just for checking that the modals module was implemented - correctly, it should be deleted on the future or just kept to copy - paste new modals. -

-

Address of the connected user: {address}

-

Metadata title: {title}

-

Metadata subtitle: {subtitle}

-
- - - - -
- ) -} - -export default React.memo(TestModal) diff --git a/webapp/src/components/Modals/TestModal/TestModal.types.ts b/webapp/src/components/Modals/TestModal/TestModal.types.ts deleted file mode 100644 index fff407094..000000000 --- a/webapp/src/components/Modals/TestModal/TestModal.types.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ModalProps } from 'decentraland-dapps/dist/providers/ModalProvider/ModalProvider.types' - -export type Metadata = { - title: string - subtitle: string -} - -export type Props = Omit & { - address: string - metadata: Metadata - onConfirm: () => void -} - -export type MapStateProps = Pick -export type MapDispatchProps = Pick diff --git a/webapp/src/components/Modals/TestModal/index.ts b/webapp/src/components/Modals/TestModal/index.ts deleted file mode 100644 index 25940a9d2..000000000 --- a/webapp/src/components/Modals/TestModal/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import TestModal from './TestModal.container' - -export default TestModal diff --git a/webapp/src/components/Modals/index.ts b/webapp/src/components/Modals/index.ts index c34ccd97a..f69cdf111 100644 --- a/webapp/src/components/Modals/index.ts +++ b/webapp/src/components/Modals/index.ts @@ -1,4 +1,3 @@ -export { default as TestModal } from './TestModal' export { ClaimLandModal } from './ClaimLandModal' export { RemoveRentalModal } from './RemoveRentalModal' export { RentalListingModal } from './RentalListingModal'