From 77f4f73c77f22e9b99c1a22e6e70afbed38b9c8b Mon Sep 17 00:00:00 2001 From: Kellar Date: Sat, 7 Dec 2024 12:01:57 +0000 Subject: [PATCH 01/31] Add a bunch of `.`s and `safe` -> `DAO`s --- src/i18n/locales/en/daoCreate.json | 34 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/i18n/locales/en/daoCreate.json b/src/i18n/locales/en/daoCreate.json index 372560c0f..7752f85fe 100644 --- a/src/i18n/locales/en/daoCreate.json +++ b/src/i18n/locales/en/daoCreate.json @@ -1,10 +1,10 @@ { "addNFTButton": "Import another token", "errorMinSigners": "Number of owners must be greater than 0.", - "errorLowSignerThreshold": "Threshold must be greater than 0", + "errorLowSignerThreshold": "Threshold must be greater than 0.", "errorHighSignerThreshold": "Threshold must be less than number of owners.", "labelSigThreshold": "Threshold", - "helperSigThreshold": "The number of owners required to approve a transaction on this multisig", + "helperSigThreshold": "The number of owners required to approve a transaction on this multisig.", "titleSignerAddresses": "Owners", "subTitleSignerAddresses": "These addresses will be able to approve or reject transactions on this multisig.", "titleGetStarted": "Get Started", @@ -19,11 +19,11 @@ "nftDetailsToken": "Token", "nftDetailsWeight": "Weight", "n/a": "n/a", - "labelConnectWallet": "To deploy a new Decent Safe", - "titleFundingOptions": "Go to parent Safe", + "labelConnectWallet": "To deploy a new DAO", + "titleFundingOptions": "Go to parent DAO", "labelSelectNFT": "Select NFT", "labelNFTAddress": "NFT Address", - "helperNFTAddress": "Import an existing ERC-721 token", + "helperNFTAddress": "Import an existing ERC-721 token.", "labelNFTWeight": "Weight", "helperNFTWeight": "How many votes is this token worth?", "labelVotingPeriod": "Voting Period", @@ -40,19 +40,19 @@ "labelTimelockPeriod": "Timelock Period", "helperTimelockPeriod": "The length of time required between passing a proposal and it being executable onchain.", "labelFreezeVotesThreshold": "Freeze Votes Threshold", - "helperFreezeVotesThreshold": "Total votes required by the parent (out of {{totalVotes}}) to freeze this child Safe entirely", + "helperFreezeVotesThreshold": "Total votes required by the parent (out of {{totalVotes}}) to freeze this child DAO entirely.", "labelFreezeProposalPeriod": "Freeze Proposal Period", - "helperFreezeProposalPeriod": "The length of time (in minutes) for a Freeze Vote's starting and ending point", + "helperFreezeProposalPeriod": "The length of time (in minutes) for a Freeze Vote's starting and ending point.", "exampleFreezeProposalPeriod": "10,080 minutes = 1 week", "labelFreezePeriod": "Freeze Period", - "helperFreezePeriod": "The length of time (in minutes) a successful Freeze Vote will freeze this child Safe", + "helperFreezePeriod": "The length of time (in minutes) a successful Freeze Vote will freeze this child DAO.", "exampleFreezePeriod": "10,080 minutes = 1 week", - "freezeGuardDescription": "These configuration values may be changed later on by passing a proposal to do so on this child Safe", + "freezeGuardDescription": "This configuration may be changed later via a proposal on this child DAO.", "errorDuplicateAddress": "Duplicate Address", "errorNoAllocation": "Enter a token allocation", "errorAllocation": "Invalid token allocation", "labelParentAllocation": "Parent token holder claiming", - "helperParentAllocation": "The total number of tokens claimable by all parent token holders", + "helperParentAllocation": "The total number of tokens claimable by all parent token holders.", "labelAddAllocation": "Add Allocation", "labelAddProposer": "", "labelTokenName": "Name", @@ -64,13 +64,13 @@ "labelMultisigGov": "Multisig (m of n)", "descMultisigGov": "Best for small groups and/or frequent onchain activity.", "labelAzoriusErc20Gov": "ERC-20 Token Voting", - "labelAzoriusErc20HatsWhitelistingGov": "Token Voting + Whitelisted Proposers Safe", + "labelAzoriusErc20HatsWhitelistingGov": "Token Voting + Whitelisted Proposers DAO", "descAzoriusErc20Gov": "Best for distributing power through liquid fungible tokens.", - "descAzoriusErc20HatsWhitelistingGov": "Proposals can be created only by whitelisted Roles members", + "descAzoriusErc20HatsWhitelistingGov": "Proposals can be created only by whitelisted Roles members.", "labelAzoriusErc721Gov": "ERC-721 Token Voting", - "labelAzoriusErc721HatsWhitelistingGov": "NFT Voting + Whitelisted Proposers Safe", + "labelAzoriusErc721HatsWhitelistingGov": "NFT Voting + Whitelisted Proposers DAO", "descAzoriusErc721Gov": "Best for adding governance capabilities to an NFT collection.", - "descAzoriusErc721HatsWhitelistingGov": "Proposals can be created only by whitelisted Roles members", + "descAzoriusErc721HatsWhitelistingGov": "Proposals can be created only by whitelisted Roles members.", "labelDAOName": "Name", "daoNamePlaceholder": "Name", "helperDAOName": "What is your DAO called?", @@ -82,7 +82,7 @@ "titleTokenContract": "Contract", "titleAddress": "Address", "titleAmount": "Amount", - "createSubDAOPendingToastMessage": "Creating your child Safe proposal", + "createSubDAOPendingToastMessage": "Creating your child DAO proposal", "createSubDAOSuccessToastMessage": "Deployment successful", "createSubDAOFailureToastMessage": "Deployment failed", "helperAllocations": "Any unallocated tokens will be placed in the newly deployed DAO treasury.", @@ -101,6 +101,6 @@ "tooltipNftVoting": "NFT Voting allows a group of ERC-721 (NFT) holders to propose and vote on transactions. Multiple NFT addresses can be used. <1>Learn more", "errorUnsupportedCreateOption": "Previously selected Governance option is not supported on this network.", "attachFractalModuleLabel": "Enable Clawback", - "attachFractalModuleDescription": "This setting controls whether Parent Safe will be able to execute arbitrary transactions on Child Safe bypassing voting process on Child Safe.", - "fractalModuleAttachedDescription": "This setting can not be modified as Fractal Module already attached to the Safe." + "attachFractalModuleDescription": "This setting controls whether Parent DAO will be able to execute arbitrary transactions on Child DAO bypassing voting process on Child DAO.", + "fractalModuleAttachedDescription": "This setting can not be modified as Fractal Module already attached to the DAO." } From 8fe988299576c1765a9448feedff58e82f6913a7 Mon Sep 17 00:00:00 2001 From: Kellar Date: Sat, 7 Dec 2024 12:33:05 +0000 Subject: [PATCH 02/31] touch up settings ui --- .../SafeSettings/ERC20TokenContainer.tsx | 9 ++++++--- .../SafeSettings/ERC721TokensContainer.tsx | 13 +++++++++---- .../SafeSettings/SettingsContentBox.tsx | 2 -- .../SafeSettings/Signers/SignersContainer.tsx | 7 +++---- .../governance/SafeGovernanceSettingsPage.tsx | 19 +++++++++++++------ 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/components/SafeSettings/ERC20TokenContainer.tsx b/src/components/SafeSettings/ERC20TokenContainer.tsx index aab5f5ad5..4cb1d153e 100644 --- a/src/components/SafeSettings/ERC20TokenContainer.tsx +++ b/src/components/SafeSettings/ERC20TokenContainer.tsx @@ -3,7 +3,6 @@ import { useTranslation } from 'react-i18next'; import { useFractal } from '../../providers/App/AppProvider'; import { AzoriusGovernance } from '../../types'; import { formatCoin } from '../../utils'; -import { StyledBox } from '../ui/containers/StyledBox'; import { DisplayAddress } from '../ui/links/DisplayAddress'; import { BarLoader } from '../ui/loaders/BarLoader'; @@ -15,13 +14,17 @@ export function ERC20TokenContainer() { const { votesToken } = azoriusGovernance; return ( - + {t('governanceTokenTitle')} {votesToken ? ( {/* TOKEN NAME */} @@ -76,6 +79,6 @@ export function ERC20TokenContainer() { )} - + ); } diff --git a/src/components/SafeSettings/ERC721TokensContainer.tsx b/src/components/SafeSettings/ERC721TokensContainer.tsx index 0ea09dad3..289f99df5 100644 --- a/src/components/SafeSettings/ERC721TokensContainer.tsx +++ b/src/components/SafeSettings/ERC721TokensContainer.tsx @@ -1,8 +1,7 @@ -import { Flex, Grid, GridItem, Text } from '@chakra-ui/react'; +import { Box, Flex, Grid, GridItem, Text } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; import { useFractal } from '../../providers/App/AppProvider'; import { AzoriusGovernance } from '../../types'; -import { StyledBox } from '../ui/containers/StyledBox'; import { DisplayAddress } from '../ui/links/DisplayAddress'; import { BarLoader } from '../ui/loaders/BarLoader'; @@ -14,7 +13,13 @@ export function ERC721TokensContainer() { const { erc721Tokens } = azoriusGovernance; return ( - + {t('governanceERC721TokenTitle')} {erc721Tokens ? ( @@ -97,6 +102,6 @@ export function ERC721TokensContainer() { )} - + ); } diff --git a/src/components/SafeSettings/SettingsContentBox.tsx b/src/components/SafeSettings/SettingsContentBox.tsx index 7ccb6c09b..d6e58f2f7 100644 --- a/src/components/SafeSettings/SettingsContentBox.tsx +++ b/src/components/SafeSettings/SettingsContentBox.tsx @@ -1,6 +1,5 @@ import { BoxProps } from '@chakra-ui/react'; import { PropsWithChildren } from 'react'; -import { NEUTRAL_2_84 } from '../../constants/common'; import { StyledBox } from '../ui/containers/StyledBox'; export function SettingsContentBox({ children, ...props }: PropsWithChildren) { @@ -9,7 +8,6 @@ export function SettingsContentBox({ children, ...props }: PropsWithChildren {children} diff --git a/src/components/SafeSettings/Signers/SignersContainer.tsx b/src/components/SafeSettings/Signers/SignersContainer.tsx index f6cca9046..460556a7f 100644 --- a/src/components/SafeSettings/Signers/SignersContainer.tsx +++ b/src/components/SafeSettings/Signers/SignersContainer.tsx @@ -1,11 +1,10 @@ -import { Button, Flex, Hide, HStack, Icon, Show, Text } from '@chakra-ui/react'; +import { Box, Button, Flex, Hide, HStack, Icon, Show, Text } from '@chakra-ui/react'; import { MinusCircle, PlusCircle } from '@phosphor-icons/react'; import { useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Address, getAddress } from 'viem'; import { useAccount } from 'wagmi'; import { useDaoInfoStore } from '../../../store/daoInfo/useDaoInfoStore'; -import { StyledBox } from '../../ui/containers/StyledBox'; import { DisplayAddress } from '../../ui/links/DisplayAddress'; import { ModalType } from '../../ui/modals/ModalProvider'; import { useDecentModal } from '../../ui/modals/useDecentModal'; @@ -102,7 +101,7 @@ export function SignersContainer() { }, [account, signers]); return ( - + {t('signers', { ns: 'common' })} {userIsSigner && ( @@ -131,6 +130,6 @@ export function SignersContainer() { threshold={safe?.threshold} /> ))} - + ); } diff --git a/src/pages/dao/settings/governance/SafeGovernanceSettingsPage.tsx b/src/pages/dao/settings/governance/SafeGovernanceSettingsPage.tsx index b9dab6539..622bca817 100644 --- a/src/pages/dao/settings/governance/SafeGovernanceSettingsPage.tsx +++ b/src/pages/dao/settings/governance/SafeGovernanceSettingsPage.tsx @@ -1,4 +1,4 @@ -import { Show, Text } from '@chakra-ui/react'; +import { Box, Show, Text } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; import { zeroAddress } from 'viem'; import { InfoGovernance } from '../../../../components/DaoDashboard/Info/InfoGovernance'; @@ -6,7 +6,6 @@ import { ERC20TokenContainer } from '../../../../components/SafeSettings/ERC20To import { ERC721TokensContainer } from '../../../../components/SafeSettings/ERC721TokensContainer'; import { SettingsContentBox } from '../../../../components/SafeSettings/SettingsContentBox'; import { SignersContainer } from '../../../../components/SafeSettings/Signers/SignersContainer'; -import { StyledBox } from '../../../../components/ui/containers/StyledBox'; import NestedPageHeader from '../../../../components/ui/page/Header/NestedPageHeader'; import { DAO_ROUTES } from '../../../../constants/routes'; import { useFractal } from '../../../../providers/App/AppProvider'; @@ -40,18 +39,26 @@ export function SafeGovernanceSettingsPage() { {(isERC20Governance || isERC721Governance) && ( - + {t('daoSettingsGovernance')} - - + + + + )} {isERC20Governance ? ( From 6158a576a9cc8a2b05736dca5373022a0526dbbf Mon Sep 17 00:00:00 2001 From: Kellar Date: Sat, 7 Dec 2024 12:47:25 +0000 Subject: [PATCH 03/31] Fix empty favourites menu bug --- src/components/ui/menus/SafesMenu/index.tsx | 34 ++++++++++++++------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/components/ui/menus/SafesMenu/index.tsx b/src/components/ui/menus/SafesMenu/index.tsx index 150abf884..b7c16c5ce 100644 --- a/src/components/ui/menus/SafesMenu/index.tsx +++ b/src/components/ui/menus/SafesMenu/index.tsx @@ -51,17 +51,29 @@ export function SafesMenu() { /> } - options={favoritesList.map(favorite => ({ - optionKey: `${favorite.networkPrefix}:${favorite.address}`, - onClick: () => {}, - renderer: () => ( - - ), - }))} + options={ + !favoritesList.length + ? [ + { + optionKey: 'empty-favorites', + onClick: () => {}, + renderer: () => ( + {t('emptyFavorites', { ns: 'dashboard' })} + ), + }, + ] + : favoritesList.map(favorite => ({ + optionKey: `${favorite.networkPrefix}:${favorite.address}`, + onClick: () => {}, + renderer: () => ( + + ), + })) + } buttonAs={Button} buttonProps={{ variant: 'tertiary', From 375074e260ed20bf30a2029241cf7eaf17d0628f Mon Sep 17 00:00:00 2001 From: Kellar Date: Sat, 7 Dec 2024 12:54:06 +0000 Subject: [PATCH 04/31] Increase gap --- .../dao/settings/governance/SafeGovernanceSettingsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/dao/settings/governance/SafeGovernanceSettingsPage.tsx b/src/pages/dao/settings/governance/SafeGovernanceSettingsPage.tsx index 622bca817..8e4bf8594 100644 --- a/src/pages/dao/settings/governance/SafeGovernanceSettingsPage.tsx +++ b/src/pages/dao/settings/governance/SafeGovernanceSettingsPage.tsx @@ -39,7 +39,7 @@ export function SafeGovernanceSettingsPage() { {(isERC20Governance || isERC721Governance) && ( From ee78234cd634a2af79cf53dd6c028929f9bdc8ca Mon Sep 17 00:00:00 2001 From: Kellar Date: Sat, 7 Dec 2024 13:14:58 +0000 Subject: [PATCH 05/31] Don't show edit button if cant create proposals --- .../SafePermissionsSettingsPage.tsx | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/pages/dao/settings/permissions/SafePermissionsSettingsPage.tsx b/src/pages/dao/settings/permissions/SafePermissionsSettingsPage.tsx index 96e010618..0a0e82864 100644 --- a/src/pages/dao/settings/permissions/SafePermissionsSettingsPage.tsx +++ b/src/pages/dao/settings/permissions/SafePermissionsSettingsPage.tsx @@ -152,15 +152,17 @@ export function SafePermissionsSettingsPage() { - } - aria-label={t('edit')} - opacity={0} - color="neutral-6" - border="none" - /> + {canUserCreateProposal && ( + } + aria-label={t('edit')} + opacity={0} + color="neutral-6" + border="none" + /> + )} )} From eff0a4892868210585a5889c1def12cba5f8ee17 Mon Sep 17 00:00:00 2001 From: Kellar Date: Sat, 7 Dec 2024 17:46:40 +0000 Subject: [PATCH 06/31] Inline stepper input unit --- .../DaoCreator/formComponents/AzoriusGovernance.tsx | 2 +- src/components/DaoCreator/formComponents/Multisig.tsx | 1 - src/components/ui/forms/NumberStepperInput.tsx | 9 ++++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/DaoCreator/formComponents/AzoriusGovernance.tsx b/src/components/DaoCreator/formComponents/AzoriusGovernance.tsx index 37f6509dd..1c819f749 100644 --- a/src/components/DaoCreator/formComponents/AzoriusGovernance.tsx +++ b/src/components/DaoCreator/formComponents/AzoriusGovernance.tsx @@ -39,8 +39,8 @@ function DayStepperInput({ w="100%" gap="0.5rem" > - {t('days', { ns: 'common' })} onInputChange(Number(val))} /> diff --git a/src/components/DaoCreator/formComponents/Multisig.tsx b/src/components/DaoCreator/formComponents/Multisig.tsx index c06f88ce8..24097c85b 100644 --- a/src/components/DaoCreator/formComponents/Multisig.tsx +++ b/src/components/DaoCreator/formComponents/Multisig.tsx @@ -142,7 +142,6 @@ export function Multisig(props: ICreationStepProps) { } isRequired > - {/* @todo replace with stepper input */} validateNumber(value, 'multisig.signatureThreshold')} value={values.multisig.signatureThreshold} diff --git a/src/components/ui/forms/NumberStepperInput.tsx b/src/components/ui/forms/NumberStepperInput.tsx index 169f767ae..475257a89 100644 --- a/src/components/ui/forms/NumberStepperInput.tsx +++ b/src/components/ui/forms/NumberStepperInput.tsx @@ -1,6 +1,8 @@ import { Button, HStack, + InputGroup, + InputRightElement, NumberDecrementStepper, NumberIncrementStepper, NumberInput, @@ -11,9 +13,11 @@ import { Plus, Minus } from '@phosphor-icons/react'; export function NumberStepperInput({ value, onChange, + unitHint, }: { value?: string | number; onChange: (val: string) => void; + unitHint?: string; }) { const stepperButton = (direction: 'inc' | 'dec') => (