diff --git a/src/components/Create/components/RewardsList/AddEditRewardModal.tsx b/src/components/Create/components/RewardsList/AddEditRewardModal.tsx index 9070bedd72..743dd0b64b 100644 --- a/src/components/Create/components/RewardsList/AddEditRewardModal.tsx +++ b/src/components/Create/components/RewardsList/AddEditRewardModal.tsx @@ -41,7 +41,12 @@ interface AddEditRewardModalFormProps { externalUrl?: string | undefined } -const NFT_FILE_UPLOAD_EXTRA = t`Images will be cropped to a 1:1 square in thumbnail previews on the Juicebox app.` +const NFT_FILE_UPLOAD_EXTRA = ( + + Images will be cropped to a 1:1 square in thumbnail previews on the Juicebox + app. + +) const MAX_NFT_FILE_SIZE_MB = 100 // This assumes an existing NFT ID (from the contracts) will never be >= 1000000 diff --git a/src/components/v2v3/V2V3Project/V2V3ProjectSettings/pages/NewEditCyclePage/ReviewConfirmModal/EditCycleSuccessModal.tsx b/src/components/v2v3/V2V3Project/V2V3ProjectSettings/TransactionSuccessModal.tsx similarity index 80% rename from src/components/v2v3/V2V3Project/V2V3ProjectSettings/pages/NewEditCyclePage/ReviewConfirmModal/EditCycleSuccessModal.tsx rename to src/components/v2v3/V2V3Project/V2V3ProjectSettings/TransactionSuccessModal.tsx index be82f46cb7..697e312cac 100644 --- a/src/components/v2v3/V2V3Project/V2V3ProjectSettings/pages/NewEditCyclePage/ReviewConfirmModal/EditCycleSuccessModal.tsx +++ b/src/components/v2v3/V2V3Project/V2V3ProjectSettings/TransactionSuccessModal.tsx @@ -4,15 +4,17 @@ import { Button, Modal } from 'antd' import { ProjectMetadataContext } from 'contexts/shared/ProjectMetadataContext' import { V2V3ProjectContext } from 'contexts/v2v3/Project/V2V3ProjectContext' import Link from 'next/link' -import { useContext } from 'react' +import { ReactNode, useContext } from 'react' import { settingsPagePath, v2v3ProjectRoute } from 'utils/routes' -export function EditCycleSuccessModal({ +export function TransactionSuccessModal({ open, onClose, + content, }: { open: boolean onClose: VoidFunction + content: ReactNode }) { const { projectId } = useContext(ProjectMetadataContext) const { handle } = useContext(V2V3ProjectContext) @@ -35,15 +37,7 @@ export function EditCycleSuccessModal({ >
{checkIconWithBackground} -
- Your updated cycle has been deployed -
-
- - Changes will take effect in your next cycle as long as it starts - after your edit deadline. - -
+ {content}
+ <> + + + setSuccessModalOpen(false)} + content={ + <> +
+ Your new NFTs have been deployed +
+
+ + New NFTs will be available in your next cycle as long as it + starts after your edit deadline. + +
+ + } + /> + ) } diff --git a/src/components/v2v3/V2V3Project/V2V3ProjectSettings/pages/ReconfigureFundingCycleSettingsPage/hooks/useReconfigureFundingCycle.ts b/src/components/v2v3/V2V3Project/V2V3ProjectSettings/pages/ReconfigureFundingCycleSettingsPage/hooks/useReconfigureFundingCycle.ts index d1ced0c89a..8c098da370 100644 --- a/src/components/v2v3/V2V3Project/V2V3ProjectSettings/pages/ReconfigureFundingCycleSettingsPage/hooks/useReconfigureFundingCycle.ts +++ b/src/components/v2v3/V2V3Project/V2V3ProjectSettings/pages/ReconfigureFundingCycleSettingsPage/hooks/useReconfigureFundingCycle.ts @@ -60,6 +60,7 @@ export const useReconfigureFundingCycle = ({ const [reconfigureTxLoading, setReconfigureTxLoading] = useState(false) + const [txPending, setTxPending] = useState(false) const reconfigureV2V3FundingCycleTx = useReconfigureV2V3FundingCycleTx() const reconfigureV2V3FundingCycleWithNftsTx = @@ -120,6 +121,9 @@ export const useReconfigureFundingCycle = ({ } const txOpts = { + onDone() { + setTxPending(true) + }, async onConfirmed() { if (projectId) { await revalidateProject({ @@ -128,14 +132,20 @@ export const useReconfigureFundingCycle = ({ }) } setReconfigureTxLoading(false) + setTxPending(false) if (onComplete) { onComplete() } else { reloadWindow() } }, + onCancelled() { + setTxPending(false) + }, + onError() { + setTxPending(false) + }, } - let txSuccessful: boolean if (launchedNewNfts && editingNftRewards?.rewardTiers) { txSuccessful = await reconfigureV2V3FundingCycleWithNftsTx( @@ -154,6 +164,7 @@ export const useReconfigureFundingCycle = ({ if (!txSuccessful) { setReconfigureTxLoading(false) + setTxPending(false) } }, [ @@ -169,5 +180,9 @@ export const useReconfigureFundingCycle = ({ ], ) - return { reconfigureLoading: reconfigureTxLoading, reconfigureFundingCycle } + return { + reconfigureLoading: reconfigureTxLoading, + reconfigureFundingCycle, + txPending, + } } diff --git a/src/locales/messages.pot b/src/locales/messages.pot index 60d8f2429a..e0a8889dfb 100644 --- a/src/locales/messages.pot +++ b/src/locales/messages.pot @@ -782,6 +782,9 @@ msgstr "" msgid "Receive ERC-20 tokens" msgstr "" +msgid "New NFTs will be available in your next cycle as long as it starts after your edit deadline." +msgstr "" + msgid "Confirm" msgstr "" @@ -4424,6 +4427,9 @@ msgstr "" msgid "Add recipient" msgstr "" +msgid "Your new NFTs have been deployed" +msgstr "" + msgid "Your balance" msgstr ""