diff --git a/src/components/ProposalBuilder/ProposalDetails.tsx b/src/components/ProposalBuilder/ProposalDetails.tsx index 204810055..d94600867 100644 --- a/src/components/ProposalBuilder/ProposalDetails.tsx +++ b/src/components/ProposalBuilder/ProposalDetails.tsx @@ -25,7 +25,7 @@ export function TransactionValueContainer({ children }: PropsWithChildren<{}>) { ); } -export default function ProposalTemplateDetails({ +export default function ProposalDetails({ values, mode, }: FormikProps & { mode: ProposalBuilderMode }) { diff --git a/src/components/ProposalBuilder/ProposalStream.tsx b/src/components/ProposalBuilder/ProposalStream.tsx index fa7c3e223..9f92f2c00 100644 --- a/src/components/ProposalBuilder/ProposalStream.tsx +++ b/src/components/ProposalBuilder/ProposalStream.tsx @@ -18,25 +18,13 @@ import { useTranslation } from 'react-i18next'; import { erc20Abi, formatUnits, getContract, isAddress } from 'viem'; import { usePublicClient } from 'wagmi'; import { useDaoInfoStore } from '../../store/daoInfo/useDaoInfoStore'; -import { Stream, Tranche } from '../../types/proposalBuilder'; +import { Stream } from '../../types/proposalBuilder'; import { scrollToBottom } from '../../utils/ui'; import { BigIntInput } from '../ui/forms/BigIntInput'; import ExampleLabel from '../ui/forms/ExampleLabel'; import { InputComponent, LabelComponent } from '../ui/forms/InputComponent'; import CeleryButtonWithIcon from '../ui/utils/CeleryButtonWithIcon'; - -const SECONDS_IN_DAY = 60 * 60 * 24; - -export const DEFAULT_TRANCHE: Tranche = { - amount: { - value: '0', - bigintValue: 0n, - }, - duration: { - value: (SECONDS_IN_DAY * 14).toString(), - bigintValue: BigInt(SECONDS_IN_DAY * 14), - }, -}; +import { DEFAULT_TRANCHE, SECONDS_IN_DAY } from './constants'; export function ProposalStream({ stream, diff --git a/src/components/ProposalBuilder/ProposalStreams.tsx b/src/components/ProposalBuilder/ProposalStreams.tsx index 1194513ac..790584759 100644 --- a/src/components/ProposalBuilder/ProposalStreams.tsx +++ b/src/components/ProposalBuilder/ProposalStreams.tsx @@ -14,21 +14,8 @@ import { useTranslation } from 'react-i18next'; import { Stream } from '../../types/proposalBuilder'; import { scrollToBottom } from '../../utils/ui'; import CeleryButtonWithIcon from '../ui/utils/CeleryButtonWithIcon'; -import { DEFAULT_TRANCHE, ProposalStream } from './ProposalStream'; - -const DEFAULT_STREAM: Stream = { - type: 'tranched', - tokenAddress: '', - recipientAddress: '', - startDate: new Date(), - tranches: [DEFAULT_TRANCHE], - totalAmount: { - value: '0', - bigintValue: 0n, - }, - cancelable: true, - transferable: false, -}; +import { ProposalStream } from './ProposalStream'; +import { DEFAULT_STREAM } from './constants'; export function ProposalStreams({ pendingTransaction, diff --git a/src/components/ProposalBuilder/StepButtons.tsx b/src/components/ProposalBuilder/StepButtons.tsx index 274cbae5d..cb3e2bd01 100644 --- a/src/components/ProposalBuilder/StepButtons.tsx +++ b/src/components/ProposalBuilder/StepButtons.tsx @@ -36,8 +36,8 @@ export default function StepButtons(props: StepButtonsProps) { } // @dev these prevStepUrl and nextStepUrl calculation is done this way to universally build URL for the next/prev steps both for proposal builder and proposal template builder - const prevStepUrl = `${location.pathname.replace(`${CreateProposalSteps.TRANSACTIONS}`, `${CreateProposalSteps.METADATA}`)}${location.search}`; - const nextStepUrl = `${location.pathname.replace(`${CreateProposalSteps.METADATA}`, `${CreateProposalSteps.TRANSACTIONS}`)}${location.search}`; + const prevStepUrl = `${location.pathname.replace(`${mode === ProposalBuilderMode.SABLIER ? CreateProposalSteps.STREAMS : CreateProposalSteps.TRANSACTIONS}`, `${CreateProposalSteps.METADATA}`)}${location.search}`; + const nextStepUrl = `${location.pathname.replace(`${CreateProposalSteps.METADATA}`, `${mode === ProposalBuilderMode.SABLIER ? CreateProposalSteps.STREAMS : CreateProposalSteps.TRANSACTIONS}`)}${location.search}`; return (