Skip to content

Commit

Permalink
wraethdao/jb-717-close-button-on-create-modal-doesnt-work (#4045)
Browse files Browse the repository at this point in the history
## What does this PR do and why?

Closes [JB-717 : Close button on create modal doesnt work](https://linear.app/peel/issue/JB-717/close-button-on-create-modal-doesnt-work)

## Screenshots or screen recordings

_If applicable, provide screenshots or screen recordings to demonstrate the changes._

## Acceptance checklist

- [ ] I have evaluated the [Approval Guidelines](https://github.com/jbx-protocol/juice-interface/blob/main/CONTRIBUTING.md#approval-guidelines) for this PR.
- [ ] (if relevant) I have tested this PR in [all supported browsers](https://github.com/jbx-protocol/juice-interface/blob/main/CONTRIBUTING.md#supported-browsers).
- [ ] (if relevant) I have tested this PR in dark mode and light mode (if applicable).
  • Loading branch information
wraeth-eth authored Aug 31, 2023
1 parent 02eb12e commit afe57a5
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { Checkbox, Form } from 'antd'
import { Callout } from 'components/Callout'
import { useDeployProject } from 'components/Create/hooks/DeployProject'
import ExternalLink from 'components/ExternalLink'
import TransactionModal from 'components/modals/TransactionModal'
import { emitConfirmationDeletionModal } from 'components/ProjectDashboard/utils/modals'
import TransactionModal from 'components/modals/TransactionModal'
import { TERMS_OF_SERVICE_URL } from 'constants/links'
import { useWallet } from 'hooks/Wallet'
import useMobile from 'hooks/useMobile'
import { useModal } from 'hooks/useModal'
import { useWallet } from 'hooks/Wallet'
import { useRouter } from 'next/router'
import { useCallback, useContext, useEffect, useMemo, useState } from 'react'
import { useDispatch } from 'react-redux'
Expand Down Expand Up @@ -63,7 +63,7 @@ export const ReviewDeployPage = () => {
const router = useRouter()
const [form] = Form.useForm<{ termsAccepted: boolean }>()
const termsAccepted = Form.useWatch('termsAccepted', form)
const modal = useModal()
const transactionModal = useModal()
const { deployProject, isDeploying, deployTransactionPending } =
useDeployProject()
const nftRewards = useAppSelector(
Expand All @@ -80,9 +80,8 @@ export const ReviewDeployPage = () => {
const handleStartOverClicked = useCallback(() => {
router.push('/create')
goToPage?.('projectDetails')
modal.close()
dispatch(editingV2ProjectActions.resetState())
}, [dispatch, goToPage, modal, router])
}, [dispatch, goToPage, router])

const onFinish = useCallback(async () => {
if (chainUnsupported) {
Expand All @@ -94,11 +93,14 @@ export const ReviewDeployPage = () => {
return
}

transactionModal.open()
await deployProject({
onProjectDeployed: deployedProjectId =>
onProjectDeployed: deployedProjectId => {
router.push({ query: { deployedProjectId } }, '/create', {
shallow: true,
}),
})
transactionModal.close()
},
})
}, [
chainUnsupported,
Expand All @@ -107,6 +109,7 @@ export const ReviewDeployPage = () => {
deployProject,
isConnected,
router,
transactionModal,
])

const [activeKey, setActiveKey] = useState<ReviewDeployKey[]>(
Expand Down Expand Up @@ -248,7 +251,8 @@ export const ReviewDeployPage = () => {
</div>
<TransactionModal
transactionPending={deployTransactionPending}
open={deployTransactionPending}
open={deployTransactionPending && transactionModal.visible}
onCancel={transactionModal.close}
/>
</>
)
Expand Down

0 comments on commit afe57a5

Please sign in to comment.