diff --git a/src/components/DaoDashboard/Activities/ProposalsHome.tsx b/src/components/DaoDashboard/Activities/ProposalsHome.tsx index 760bfd51e..e41cfcf94 100644 --- a/src/components/DaoDashboard/Activities/ProposalsHome.tsx +++ b/src/components/DaoDashboard/Activities/ProposalsHome.tsx @@ -17,6 +17,7 @@ import { SortBy, } from '../../../types'; import { ProposalsList } from '../../Proposals/ProposalsList'; +import { CreateProposalMenu } from '../../ui/menus/CreateProposalMenu'; import { OptionMenu } from '../../ui/menus/OptionMenu'; import { ModalType } from '../../ui/modals/ModalProvider'; import { useDecentModal } from '../../ui/modals/useDecentModal'; @@ -258,25 +259,19 @@ export function ProposalsHome() { {/* DELEGATE AND CREATE PROPOSAL BUTTONS (non-mobile) */} - + {canDelegate && ( )} {canUserCreateProposal && safe?.address && ( - - - + )} diff --git a/src/components/ProposalBuilder/index.tsx b/src/components/ProposalBuilder/index.tsx index 3ce691abe..410c6e713 100644 --- a/src/components/ProposalBuilder/index.tsx +++ b/src/components/ProposalBuilder/index.tsx @@ -1,5 +1,5 @@ import { Box, Flex, Grid, GridItem, Icon, Text } from '@chakra-ui/react'; -import { SquaresFour, Trash } from '@phosphor-icons/react'; +import { ArrowLeft, SquaresFour } from '@phosphor-icons/react'; import { Formik, FormikProps } from 'formik'; import { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; @@ -165,7 +165,7 @@ export function ProposalBuilder({ }, ] } - ButtonIcon={Trash} + ButtonIcon={ArrowLeft} buttonProps={{ isDisabled: pendingCreateTx, variant: 'secondary', diff --git a/src/components/ui/menus/CreateProposalMenu/index.tsx b/src/components/ui/menus/CreateProposalMenu/index.tsx new file mode 100644 index 000000000..b072a51e8 --- /dev/null +++ b/src/components/ui/menus/CreateProposalMenu/index.tsx @@ -0,0 +1,129 @@ +import { + Box, + Button, + Divider, + Flex, + Icon, + Menu, + MenuButton, + MenuItem, + MenuList, + Text, +} from '@chakra-ui/react'; +import { CaretDown } from '@phosphor-icons/react'; +import { Fragment } from 'react'; +import { useTranslation } from 'react-i18next'; +import { useNavigate } from 'react-router-dom'; +import { Address } from 'viem'; +import { NEUTRAL_2_82_TRANSPARENT } from '../../../../constants/common'; +import { DAO_ROUTES } from '../../../../constants/routes'; +import { useNetworkConfig } from '../../../../providers/NetworkConfig/NetworkConfigProvider'; +import { EaseOutComponent } from '../../utils/EaseOutComponent'; + +export function CreateProposalMenu({ safeAddress }: { safeAddress: Address }) { + const { t } = useTranslation('proposal'); + + const { addressPrefix } = useNetworkConfig(); + + const navigate = useNavigate(); + + return ( + + + {({ isOpen }) => ( + + + + {t('createProposal')} + + + + {isOpen && ( + + + + + + navigate(DAO_ROUTES.proposalNew.relative(addressPrefix, safeAddress)) + } + noOfLines={1} + display="flex" + alignItems="center" + justifyContent="flex-start" + rounded="0.75rem" + gap={2} + > + + {t('createFromScratch')} + + + + + + + navigate( + DAO_ROUTES.proposalTemplates.relative(addressPrefix, safeAddress), + ) + } + noOfLines={1} + display="flex" + alignItems="center" + justifyContent="flex-start" + rounded="0.75rem" + gap={2} + > + + {t('browseTemplates')} + + + + + + + )} + + )} + + + ); +} diff --git a/src/i18n/locales/en/breadcrumbs.json b/src/i18n/locales/en/breadcrumbs.json index 248c92c47..64b9da886 100644 --- a/src/i18n/locales/en/breadcrumbs.json +++ b/src/i18n/locales/en/breadcrumbs.json @@ -8,7 +8,7 @@ "proposal": "#{{proposalId}} {{proposalTitle}}", "proposalTemplates": "Proposal Templates", "proposalTemplate": "{{proposalTemplateTitle}}", - "proposalTemplateNew": "New Proposal Template", + "proposalTemplateNew": "Create Proposal Template", "modifyGovernance": "Modify Governance", "parentLink": "Parent-Safe", "settings": "Settings" diff --git a/src/i18n/locales/en/proposal.json b/src/i18n/locales/en/proposal.json index 388612f6e..c051bc478 100644 --- a/src/i18n/locales/en/proposal.json +++ b/src/i18n/locales/en/proposal.json @@ -142,5 +142,7 @@ "clawBackEmptyTransactionsError": "Failed to process clawback - child Safe has no safely transferrable tokens", "pendingProposalNotice": "Pending proposal still processing", "metadataFailedParsePlaceholder": "Unknown - Failed to parse metadata", - "multisigNonceDuplicateErrorMessage": "Transaction with the same nonce already exists" + "multisigNonceDuplicateErrorMessage": "Transaction with the same nonce already exists", + "createFromScratch": "Create from scratch", + "browseTemplates": "Browse templates" } diff --git a/src/i18n/locales/en/proposalTemplate.json b/src/i18n/locales/en/proposalTemplate.json index 734846d5c..fa447c097 100644 --- a/src/i18n/locales/en/proposalTemplate.json +++ b/src/i18n/locales/en/proposalTemplate.json @@ -1,6 +1,6 @@ { - "createProposalTemplate": "New Proposal Template", - "proposalTemplateTitle": "Proposal Template Title", + "createProposalTemplate": "Create Proposal Template", + "proposalTemplateTitle": "Title", "proposalTemplateTitleHelperText": "A short title for this proposal template", "proposalTemplateDescription": "Description", "proposalTemplateDescriptionHelperText": "Markdown syntax supported",