From 7d2e56f20c191e45cf778ac8081f9dbc00a8d8d2 Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Wed, 4 Dec 2024 23:07:47 -0500 Subject: [PATCH] Refactor RoleFormCreateProposal layout and simplify SafeRolesEditProposalSummaryPage structure --- .../Roles/forms/RoleFormCreateProposal.tsx | 3 +- .../SafeRolesEditProposalSummaryPage.tsx | 94 ++++--------------- 2 files changed, 21 insertions(+), 76 deletions(-) diff --git a/src/components/Roles/forms/RoleFormCreateProposal.tsx b/src/components/Roles/forms/RoleFormCreateProposal.tsx index 97a91d619..8c19af9c5 100644 --- a/src/components/Roles/forms/RoleFormCreateProposal.tsx +++ b/src/components/Roles/forms/RoleFormCreateProposal.tsx @@ -132,13 +132,12 @@ export function RoleFormCreateProposal({ close }: { close: () => void }) { }; return ( - + diff --git a/src/pages/dao/roles/edit/summary/SafeRolesEditProposalSummaryPage.tsx b/src/pages/dao/roles/edit/summary/SafeRolesEditProposalSummaryPage.tsx index 3ab44699b..f3da8732d 100644 --- a/src/pages/dao/roles/edit/summary/SafeRolesEditProposalSummaryPage.tsx +++ b/src/pages/dao/roles/edit/summary/SafeRolesEditProposalSummaryPage.tsx @@ -1,19 +1,17 @@ -import { Box, Flex, Icon, Portal, Show, Text } from '@chakra-ui/react'; -import { ArrowLeft } from '@phosphor-icons/react'; +import { Box, Flex } from '@chakra-ui/react'; import { useFormikContext } from 'formik'; import { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import { RoleFormCreateProposal } from '../../../../../components/Roles/forms/RoleFormCreateProposal'; import PageHeader from '../../../../../components/ui/page/Header/PageHeader'; -import { SIDEBAR_WIDTH, useFooterHeight, useHeaderHeight } from '../../../../../constants/common'; +import { CONTENT_MAXW } from '../../../../../constants/common'; import { DAO_ROUTES } from '../../../../../constants/routes'; import { useNetworkConfig } from '../../../../../providers/NetworkConfig/NetworkConfigProvider'; import { useDaoInfoStore } from '../../../../../store/daoInfo/useDaoInfoStore'; import { RoleFormValues } from '../../../../../types/roles'; export function SafeRolesEditProposalSummaryPage() { - const headerHeight = useHeaderHeight(); const navigate = useNavigate(); const { safe } = useDaoInfoStore(); const { t } = useTranslation(['roles', 'breadcrumbs']); @@ -22,8 +20,6 @@ export function SafeRolesEditProposalSummaryPage() { const safeAddress = safe?.address; - const footerHeight = useFooterHeight(); - // @dev redirects back to roles edit page if no roles are edited (user refresh) useEffect(() => { const editedRoles = values.hats.filter(hat => !!hat.editedRole); @@ -35,74 +31,24 @@ export function SafeRolesEditProposalSummaryPage() { if (!safeAddress) return null; return ( - - - - - - { - navigate(DAO_ROUTES.rolesEdit.relative(addressPrefix, safeAddress)); - }} - > - - {t('proposalNew', { ns: 'breadcrumbs' })} - - - navigate(DAO_ROUTES.rolesEdit.relative(addressPrefix, safeAddress))} - /> - - - - - - - - navigate(DAO_ROUTES.rolesEdit.relative(addressPrefix, safeAddress))} - /> - - - + + + + navigate(DAO_ROUTES.rolesEdit.relative(addressPrefix, safeAddress))} + /> + ); }