diff --git a/src/components/DaoCreator/StepWrapper.tsx b/src/components/DaoCreator/StepWrapper.tsx index 82faffb0c9..ba9f45aa06 100644 --- a/src/components/DaoCreator/StepWrapper.tsx +++ b/src/components/DaoCreator/StepWrapper.tsx @@ -6,6 +6,7 @@ import { useNavigate } from 'react-router-dom'; import { BACKGROUND_SEMI_TRANSPARENT } from '../../constants/common'; import { BASE_ROUTES, DAO_ROUTES } from '../../constants/routes'; import { useFractal } from '../../providers/App/AppProvider'; +import { useNetworkConfig } from '../../providers/NetworkConfig/NetworkConfigProvider'; import PageHeader from '../ui/page/Header/PageHeader'; import { DAOCreateMode } from './formComponents/EstablishEssentials'; @@ -27,8 +28,9 @@ export function StepWrapper({ shouldWrapChildren = true, }: IStepWrapper) { const { - node: { daoAddress, daoNetwork }, + node: { daoAddress }, } = useFractal(); + const { addressPrefix } = useNetworkConfig(); const { t } = useTranslation(['daoCreate']); const navigate = useNavigate(); @@ -64,9 +66,9 @@ export function StepWrapper({ isButtonDisabled={isFormSubmitting} buttonClick={() => navigate( - !isSubDAO || !daoAddress || !daoNetwork + !isSubDAO || !daoAddress ? BASE_ROUTES.landing - : DAO_ROUTES.dao.relative(daoNetwork, daoAddress), + : DAO_ROUTES.dao.relative(addressPrefix, daoAddress), ) } /> diff --git a/src/components/ProposalTemplates/ProposalTemplateCard.tsx b/src/components/ProposalTemplates/ProposalTemplateCard.tsx index 493fb09943..d8b27a2098 100644 --- a/src/components/ProposalTemplates/ProposalTemplateCard.tsx +++ b/src/components/ProposalTemplates/ProposalTemplateCard.tsx @@ -7,6 +7,7 @@ import { DAO_ROUTES } from '../../constants/routes'; import useRemoveProposalTemplate from '../../hooks/DAO/proposal/useRemoveProposalTemplate'; import useSubmitProposal from '../../hooks/DAO/proposal/useSubmitProposal'; import { useFractal } from '../../providers/App/AppProvider'; +import { useNetworkConfig } from '../../providers/NetworkConfig/NetworkConfigProvider'; import { ProposalTemplate } from '../../types/createProposalTemplate'; import ContentBox from '../ui/containers/ContentBox'; import { OptionMenu } from '../ui/menus/OptionMenu'; @@ -26,8 +27,9 @@ export default function ProposalTemplateCard({ const navigate = useNavigate(); const { t } = useTranslation('proposalTemplate'); const { - node: { safe, daoAddress, daoNetwork }, + node: { safe, daoAddress }, } = useFractal(); + const { addressPrefix } = useNetworkConfig(); const { prepareRemoveProposalTemplateProposal } = useRemoveProposalTemplate(); const { submitProposal, canUserCreateProposal } = useSubmitProposal(); @@ -42,11 +44,11 @@ export default function ProposalTemplateCard({ }); const successCallback = useCallback(() => { - if (daoAddress && daoNetwork) { + if (daoAddress) { // Redirecting to proposals page so that user will see Proposal for Proposal Template creation - navigate(DAO_ROUTES.proposals.relative(daoNetwork, daoAddress)); + navigate(DAO_ROUTES.proposals.relative(addressPrefix, daoAddress)); } - }, [navigate, daoAddress, daoNetwork]); + }, [navigate, daoAddress, addressPrefix]); const nonce = safe?.nonce; const handleRemoveTemplate = useCallback(async () => { diff --git a/src/components/ProposalTemplates/index.tsx b/src/components/ProposalTemplates/index.tsx index 7cf24fa072..7776bf1538 100644 --- a/src/components/ProposalTemplates/index.tsx +++ b/src/components/ProposalTemplates/index.tsx @@ -4,6 +4,7 @@ import { Link } from 'react-router-dom'; import { DAO_ROUTES } from '../../constants/routes'; import useSubmitProposal from '../../hooks/DAO/proposal/useSubmitProposal'; import { useFractal } from '../../providers/App/AppProvider'; +import { useNetworkConfig } from '../../providers/NetworkConfig/NetworkConfigProvider'; import { EmptyBox } from '../ui/containers/EmptyBox'; import { InfoBoxLoader } from '../ui/loaders/InfoBoxLoader'; import ProposalTemplateCard from './ProposalTemplateCard'; @@ -11,9 +12,10 @@ import ProposalTemplateCard from './ProposalTemplateCard'; export default function ProposalTemplates() { const { t } = useTranslation('proposalTemplate'); const { - node: { daoAddress, daoNetwork }, + node: { daoAddress }, governance: { proposalTemplates }, } = useFractal(); + const { addressPrefix } = useNetworkConfig(); const { canUserCreateProposal } = useSubmitProposal(); return ( @@ -36,8 +38,8 @@ export default function ProposalTemplates() { )) ) : ( - {canUserCreateProposal && daoNetwork && daoAddress && ( - + {canUserCreateProposal && daoAddress && ( + )} - {canUserCreateProposal && daoNetwork && daoAddress && ( - + {canUserCreateProposal && daoAddress && ( +