From 634b3b8dc079c30bbf6b20071330f9ad3a4fb6d6 Mon Sep 17 00:00:00 2001 From: Kellar Date: Thu, 25 Apr 2024 13:07:52 +0100 Subject: [PATCH 01/36] Fix breadcrumbs text colour --- src/components/ui/page/Header/Breadcrumbs.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ui/page/Header/Breadcrumbs.tsx b/src/components/ui/page/Header/Breadcrumbs.tsx index 628d9ec6d6..723185f0f0 100644 --- a/src/components/ui/page/Header/Breadcrumbs.tsx +++ b/src/components/ui/page/Header/Breadcrumbs.tsx @@ -13,6 +13,7 @@ export default function Breadcrumbs({ links }: BreadcrumbsProps) { {links.map(({ terminus: title, path }, i) => { From b8d03c5403a3d545ae957bc13ac33b6771a202da Mon Sep 17 00:00:00 2001 From: Kellar Date: Thu, 25 Apr 2024 13:33:14 +0100 Subject: [PATCH 02/36] Refactoring --- .../{index.tsx => DAOSettings.tsx} | 12 +++++----- .../index.tsx => ERC20TokenContainer.tsx} | 14 ++++++------ .../index.tsx => ERC721TokensContainer.tsx} | 12 +++++----- .../index.tsx => MetadataContainer.tsx} | 22 +++++++++---------- .../index.tsx => ModulesContainer.tsx} | 12 +++++----- .../{index.tsx => SettingsSection.tsx} | 4 ++-- .../{index.tsx => SignersContainer.tsx} | 4 ++-- .../{settings/index.tsx => SettingsPage.tsx} | 14 ++++++------ src/router.tsx | 2 +- 9 files changed, 48 insertions(+), 48 deletions(-) rename src/components/pages/DaoSettings/{index.tsx => DAOSettings.tsx} (71%) rename src/components/pages/DaoSettings/components/{ERC20Token/index.tsx => ERC20TokenContainer.tsx} (84%) rename src/components/pages/DaoSettings/components/{ERC721Token/index.tsx => ERC721TokensContainer.tsx} (90%) rename src/components/pages/DaoSettings/components/{Metadata/index.tsx => MetadataContainer.tsx} (88%) rename src/components/pages/DaoSettings/components/{Modules/index.tsx => ModulesContainer.tsx} (88%) rename src/components/pages/DaoSettings/components/{index.tsx => SettingsSection.tsx} (95%) rename src/components/pages/DaoSettings/components/Signers/{index.tsx => SignersContainer.tsx} (97%) rename src/pages/daos/[daoAddress]/{settings/index.tsx => SettingsPage.tsx} (61%) diff --git a/src/components/pages/DaoSettings/index.tsx b/src/components/pages/DaoSettings/DAOSettings.tsx similarity index 71% rename from src/components/pages/DaoSettings/index.tsx rename to src/components/pages/DaoSettings/DAOSettings.tsx index 2a42617278..bf2836380a 100644 --- a/src/components/pages/DaoSettings/index.tsx +++ b/src/components/pages/DaoSettings/DAOSettings.tsx @@ -3,13 +3,13 @@ import { useFractal } from '../../../providers/App/AppProvider'; import { GovernanceType } from '../../../types'; import { BarLoader } from '../../ui/loaders/BarLoader'; import Divider from '../../ui/utils/Divider'; -import ERC20TokenContainer from './components/ERC20Token'; -import ERC721TokensContainer from './components/ERC721Token'; -import MetadataContainer from './components/Metadata'; -import { ModulesContainer } from './components/Modules'; -import SignersContainer from './components/Signers'; +import { ERC20TokenContainer } from './components/ERC20TokenContainer'; +import { ERC721TokensContainer } from './components/ERC721TokensContainer'; +import { MetadataContainer } from './components/MetadataContainer'; +import { ModulesContainer } from './components/ModulesContainer'; +import { SignersContainer } from './components/Signers/SignersContainer'; -export function Settings() { +export function DAOSettings() { const { node: { safe }, governance: { type }, diff --git a/src/components/pages/DaoSettings/components/ERC20Token/index.tsx b/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx similarity index 84% rename from src/components/pages/DaoSettings/components/ERC20Token/index.tsx rename to src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx index b3408cb9b2..c73406804b 100644 --- a/src/components/pages/DaoSettings/components/ERC20Token/index.tsx +++ b/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx @@ -1,13 +1,13 @@ import { Box, Flex, Text } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; -import { SettingsSection } from '..'; -import { useFractal } from '../../../../../providers/App/AppProvider'; -import { AzoriusGovernance } from '../../../../../types'; -import { formatCoin } from '../../../../../utils'; -import { DisplayAddress } from '../../../../ui/links/DisplayAddress'; -import { BarLoader } from '../../../../ui/loaders/BarLoader'; +import { useFractal } from '../../../../providers/App/AppProvider'; +import { AzoriusGovernance } from '../../../../types'; +import { formatCoin } from '../../../../utils'; +import { DisplayAddress } from '../../../ui/links/DisplayAddress'; +import { BarLoader } from '../../../ui/loaders/BarLoader'; +import { SettingsSection } from './SettingsSection'; -export default function ERC20TokenContainer() { +export function ERC20TokenContainer() { const { t } = useTranslation(['settings']); const { governance } = useFractal(); diff --git a/src/components/pages/DaoSettings/components/ERC721Token/index.tsx b/src/components/pages/DaoSettings/components/ERC721TokensContainer.tsx similarity index 90% rename from src/components/pages/DaoSettings/components/ERC721Token/index.tsx rename to src/components/pages/DaoSettings/components/ERC721TokensContainer.tsx index f71ee7e9c0..fdfd542950 100644 --- a/src/components/pages/DaoSettings/components/ERC721Token/index.tsx +++ b/src/components/pages/DaoSettings/components/ERC721TokensContainer.tsx @@ -1,12 +1,12 @@ import { Flex, Text, Grid, GridItem } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; -import { SettingsSection } from '..'; -import { useFractal } from '../../../../../providers/App/AppProvider'; -import { AzoriusGovernance } from '../../../../../types'; -import { DisplayAddress } from '../../../../ui/links/DisplayAddress'; -import { BarLoader } from '../../../../ui/loaders/BarLoader'; +import { useFractal } from '../../../../providers/App/AppProvider'; +import { AzoriusGovernance } from '../../../../types'; +import { DisplayAddress } from '../../../ui/links/DisplayAddress'; +import { BarLoader } from '../../../ui/loaders/BarLoader'; +import { SettingsSection } from './SettingsSection'; -export default function ERC721TokensContainer() { +export function ERC721TokensContainer() { const { t } = useTranslation(['settings']); const { governance } = useFractal(); diff --git a/src/components/pages/DaoSettings/components/Metadata/index.tsx b/src/components/pages/DaoSettings/components/MetadataContainer.tsx similarity index 88% rename from src/components/pages/DaoSettings/components/Metadata/index.tsx rename to src/components/pages/DaoSettings/components/MetadataContainer.tsx index 0e704a7468..e5e1bc4f3a 100644 --- a/src/components/pages/DaoSettings/components/Metadata/index.tsx +++ b/src/components/pages/DaoSettings/components/MetadataContainer.tsx @@ -3,18 +3,18 @@ import { Flex, Text, Button } from '@chakra-ui/react'; import { useState, useEffect, ChangeEventHandler } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; -import { SettingsSection } from '..'; -import { DAO_ROUTES } from '../../../../../constants/routes'; -import useSubmitProposal from '../../../../../hooks/DAO/proposal/useSubmitProposal'; -import { useCanUserCreateProposal } from '../../../../../hooks/utils/useCanUserSubmitProposal'; -import { createAccountSubstring } from '../../../../../hooks/utils/useDisplayName'; -import { useFractal } from '../../../../../providers/App/AppProvider'; -import { useNetworkConfig } from '../../../../../providers/NetworkConfig/NetworkConfigProvider'; -import { ProposalExecuteData } from '../../../../../types'; -import { InputComponent } from '../../../../ui/forms/InputComponent'; -import Divider from '../../../../ui/utils/Divider'; +import { DAO_ROUTES } from '../../../../constants/routes'; +import useSubmitProposal from '../../../../hooks/DAO/proposal/useSubmitProposal'; +import { useCanUserCreateProposal } from '../../../../hooks/utils/useCanUserSubmitProposal'; +import { createAccountSubstring } from '../../../../hooks/utils/useDisplayName'; +import { useFractal } from '../../../../providers/App/AppProvider'; +import { useNetworkConfig } from '../../../../providers/NetworkConfig/NetworkConfigProvider'; +import { ProposalExecuteData } from '../../../../types'; +import { InputComponent } from '../../../ui/forms/InputComponent'; +import Divider from '../../../ui/utils/Divider'; +import { SettingsSection } from './SettingsSection'; -export default function MetadataContainer() { +export function MetadataContainer() { const [name, setName] = useState(''); const [snapshotENS, setSnapshotENS] = useState(''); const [snapshotENSValid, setSnapshotENSValid] = useState(); diff --git a/src/components/pages/DaoSettings/components/Modules/index.tsx b/src/components/pages/DaoSettings/components/ModulesContainer.tsx similarity index 88% rename from src/components/pages/DaoSettings/components/Modules/index.tsx rename to src/components/pages/DaoSettings/components/ModulesContainer.tsx index 0eefbf0103..5a6dbfcdd2 100644 --- a/src/components/pages/DaoSettings/components/Modules/index.tsx +++ b/src/components/pages/DaoSettings/components/ModulesContainer.tsx @@ -1,12 +1,12 @@ import { Box, Flex, Text, Center } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; import { zeroAddress } from 'viem'; -import { SettingsSection } from '..'; -import { useFractal } from '../../../../../providers/App/AppProvider'; -import { FractalModuleType } from '../../../../../types'; -import { DisplayAddress } from '../../../../ui/links/DisplayAddress'; -import { BarLoader } from '../../../../ui/loaders/BarLoader'; -import Divider from '../../../../ui/utils/Divider'; +import { useFractal } from '../../../../providers/App/AppProvider'; +import { FractalModuleType } from '../../../../types'; +import { DisplayAddress } from '../../../ui/links/DisplayAddress'; +import { BarLoader } from '../../../ui/loaders/BarLoader'; +import Divider from '../../../ui/utils/Divider'; +import { SettingsSection } from './SettingsSection'; function NoModuleAttached({ translationKey }: { translationKey: string }) { const { t } = useTranslation('settings'); diff --git a/src/components/pages/DaoSettings/components/index.tsx b/src/components/pages/DaoSettings/components/SettingsSection.tsx similarity index 95% rename from src/components/pages/DaoSettings/components/index.tsx rename to src/components/pages/DaoSettings/components/SettingsSection.tsx index fb67cebbcc..e7918450b2 100644 --- a/src/components/pages/DaoSettings/components/index.tsx +++ b/src/components/pages/DaoSettings/components/SettingsSection.tsx @@ -3,7 +3,7 @@ import { ReactNode } from 'react'; import { StyledBox } from '../../../ui/containers/StyledBox'; import Divider from '../../../ui/utils/Divider'; -interface ISettingsSection { +interface SettingsSectionProps { contentTitle: string; contentHeader?: ReactNode; descriptionTitle: string; @@ -21,7 +21,7 @@ export function SettingsSection({ contentTitle, contentHeader, children, -}: ISettingsSection) { +}: SettingsSectionProps) { return ( - + ); } diff --git a/src/router.tsx b/src/router.tsx index 45ed45b973..204b69daf0 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -6,6 +6,7 @@ import DAOController from './pages/DAOController'; import HomePage from './pages/HomePage'; import DaoCreatePage from './pages/create'; import DaoDashboardPage from './pages/daos/[daoAddress]/DaoDashboardPage'; +import { SettingsPage } from './pages/daos/[daoAddress]/SettingsPage'; import ModifyGovernancePage from './pages/daos/[daoAddress]/edit/governance'; import HierarchyPage from './pages/daos/[daoAddress]/hierarchy'; import SubDaoCreate from './pages/daos/[daoAddress]/new'; @@ -14,7 +15,6 @@ import CreateProposalTemplatePage from './pages/daos/[daoAddress]/proposal-templ import ProposalsPage from './pages/daos/[daoAddress]/proposals'; import ProposalDetailsPage from './pages/daos/[daoAddress]/proposals/[proposalId]'; import ProposalCreatePage from './pages/daos/[daoAddress]/proposals/new'; -import SettingsPage from './pages/daos/[daoAddress]/settings'; import Treasury from './pages/daos/[daoAddress]/treasury'; export const router = (addressPrefix: string) => From 2677f3a94edf340b1eeb04eb79369e69c2d918ca Mon Sep 17 00:00:00 2001 From: Kellar Date: Thu, 25 Apr 2024 13:37:26 +0100 Subject: [PATCH 03/36] Fix page header bottom margin --- src/components/ui/page/Header/PageHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ui/page/Header/PageHeader.tsx b/src/components/ui/page/Header/PageHeader.tsx index 9a9c6d55dd..6a2578cdab 100644 --- a/src/components/ui/page/Header/PageHeader.tsx +++ b/src/components/ui/page/Header/PageHeader.tsx @@ -60,7 +60,7 @@ function PageHeader({ return ( Date: Thu, 25 Apr 2024 13:37:37 +0100 Subject: [PATCH 04/36] Fix settings page top margin --- src/pages/daos/[daoAddress]/SettingsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/daos/[daoAddress]/SettingsPage.tsx b/src/pages/daos/[daoAddress]/SettingsPage.tsx index 407b58e302..f07524c9fa 100644 --- a/src/pages/daos/[daoAddress]/SettingsPage.tsx +++ b/src/pages/daos/[daoAddress]/SettingsPage.tsx @@ -20,7 +20,7 @@ export function SettingsPage() { ); } return ( - + Date: Thu, 25 Apr 2024 13:50:47 +0100 Subject: [PATCH 05/36] Rename DAOSettings -> DAOSettingsContent --- .../DaoSettings/{DAOSettings.tsx => DAOSettingsContent.tsx} | 2 +- src/pages/daos/[daoAddress]/SettingsPage.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/components/pages/DaoSettings/{DAOSettings.tsx => DAOSettingsContent.tsx} (97%) diff --git a/src/components/pages/DaoSettings/DAOSettings.tsx b/src/components/pages/DaoSettings/DAOSettingsContent.tsx similarity index 97% rename from src/components/pages/DaoSettings/DAOSettings.tsx rename to src/components/pages/DaoSettings/DAOSettingsContent.tsx index bf2836380a..497124c4f9 100644 --- a/src/components/pages/DaoSettings/DAOSettings.tsx +++ b/src/components/pages/DaoSettings/DAOSettingsContent.tsx @@ -9,7 +9,7 @@ import { MetadataContainer } from './components/MetadataContainer'; import { ModulesContainer } from './components/ModulesContainer'; import { SignersContainer } from './components/Signers/SignersContainer'; -export function DAOSettings() { +export function DAOSettingsContent() { const { node: { safe }, governance: { type }, diff --git a/src/pages/daos/[daoAddress]/SettingsPage.tsx b/src/pages/daos/[daoAddress]/SettingsPage.tsx index f07524c9fa..3157709934 100644 --- a/src/pages/daos/[daoAddress]/SettingsPage.tsx +++ b/src/pages/daos/[daoAddress]/SettingsPage.tsx @@ -1,6 +1,6 @@ import { Box, Center } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; -import { DAOSettings } from '../../../components/pages/DaoSettings/DAOSettings'; +import { DAOSettingsContent } from '../../../components/pages/DaoSettings/DAOSettingsContent'; import { BarLoader } from '../../../components/ui/loaders/BarLoader'; import PageHeader from '../../../components/ui/page/Header/PageHeader'; import { HEADER_HEIGHT } from '../../../constants/common'; @@ -33,7 +33,7 @@ export function SettingsPage() { }, ]} /> - + ); } From 868b669ded9aefdeb7c14fc2aea4f4ba9a646867 Mon Sep 17 00:00:00 2001 From: Kellar Date: Thu, 25 Apr 2024 14:03:48 +0100 Subject: [PATCH 06/36] Remove inter-sections divider; fix section header divider margin --- .../pages/DaoSettings/DAOSettingsContent.tsx | 13 ++----------- .../DaoSettings/components/SettingsSection.tsx | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/components/pages/DaoSettings/DAOSettingsContent.tsx b/src/components/pages/DaoSettings/DAOSettingsContent.tsx index 497124c4f9..bb2df5d49b 100644 --- a/src/components/pages/DaoSettings/DAOSettingsContent.tsx +++ b/src/components/pages/DaoSettings/DAOSettingsContent.tsx @@ -2,7 +2,6 @@ import { Flex } from '@chakra-ui/react'; import { useFractal } from '../../../providers/App/AppProvider'; import { GovernanceType } from '../../../types'; import { BarLoader } from '../../ui/loaders/BarLoader'; -import Divider from '../../ui/utils/Divider'; import { ERC20TokenContainer } from './components/ERC20TokenContainer'; import { ERC721TokensContainer } from './components/ERC721TokensContainer'; import { MetadataContainer } from './components/MetadataContainer'; @@ -29,7 +28,7 @@ export function DAOSettingsContent() { } return ( - <> + {type === GovernanceType.AZORIUS_ERC20 ? ( ) : type === GovernanceType.AZORIUS_ERC721 ? ( @@ -37,16 +36,8 @@ export function DAOSettingsContent() { ) : type === GovernanceType.MULTISIG ? ( ) : null} - - - + ); } diff --git a/src/components/pages/DaoSettings/components/SettingsSection.tsx b/src/components/pages/DaoSettings/components/SettingsSection.tsx index e7918450b2..991fb5e76e 100644 --- a/src/components/pages/DaoSettings/components/SettingsSection.tsx +++ b/src/components/pages/DaoSettings/components/SettingsSection.tsx @@ -33,7 +33,7 @@ export function SettingsSection({ minWidth="65%" > {contentHeader || {contentTitle}} - + {children} Date: Thu, 25 Apr 2024 14:37:29 +0100 Subject: [PATCH 07/36] Reskin settings section header and header buttons --- .../pages/DaoSettings/DAOSettingsContent.tsx | 5 +- .../components/ERC20TokenContainer.tsx | 2 +- .../components/ERC721TokensContainer.tsx | 2 +- .../components/MetadataContainer.tsx | 37 +++++------ .../components/ModulesContainer.tsx | 2 +- .../components/SettingsSection.tsx | 15 +++-- .../components/Signers/SignersContainer.tsx | 63 +++++++++---------- src/i18n/locales/en/common.json | 4 +- src/i18n/locales/en/settings.json | 2 +- 9 files changed, 63 insertions(+), 69 deletions(-) diff --git a/src/components/pages/DaoSettings/DAOSettingsContent.tsx b/src/components/pages/DaoSettings/DAOSettingsContent.tsx index bb2df5d49b..38af326974 100644 --- a/src/components/pages/DaoSettings/DAOSettingsContent.tsx +++ b/src/components/pages/DaoSettings/DAOSettingsContent.tsx @@ -28,7 +28,10 @@ export function DAOSettingsContent() { } return ( - + {type === GovernanceType.AZORIUS_ERC20 ? ( ) : type === GovernanceType.AZORIUS_ERC721 ? ( diff --git a/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx b/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx index c73406804b..b567cb4177 100644 --- a/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx +++ b/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx @@ -16,7 +16,7 @@ export function ERC20TokenContainer() { return ( diff --git a/src/components/pages/DaoSettings/components/ERC721TokensContainer.tsx b/src/components/pages/DaoSettings/components/ERC721TokensContainer.tsx index fdfd542950..28f3a3e8d2 100644 --- a/src/components/pages/DaoSettings/components/ERC721TokensContainer.tsx +++ b/src/components/pages/DaoSettings/components/ERC721TokensContainer.tsx @@ -15,7 +15,7 @@ export function ERC721TokensContainer() { return ( diff --git a/src/components/pages/DaoSettings/components/MetadataContainer.tsx b/src/components/pages/DaoSettings/components/MetadataContainer.tsx index e5e1bc4f3a..ece1e6606c 100644 --- a/src/components/pages/DaoSettings/components/MetadataContainer.tsx +++ b/src/components/pages/DaoSettings/components/MetadataContainer.tsx @@ -121,29 +121,19 @@ export function MetadataContainer() { return ( - - {t('daoMetadataName')} - - {canUserCreateProposal && ( - - )} - + {t('proposeChanges')} + + ) } descriptionTitle={t('daoMetadataDescriptionTitle')} descriptionText={t('daoMetadataDescriptionText')} @@ -178,7 +168,8 @@ export function MetadataContainer() { {canUserCreateProposal && ( - - - )} - + title={t('signers', { ns: 'common' })} + headerRight={ + userIsSigner && ( + + + + + ) } descriptionTitle={t('signersRequired', { ns: 'common' })} descriptionHeader={ diff --git a/src/i18n/locales/en/common.json b/src/i18n/locales/en/common.json index 537b700acc..bbdf05b77d 100644 --- a/src/i18n/locales/en/common.json +++ b/src/i18n/locales/en/common.json @@ -6,11 +6,11 @@ "next": "Next", "back": "Back", "accept": "Accept", - "add": "Add", + "add": "Add signer", "approve": "Approve", "created": "Created on", "create": "Create", - "remove": "Remove", + "remove": "Remove signer", "reject": "Reject", "view": "View", "details": "Details", diff --git a/src/i18n/locales/en/settings.json b/src/i18n/locales/en/settings.json index b6f67ee934..643b7f189b 100644 --- a/src/i18n/locales/en/settings.json +++ b/src/i18n/locales/en/settings.json @@ -19,5 +19,5 @@ "daoMetadataSnapshot": "Snapshot Space", "daoMetadataDescriptionTitle": "Safe Metadata & Off-chain", "daoMetadataDescriptionText": "Activities or transactions that occur outside of the blockchain network or aren't stored on-chain.", - "proposeChanges": "Propose Changes" + "proposeChanges": "Propose Change" } From 1f24d68d13eb3048c71dd0cbd754bef0fe2d4157 Mon Sep 17 00:00:00 2001 From: Kellar Date: Thu, 25 Apr 2024 14:58:05 +0100 Subject: [PATCH 08/36] Reskin settings section layout and sizes --- .../components/ERC20TokenContainer.tsx | 4 +- .../components/ERC721TokensContainer.tsx | 4 +- .../components/MetadataContainer.tsx | 4 +- .../components/ModulesContainer.tsx | 3 +- .../components/SettingsSection.tsx | 47 ++++++++++--------- .../components/Signers/SignersContainer.tsx | 3 +- src/constants/common.ts | 2 +- 7 files changed, 35 insertions(+), 32 deletions(-) diff --git a/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx b/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx index b567cb4177..b3e330797a 100644 --- a/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx +++ b/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx @@ -17,8 +17,8 @@ export function ERC20TokenContainer() { return ( {votesToken ? ( {erc721Tokens ? ( diff --git a/src/components/pages/DaoSettings/components/MetadataContainer.tsx b/src/components/pages/DaoSettings/components/MetadataContainer.tsx index ece1e6606c..fef921edda 100644 --- a/src/components/pages/DaoSettings/components/MetadataContainer.tsx +++ b/src/components/pages/DaoSettings/components/MetadataContainer.tsx @@ -135,8 +135,8 @@ export function MetadataContainer() { ) } - descriptionTitle={t('daoMetadataDescriptionTitle')} - descriptionText={t('daoMetadataDescriptionText')} + descriptionHeader={t('daoMetadataDescriptionTitle')} + descriptionContent={t('daoMetadataDescriptionText')} > + {/* SETTINGS SECTION CONTENT */} {children} - - {descriptionHeader || ( - - {descriptionTitle} - - )} - {descriptionContent || {descriptionText}} - + + {descriptionHeader} + + + + {descriptionContent} + + ); } diff --git a/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx b/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx index 06a50e58df..03f16addc5 100644 --- a/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx +++ b/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx @@ -96,7 +96,6 @@ export function SignersContainer() { ) } - descriptionTitle={t('signersRequired', { ns: 'common' })} descriptionHeader={ {`${safe?.threshold}/${safe?.owners.length}`} } - descriptionText={t('signersDescription')} + descriptionContent={t('signersDescription')} > setSelectedSigner(e)} diff --git a/src/constants/common.ts b/src/constants/common.ts index 3c481ffe9d..17514405c2 100644 --- a/src/constants/common.ts +++ b/src/constants/common.ts @@ -1,6 +1,6 @@ export const HEADER_HEIGHT = '4.5rem'; export const CONTENT_HEIGHT = `calc(100vh - ${HEADER_HEIGHT})`; -export const BACKGROUND_SEMI_TRANSPARENT = 'black.900-semi-transparent'; +export const BACKGROUND_SEMI_TRANSPARENT = 'green'; // This will make it obvious anywhere this happens to be used that a reskin is in order. After all usages are replaced, this constant should be removed. /** * Max width for most informational Tooltips. However we don't add max width * to some Tooltips that shouldn't wrap no matter how long, such as token amounts. From b9e221161c58a195caec5abf3e0bf71d6c1c4c9b Mon Sep 17 00:00:00 2001 From: Kellar Date: Thu, 25 Apr 2024 15:25:25 +0100 Subject: [PATCH 09/36] Add NESTED SETTINGS SECTION, for when a section has an extra header-content content --- .../components/ModulesContainer.tsx | 44 ++++++++----------- .../components/SettingsSection.tsx | 32 +++++++++++--- src/i18n/locales/en/settings.json | 4 +- 3 files changed, 45 insertions(+), 35 deletions(-) diff --git a/src/components/pages/DaoSettings/components/ModulesContainer.tsx b/src/components/pages/DaoSettings/components/ModulesContainer.tsx index 6981fc1d45..ba325f5d1b 100644 --- a/src/components/pages/DaoSettings/components/ModulesContainer.tsx +++ b/src/components/pages/DaoSettings/components/ModulesContainer.tsx @@ -1,26 +1,16 @@ -import { Box, Flex, Text, Center } from '@chakra-ui/react'; +import { Box, Flex, Text } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; import { zeroAddress } from 'viem'; import { useFractal } from '../../../../providers/App/AppProvider'; import { FractalModuleType } from '../../../../types'; import { DisplayAddress } from '../../../ui/links/DisplayAddress'; import { BarLoader } from '../../../ui/loaders/BarLoader'; -import Divider from '../../../ui/utils/Divider'; import { SettingsSection } from './SettingsSection'; function NoModuleAttached({ translationKey }: { translationKey: string }) { const { t } = useTranslation('settings'); - return ( -
- - {t(translationKey)} - -
- ); + return {t(translationKey)}; } export function ModulesContainer() { @@ -52,6 +42,22 @@ export function ModulesContainer() { } + nestedSection={{ + title: t('guardTitle'), + children: + safe?.guard && safe?.guard !== zeroAddress ? ( + + + {safe.guard} + {!!freezeGuardContractAddress || !!freezeVotingContractAddress + ? ' (Freeze Guard)' + : ''} + + + ) : ( + + ), + }} > )} - {t('guardTitle')} - - {safe?.guard && safe?.guard !== zeroAddress ? ( - - - {safe.guard} - {!!freezeGuardContractAddress || !!freezeVotingContractAddress - ? ' (Freeze Guard)' - : ''} - - - ) : ( - - )} ); diff --git a/src/components/pages/DaoSettings/components/SettingsSection.tsx b/src/components/pages/DaoSettings/components/SettingsSection.tsx index 18179945fc..49be59d630 100644 --- a/src/components/pages/DaoSettings/components/SettingsSection.tsx +++ b/src/components/pages/DaoSettings/components/SettingsSection.tsx @@ -3,12 +3,18 @@ import { ReactNode } from 'react'; import { StyledBox } from '../../../ui/containers/StyledBox'; import Divider from '../../../ui/utils/Divider'; +type NestedSettingsSectionProps = Omit< + SettingsSectionProps, + 'nestedSection' | 'descriptionHeader' | 'descriptionContent' +>; + interface SettingsSectionProps { title: string; headerRight?: ReactNode; descriptionHeader: ReactNode; descriptionContent: ReactNode; children: ReactNode; + nestedSection?: NestedSettingsSectionProps; } export function SettingsSection({ @@ -17,12 +23,10 @@ export function SettingsSection({ descriptionHeader, descriptionContent, children, + nestedSection, }: SettingsSectionProps) { return ( - + {/* SETTINGS SECTION CONTENT */} + {/* TITLE AND OPTIONAL RIGHT COMPONENT */} - {title} - - {/* OPTIONAL HEADER RIGHT COMPONENT */} + {title} {headerRight} {children} + + {/* NESTED SETTINGS SECTION, for when a section has an extra header-content content */} + {nestedSection && ( + + + {nestedSection.title} + {nestedSection.headerRight} + + + {nestedSection.children} + + )} {/* SETTINGS SECTION DESCRIPTION */} diff --git a/src/i18n/locales/en/settings.json b/src/i18n/locales/en/settings.json index 643b7f189b..bac8ca19be 100644 --- a/src/i18n/locales/en/settings.json +++ b/src/i18n/locales/en/settings.json @@ -8,8 +8,8 @@ "governanceTokenWeightLabel": "Token Weight", "governanceTokenTotalWeightLabel": "Total Weight", "governanceTokenSupplyLabel": "Total Supply", - "noModulesAttached": "No Modules Attached", - "noGuardAttached": "No Guard Attached", + "noModulesAttached": "No modules attached", + "noGuardAttached": "No guard attached", "modulesTitle": "Modules", "guardTitle": "Guard", "modulesAndGuardsTitle": "Modules and Guards", From 5b8731b19928ae5a2a06319c590e72a3617b7e5e Mon Sep 17 00:00:00 2001 From: Kellar Date: Thu, 25 Apr 2024 15:35:20 +0100 Subject: [PATCH 10/36] Reskin MetadataContainer --- .../components/MetadataContainer.tsx | 68 ++++++++----------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/src/components/pages/DaoSettings/components/MetadataContainer.tsx b/src/components/pages/DaoSettings/components/MetadataContainer.tsx index fef921edda..b71980ca78 100644 --- a/src/components/pages/DaoSettings/components/MetadataContainer.tsx +++ b/src/components/pages/DaoSettings/components/MetadataContainer.tsx @@ -1,5 +1,5 @@ import { ens_normalize } from '@adraffy/ens-normalize'; -import { Flex, Text, Button } from '@chakra-ui/react'; +import { Button } from '@chakra-ui/react'; import { useState, useEffect, ChangeEventHandler } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; @@ -11,7 +11,6 @@ import { useFractal } from '../../../../providers/App/AppProvider'; import { useNetworkConfig } from '../../../../providers/NetworkConfig/NetworkConfigProvider'; import { ProposalExecuteData } from '../../../../types'; import { InputComponent } from '../../../ui/forms/InputComponent'; -import Divider from '../../../ui/utils/Divider'; import { SettingsSection } from './SettingsSection'; export function MetadataContainer() { @@ -137,36 +136,9 @@ export function MetadataContainer() { } descriptionHeader={t('daoMetadataDescriptionTitle')} descriptionContent={t('daoMetadataDescriptionText')} - > - setName(e.target.value)} - disabled={!userHasVotingWeight} - value={name} - placeholder="Amazing DAO" - testId="daoSettings.name" - gridContainerProps={{ - display: 'inline-flex', - flexWrap: 'wrap', - flex: '1', - width: '100%', - }} - inputContainerProps={{ - width: '100%', - }} - /> - - - - {t('daoMetadataSnapshot')} - - {canUserCreateProposal && ( + nestedSection={{ + title: t('daoMetadataSnapshot'), + headerRight: canUserCreateProposal && ( - )} - + ), + children: ( + + ), + }} + > setName(e.target.value)} disabled={!userHasVotingWeight} - placeholder="example.eth" - testId="daoSettings.snapshotENS" + value={name} + placeholder="Amazing DAO" + testId="daoSettings.name" gridContainerProps={{ display: 'inline-flex', flexWrap: 'wrap', From 1ae81bb3b5159f46fe92aaf306bc4968d3996243 Mon Sep 17 00:00:00 2001 From: Kellar Date: Thu, 25 Apr 2024 16:52:31 +0100 Subject: [PATCH 11/36] reskin DisplayAddress --- src/components/ui/links/DisplayAddress.tsx | 26 ++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/components/ui/links/DisplayAddress.tsx b/src/components/ui/links/DisplayAddress.tsx index 263e8cb438..1605b917ec 100644 --- a/src/components/ui/links/DisplayAddress.tsx +++ b/src/components/ui/links/DisplayAddress.tsx @@ -1,5 +1,5 @@ import { HStack, Text } from '@chakra-ui/react'; -import { ArrowAngleUp } from '@decent-org/fractal-ui'; +import { ArrowUpRight } from '@phosphor-icons/react'; import { ReactNode } from 'react'; import useDisplayName from '../../../hooks/utils/useDisplayName'; import EtherscanLinkAddress from './EtherscanLinkAddress'; @@ -15,14 +15,22 @@ export function DisplayAddress({ }) { const displayAddress = useDisplayName(address, truncate); return ( - - - {children || displayAddress.displayName} - + + + {children || displayAddress.displayName} + ); From 6223ddc72c5a41b61f92c2ddf5d15b94373250ef Mon Sep 17 00:00:00 2001 From: Kellar Date: Thu, 25 Apr 2024 16:57:09 +0100 Subject: [PATCH 12/36] Attempt at signers' radio buttons --- .../components/Signers/SignersContainer.tsx | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx b/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx index 03f16addc5..44a0f798f4 100644 --- a/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx +++ b/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx @@ -9,19 +9,34 @@ import { ModalType } from '../../../../ui/modals/ModalProvider'; import { useFractalModal } from '../../../../ui/modals/useFractalModal'; import { SettingsSection } from '../SettingsSection'; -function Signer({ signer, disabled }: { signer: string; disabled: boolean }) { +function Signer({ signer, disabled}: { signer: string; disabled: boolean }) { return ( {!disabled && ( )} Date: Thu, 25 Apr 2024 17:06:37 +0100 Subject: [PATCH 13/36] Reskin modules section --- .../DaoSettings/components/ModulesContainer.tsx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/components/pages/DaoSettings/components/ModulesContainer.tsx b/src/components/pages/DaoSettings/components/ModulesContainer.tsx index ba325f5d1b..64fbf629d6 100644 --- a/src/components/pages/DaoSettings/components/ModulesContainer.tsx +++ b/src/components/pages/DaoSettings/components/ModulesContainer.tsx @@ -1,4 +1,4 @@ -import { Box, Flex, Text } from '@chakra-ui/react'; +import { Flex, Text } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; import { zeroAddress } from 'viem'; import { useFractal } from '../../../../providers/App/AppProvider'; @@ -46,14 +46,14 @@ export function ModulesContainer() { title: t('guardTitle'), children: safe?.guard && safe?.guard !== zeroAddress ? ( - + {safe.guard} {!!freezeGuardContractAddress || !!freezeVotingContractAddress ? ' (Freeze Guard)' : ''} - + ) : ( ), @@ -66,12 +66,8 @@ export function ModulesContainer() { > {isModulesLoaded ? ( fractalModules.length > 0 ? ( - fractalModules.map(({ moduleAddress, moduleType }, i) => ( - + fractalModules.map(({ moduleAddress, moduleType }) => ( + {moduleAddress} {moduleType === FractalModuleType.AZORIUS @@ -80,7 +76,7 @@ export function ModulesContainer() { ? ' (Fractal Module)' : ''} - + )) ) : ( From 2b23826fda50352d322ee69a93af529d6db558d8 Mon Sep 17 00:00:00 2001 From: Kellar Date: Thu, 25 Apr 2024 17:18:21 +0100 Subject: [PATCH 14/36] reskin ERC20TokenContainer --- .../components/ERC20TokenContainer.tsx | 45 ++++++------------- .../components/Signers/SignersContainer.tsx | 8 ++-- 2 files changed, 17 insertions(+), 36 deletions(-) diff --git a/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx b/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx index b3e330797a..533657993f 100644 --- a/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx +++ b/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx @@ -25,44 +25,25 @@ export function ERC20TokenContainer() { justifyContent="space-between" mt={4} > + {/* TOKEN NAME */} - - {t('governanceTokenNameLabel')} - - + {t('governanceTokenNameLabel')} + {votesToken.name} - + + + {/* TOKEN SYMBOL */} - - {t('governanceTokenSymbolLabel')} - - - {votesToken.symbol} - + {t('governanceTokenSymbolLabel')} + {votesToken.symbol} + + {/* TOTAL SUPPLY */} - - {t('governanceTokenSupplyLabel')} - - + {' '} + {t('governanceTokenSupplyLabel')} + {formatCoin( votesToken.totalSupply, false, diff --git a/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx b/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx index 44a0f798f4..413598a455 100644 --- a/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx +++ b/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx @@ -9,7 +9,7 @@ import { ModalType } from '../../../../ui/modals/ModalProvider'; import { useFractalModal } from '../../../../ui/modals/useFractalModal'; import { SettingsSection } from '../SettingsSection'; -function Signer({ signer, disabled}: { signer: string; disabled: boolean }) { +function Signer({ signer, disabled }: { signer: string; disabled: boolean }) { return ( Date: Thu, 25 Apr 2024 17:23:47 +0100 Subject: [PATCH 15/36] Reskin ERC721TokensContainer --- .../components/ERC20TokenContainer.tsx | 21 ++++++-- .../components/ERC721TokensContainer.tsx | 48 ++++++++----------- 2 files changed, 39 insertions(+), 30 deletions(-) diff --git a/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx b/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx index 533657993f..4b503ef159 100644 --- a/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx +++ b/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx @@ -27,7 +27,12 @@ export function ERC20TokenContainer() { > {/* TOKEN NAME */} - {t('governanceTokenNameLabel')} + + {t('governanceTokenNameLabel')} + {votesToken.name} @@ -35,14 +40,24 @@ export function ERC20TokenContainer() { {/* TOKEN SYMBOL */} - {t('governanceTokenSymbolLabel')} + + {t('governanceTokenSymbolLabel')} + {votesToken.symbol} {/* TOTAL SUPPLY */} {' '} - {t('governanceTokenSupplyLabel')} + + {t('governanceTokenSupplyLabel')} + {formatCoin( votesToken.totalSupply, diff --git a/src/components/pages/DaoSettings/components/ERC721TokensContainer.tsx b/src/components/pages/DaoSettings/components/ERC721TokensContainer.tsx index f84aef2a3e..7e2b77f24a 100644 --- a/src/components/pages/DaoSettings/components/ERC721TokensContainer.tsx +++ b/src/components/pages/DaoSettings/components/ERC721TokensContainer.tsx @@ -24,72 +24,66 @@ export function ERC721TokensContainer() { + {/* HEADER TITLES */} {t('governanceTokenNameLabel')} {t('governanceTokenSymbolLabel')} {t('governanceTokenWeightLabel')} {t('governanceTokenTotalWeightLabel')} + + {/* TOKEN DETAILS */} {erc721Tokens.map(token => ( - {token.name} + + {token.name} + + - - {token.symbol} - + {token.symbol} + - - {token.votingWeight.toString()} - + {token.votingWeight.toString()} + - + {token.totalSupply ? (token.totalSupply * token.votingWeight).toString() : 'n/a'} From 5f11113a5c8a922b5b8a7384aff80456792a6f5f Mon Sep 17 00:00:00 2001 From: Kellar Date: Thu, 25 Apr 2024 17:57:27 +0100 Subject: [PATCH 16/36] Reskin modal base --- src/components/ui/modals/ModalBase.tsx | 24 +++++++++++++----------- src/constants/common.ts | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/components/ui/modals/ModalBase.tsx b/src/components/ui/modals/ModalBase.tsx index 8d9dcfd7cf..e8d69f0fa4 100644 --- a/src/components/ui/modals/ModalBase.tsx +++ b/src/components/ui/modals/ModalBase.tsx @@ -1,5 +1,5 @@ import { Flex, HStack, Modal, ModalContent, ModalOverlay, Spacer, Text } from '@chakra-ui/react'; -import { Alert, CloseX } from '@decent-org/fractal-ui'; +import { X, Warning } from '@phosphor-icons/react'; import { ReactNode } from 'react'; import { BACKGROUND_SEMI_TRANSPARENT } from '../../../constants/common'; import Divider from '../utils/Divider'; @@ -25,27 +25,29 @@ export function ModalBase(props: ModuleBaseProps) { > - + {props.warn && ( - + )} {props.title} - diff --git a/src/constants/common.ts b/src/constants/common.ts index 17514405c2..c24038e499 100644 --- a/src/constants/common.ts +++ b/src/constants/common.ts @@ -1,6 +1,6 @@ export const HEADER_HEIGHT = '4.5rem'; export const CONTENT_HEIGHT = `calc(100vh - ${HEADER_HEIGHT})`; -export const BACKGROUND_SEMI_TRANSPARENT = 'green'; // This will make it obvious anywhere this happens to be used that a reskin is in order. After all usages are replaced, this constant should be removed. +export const BACKGROUND_SEMI_TRANSPARENT = '#10041480'; /** * Max width for most informational Tooltips. However we don't add max width * to some Tooltips that shouldn't wrap no matter how long, such as token amounts. From 4be2b7341ad8313d5e6c23c0c2de75d340fb9940 Mon Sep 17 00:00:00 2001 From: Kellar Date: Thu, 25 Apr 2024 18:24:04 +0100 Subject: [PATCH 17/36] reskin AddSignerModal, RemoveSignerModal --- .../Signers/modals/AddSignerModal.tsx | 31 ++---- .../Signers/modals/RemoveSignerModal.tsx | 97 ++++++++++--------- src/components/ui/modals/ModalBase.tsx | 4 +- src/i18n/locales/en/modals.json | 2 +- 4 files changed, 61 insertions(+), 73 deletions(-) diff --git a/src/components/pages/DaoSettings/components/Signers/modals/AddSignerModal.tsx b/src/components/pages/DaoSettings/components/Signers/modals/AddSignerModal.tsx index 976944c1c4..ecbac3c7e7 100644 --- a/src/components/pages/DaoSettings/components/Signers/modals/AddSignerModal.tsx +++ b/src/components/pages/DaoSettings/components/Signers/modals/AddSignerModal.tsx @@ -86,14 +86,10 @@ function AddSignerModal({ {({ handleSubmit, errors, values, setFieldValue }) => { return (
- - {t('addSignerLabel', { ns: 'modals' })} - + {t('addSignerLabel', { ns: 'modals' })} {({ field }: FieldAttributes) => ( + // LabelWrapper title styling needs to updated on @decent-org/fractal-ui, it seems setFieldValue('threshold', Number(e.target.value))} mt={4} width="8rem" - bgColor="#2c2c2c" - borderColor="#4d4d4d" + bgColor="neutral-1" + borderColor="neutral-3" rounded="sm" cursor="pointer" > @@ -143,8 +140,6 @@ function AddSignerModal({ {`${t('signersRequired1', { ns: 'modals' })} ${signers.length + 1} ${t( @@ -163,23 +158,13 @@ function AddSignerModal({ alt="alert triangle" w="1.5rem" h="1.5rem" - ml={3} - mr={3} - textColor="blue.500" + mx={3} /> - - {t('updateSignerWarning', { ns: 'modals' })} - + {t('updateSignerWarning', { ns: 'modals' })} - + setFieldValue('nonce', newNonce ? newNonce : undefined)} diff --git a/src/components/pages/DaoSettings/components/Signers/modals/RemoveSignerModal.tsx b/src/components/pages/DaoSettings/components/Signers/modals/RemoveSignerModal.tsx index 329c436b62..52bfcacb54 100644 --- a/src/components/pages/DaoSettings/components/Signers/modals/RemoveSignerModal.tsx +++ b/src/components/pages/DaoSettings/components/Signers/modals/RemoveSignerModal.tsx @@ -1,14 +1,5 @@ -import { - Box, - Button, - Flex, - HStack, - Select, - Text, - Image, - AlertTitle, - Alert, -} from '@chakra-ui/react'; +import { Box, Button, Flex, HStack, Select, Text, Icon } from '@chakra-ui/react'; +import { WarningDiamond, WarningCircle } from '@phosphor-icons/react'; import { useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Address } from 'viem'; @@ -72,23 +63,36 @@ function RemoveSignerModal({ return ( + {t('removeSignerLabel', { ns: 'modals' })} + - {t('removeSignerLabel', { ns: 'modals' })} - - {ensName ? ensName : selectedSigner} + + + + + {/* TODO: should be i18n-d */} + This signer will be removed from the the organization + + + + {`${t('signersRequired1', { ns: 'modals' })} ${signers.length - 1} ${t( @@ -140,29 +144,30 @@ function RemoveSignerModal({ )}`} - - alert triangle - - - {t('updateSignerWarning', { ns: 'modals' })} - - - + + {t('updateSignerWarning', { ns: 'modals' })} + + - {props.warn && ( - - )} + {props.warn && } Date: Thu, 25 Apr 2024 20:15:31 -0400 Subject: [PATCH 18/36] Replace "Jazzicon" with classic "Blockie"-style avatar, to be consistent with ecosystem --- package-lock.json | 74 +++--------------------- package.json | 2 +- src/components/ui/page/Header/Avatar.tsx | 16 +++-- 3 files changed, 21 insertions(+), 71 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1227202c32..4522de9172 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,10 +29,10 @@ "@shutter-network/shutter-crypto": "^1.0.1", "@snapshot-labs/snapshot.js": "^0.7.3", "@tanstack/react-query": "^5.28.4", - "@ukstv/jazzicon-react": "^1.0.0", "@vitejs/plugin-react-swc": "^3.5.0", "@web3modal/wagmi": "^4.1.1", "axios": "^0.27.2", + "blo": "^1.2.0", "classnames": "^2.3.1", "date-fns": "^2.29.3", "date-fns-tz": "^2.0.1", @@ -11934,21 +11934,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@ukstv/jazzicon-react": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@ukstv/jazzicon-react/-/jazzicon-react-1.0.0.tgz", - "integrity": "sha512-V0klHdrO8Mk+faTGhQRd4t2vR+1IUHJa9sLaP/vhed0klPrOblhEU/Mc+Utgxep6oUuyhcGigjvkEJUOVE1/sg==", - "dependencies": { - "color": "^3.1.2", - "mersenne-twister": "^1.1.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "react": ">=16" - } - }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -14132,6 +14117,14 @@ "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" }, + "node_modules/blo": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/blo/-/blo-1.2.0.tgz", + "integrity": "sha512-bZES7RzJ14B4WBT3JuOHSOAvCBmUhqznrojQ8xRjN1Fx9X9N7R+rygOFS3k4wXel2nFg4lwzL3luAYzObaDLng==", + "engines": { + "node": ">=16" + } + }, "node_modules/bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", @@ -15126,15 +15119,6 @@ "node": ">=0.10.0" } }, - "node_modules/color": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", - "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", - "dependencies": { - "color-convert": "^1.9.3", - "color-string": "^1.6.0" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -15151,28 +15135,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "node_modules/color-string": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", - "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", - "dependencies": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, - "node_modules/color/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, "node_modules/color2k": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/color2k/-/color2k-2.0.3.tgz", @@ -21492,11 +21454,6 @@ } } }, - "node_modules/mersenne-twister": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mersenne-twister/-/mersenne-twister-1.1.0.tgz", - "integrity": "sha512-mUYWsMKNrm4lfygPkL3OfGzOPTR2DBlTkBNHM//F6hGp8cLThY897crAlk3/Jo17LEOOjQUrNAx6DvgO77QJkA==" - }, "node_modules/metro": { "version": "0.73.8", "resolved": "https://registry.npmjs.org/metro/-/metro-0.73.8.tgz", @@ -26360,19 +26317,6 @@ "integrity": "sha512-6+eerH9fEnNmi/hyM1DXcRK3pWdoMQtlkQ+ns0ntzunjKqp5i3sKCc80ym8Fib3iaYhdJUOPdhlJWj1tvge2Ww==", "dev": true }, - "node_modules/simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "dependencies": { - "is-arrayish": "^0.3.1" - } - }, - "node_modules/simple-swizzle/node_modules/is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" - }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", diff --git a/package.json b/package.json index 9175d797b3..4e5a23b4f9 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,10 @@ "@shutter-network/shutter-crypto": "^1.0.1", "@snapshot-labs/snapshot.js": "^0.7.3", "@tanstack/react-query": "^5.28.4", - "@ukstv/jazzicon-react": "^1.0.0", "@vitejs/plugin-react-swc": "^3.5.0", "@web3modal/wagmi": "^4.1.1", "axios": "^0.27.2", + "blo": "^1.2.0", "classnames": "^2.3.1", "date-fns": "^2.29.3", "date-fns-tz": "^2.0.1", diff --git a/src/components/ui/page/Header/Avatar.tsx b/src/components/ui/page/Header/Avatar.tsx index 074435bb8b..b182a0c488 100644 --- a/src/components/ui/page/Header/Avatar.tsx +++ b/src/components/ui/page/Header/Avatar.tsx @@ -1,7 +1,8 @@ import { Box, Image } from '@chakra-ui/react'; -import { Jazzicon } from '@ukstv/jazzicon-react'; +import { blo } from 'blo'; import { Suspense } from 'react'; import { useImage } from 'react-image'; +import { getAddress } from 'viem'; type AvatarSize = 'icon' | 'lg' | 'sm'; const avatarSizes: { [size: string]: string } = { @@ -10,13 +11,18 @@ const avatarSizes: { [size: string]: string } = { lg: '2rem', }; -function JazziconAvatar({ address, size }: { size: AvatarSize; address: string }) { +function BlockieAvatar({ address, size }: { size: AvatarSize; address: string }) { return ( - + {address} ); } @@ -48,7 +54,7 @@ function Avatar({ }) { if (!url) { return ( - @@ -58,7 +64,7 @@ function Avatar({ return ( From 402f97eebfaeec91be2a83ecc0feb79ce878d656 Mon Sep 17 00:00:00 2001 From: Kirill Klimenko Date: Fri, 26 Apr 2024 13:23:30 +0200 Subject: [PATCH 19/36] Restyle proposals list --- .../Activity/ActivityDescription.tsx | 3 +- .../ActivityDescriptionGovernance.tsx | 11 +- .../Proposals/ProposalCard/ProposalCard.tsx | 24 ++-- src/components/Proposals/index.tsx | 20 ++- src/components/ui/badges/Badge.tsx | 116 +++++++----------- src/components/ui/badges/QuorumBadge.tsx | 7 +- src/components/ui/page/Header/Breadcrumbs.tsx | 4 +- src/i18n/locales/en/breadcrumbs.json | 2 +- 8 files changed, 84 insertions(+), 103 deletions(-) diff --git a/src/components/Activity/ActivityDescription.tsx b/src/components/Activity/ActivityDescription.tsx index 6e4703c4e0..de604ea971 100644 --- a/src/components/Activity/ActivityDescription.tsx +++ b/src/components/Activity/ActivityDescription.tsx @@ -29,7 +29,8 @@ export function ActivityDescription({ activity, showFullDescription }: IActivity {description && ( @@ -52,13 +57,10 @@ function ProposalCard({ proposal }: { proposal: FractalProposal }) { size="sm" proposal={proposal} /> - {/* TODO: replace with */} {isSnapshotProposal && ( - {t('snapshot')} + + + )} @@ -68,8 +70,8 @@ function ProposalCard({ proposal }: { proposal: FractalProposal }) { {proposal.eventDate && ( {eventDateLabel} {format(proposal.eventDate, DEFAULT_DATE_FORMAT)} diff --git a/src/components/Proposals/index.tsx b/src/components/Proposals/index.tsx index 1305850ff6..6010680317 100644 --- a/src/components/Proposals/index.tsx +++ b/src/components/Proposals/index.tsx @@ -1,5 +1,5 @@ -import { Box, Flex, Text, Button } from '@chakra-ui/react'; -import { ArrowDown } from '@decent-org/fractal-ui'; +import { Box, Flex, Text, Button, Icon } from '@chakra-ui/react'; +import { Funnel, CaretDown } from '@phosphor-icons/react'; import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import useProposals from '../../hooks/DAO/proposal/useProposals'; @@ -109,14 +109,18 @@ export default function Proposals() { return ( <> - {filterTitle} - + + {filterTitle} + } options={options} namespace="proposal" @@ -124,6 +128,10 @@ export default function Proposals() { buttonAs={Button} buttonProps={{ variant: 'tertiary', + paddingLeft: '0.5rem', + paddingRight: '0.5rem', + paddingTop: '0.25rem', + paddingBottom: '0.25rem', disabled: !proposals, }} closeOnSelect={false} diff --git a/src/components/ui/badges/Badge.tsx b/src/components/ui/badges/Badge.tsx index db5f21f4d4..a5c22d000f 100644 --- a/src/components/ui/badges/Badge.tsx +++ b/src/components/ui/badges/Badge.tsx @@ -13,117 +13,89 @@ type BadgeType = { }; }; -const greenText = '#8BDA8B'; -const greenBG = '#0A320A'; -const greenHoverText = '#78D378'; -const greenHover = '#0E440E'; - -const redText = '#FFB2B2'; -const redBG = '#640E0D'; -const redHoverText = '#FF9999'; -const redHover = '#4D0B0A'; - -const sandBG = '#C18D5A'; -const sandHover = '#B97F46'; -const sandText = '#2C1A08'; -const sandHoverText = '#150D04 '; - -const grayBG = '#9A979D'; -const grayHover = '#8C8990'; - -const freezeBG = '#A3B9EC'; -const freezeHover = '#8DA8E7'; -const freezeText = '#0D2356'; -const freezeHoverText = '#09193E'; - -const frozenBG = '#09193E'; -const frozenText = '#D1DCF5'; -const frozenHoverText = '#BCCCF0'; -const frozenHover = '#17326E'; - const BADGE_MAPPING: BadgeType = { [FractalProposalState.ACTIVE]: { tooltipKey: 'stateActiveTip', - bg: greenBG, - textColor: greenText, - _hover: { bg: greenHover, textColor: greenHoverText }, + bg: 'lilac-0', + textColor: 'cosmic-nebula-0', + _hover: { bg: 'lilac--1', textColor: 'cosmic-nebula-0' }, }, [FractalProposalState.TIMELOCKED]: { tooltipKey: 'stateTimelockedTip', - bg: greenBG, - textColor: greenText, - _hover: { bg: greenHover, textColor: greenHoverText }, + bg: 'neutral-8', + textColor: 'neutral-4', + _hover: { bg: 'neutral-7', textColor: 'neutral-4' }, }, [FractalProposalState.EXECUTED]: { tooltipKey: 'stateExecutedTip', - bg: greenBG, - textColor: greenText, - _hover: { bg: greenHover, textColor: greenHoverText }, + bg: 'celery--5', + textColor: 'white-0', + _hover: { bg: 'celery--6', textColor: 'white-0' }, }, [FractalProposalState.EXECUTABLE]: { tooltipKey: 'stateExecutableTip', - bg: greenBG, - textColor: greenText, - _hover: { bg: greenHover, textColor: greenHoverText }, + bg: 'celery--2', + textColor: 'black-0', + _hover: { bg: 'celery--3', textColor: 'black-0' }, }, [FractalProposalState.FAILED]: { tooltipKey: 'stateFailedTip', - bg: redBG, - textColor: redText, - _hover: { bg: redHover, textColor: redHoverText }, + bg: 'red-0', + textColor: 'red-4', + _hover: { bg: 'red--1', textColor: 'red-4' }, }, [FractalProposalState.TIMELOCKABLE]: { tooltipKey: 'stateTimelockableTip', - bg: greenBG, - textColor: greenText, - _hover: { bg: greenHover, textColor: greenHoverText }, + bg: 'lilac-0', + textColor: 'cosmic-nebula-0', + _hover: { bg: 'lilac--1', textColor: 'cosmic-nebula-0' }, }, [FractalProposalState.MODULE]: { tooltipKey: 'stateModuleTip', - bg: greenBG, - textColor: greenText, - _hover: { bg: greenHover, textColor: greenHoverText }, + bg: 'lilac-0', + textColor: 'cosmic-nebula-0', + _hover: { bg: 'lilac--1', textColor: 'cosmic-nebula-0' }, }, [FractalProposalState.EXPIRED]: { tooltipKey: 'stateExpiredTip', - bg: redBG, - textColor: redText, - _hover: { bg: redHover, textColor: redHoverText }, + bg: 'neutral-4', + textColor: 'neutral-7', + _hover: { bg: 'neutral-2', textColor: 'neutral-7' }, }, [FractalProposalState.REJECTED]: { tooltipKey: 'stateRejectedTip', - bg: redBG, - textColor: redText, - _hover: { bg: redHover, textColor: redHoverText }, + bg: 'red-0', + textColor: 'red-4', + _hover: { bg: 'red--1', textColor: 'red-4' }, }, [FractalProposalState.PENDING]: { tooltipKey: 'statePendingTip', - bg: sandBG, - textColor: sandText, - _hover: { bg: sandHover, textColor: sandHoverText }, + bg: 'yellow-0', + textColor: 'black-0', + _hover: { bg: 'yellow-0', textColor: 'yellow--2' }, }, [FractalProposalState.CLOSED]: { tooltipKey: 'stateClosedTip', - bg: grayBG, - textColor: '#000', - _hover: { bg: grayHover, textColor: '#000' }, + bg: 'neutral-8', + textColor: 'neutral-4', + _hover: { bg: 'neutral-7', textColor: 'neutral-4' }, }, [DAOState.freezeInit]: { tooltipKey: 'stateFreezeInitTip', - bg: freezeBG, - textColor: freezeText, - _hover: { bg: freezeHover, textColor: freezeHoverText }, + bg: 'blue-2', + textColor: 'blue-0', + _hover: { bg: 'blue-1', textColor: 'blue-0' }, }, [DAOState.frozen]: { tooltipKey: 'stateFrozenTip', - bg: frozenBG, - textColor: frozenText, - _hover: { bg: frozenHover, textColor: frozenHoverText }, + bg: 'blue-1', + textColor: 'blue--1', + _hover: { bg: 'blue-2', textColor: 'blue--1' }, }, ownerApproved: { - bg: 'sand.700', - textColor: sandText, - _hover: { bg: sandBG, textColor: sandHoverText }, + bg: 'yellow-0', + textColor: 'black-0', + _hover: { bg: 'yellow-0', textColor: 'yellow--2' }, }, }; @@ -169,7 +141,7 @@ export function Badge({ labelKey, size, proposal }: IBadge) { h="0.5rem" /> {t(labelKey)} @@ -179,7 +151,7 @@ export function Badge({ labelKey, size, proposal }: IBadge) { proposal={proposal} showIcon={false} textColor={colors.textColor} - textStyle="text-md-sans-regular" + textStyle="label-base" /> )} diff --git a/src/components/ui/badges/QuorumBadge.tsx b/src/components/ui/badges/QuorumBadge.tsx index e13e21e307..36a11a4f71 100644 --- a/src/components/ui/badges/QuorumBadge.tsx +++ b/src/components/ui/badges/QuorumBadge.tsx @@ -10,8 +10,6 @@ import { SnapshotProposal, } from '../../../types'; -const quorumNotReachedColor = '#838383'; -const quorumReachedColor = '#56A355'; export default function QuorumBadge({ proposal }: { proposal: FractalProposal }) { const { governance } = useFractal(); const { t } = useTranslation('common'); @@ -66,12 +64,11 @@ export default function QuorumBadge({ proposal }: { proposal: FractalProposal }) reachedQuorum : reachedQuorum >= totalQuorum; - const displayColor = - totalVotesCasted !== 0n && meetsQuorum ? quorumReachedColor : quorumNotReachedColor; + const displayColor = totalVotesCasted !== 0n && meetsQuorum ? 'celery--3' : 'neutral-7'; return ( {title} @@ -33,6 +34,8 @@ export default function Breadcrumbs({ links }: BreadcrumbsProps) { {isCurrentPage ? ( crumbText @@ -42,7 +45,6 @@ export default function Breadcrumbs({ links }: BreadcrumbsProps) { to={path} display="flex" alignItems="center" - color={isCurrentPage ? 'neutral-7' : 'neutral-6'} _hover={{ textDecoration: 'none', color: 'neutral-7' }} // Guessed. Probaby incorrect, couldn't find on figma > {crumbText} diff --git a/src/i18n/locales/en/breadcrumbs.json b/src/i18n/locales/en/breadcrumbs.json index 9993f4fa21..e2871a2631 100644 --- a/src/i18n/locales/en/breadcrumbs.json +++ b/src/i18n/locales/en/breadcrumbs.json @@ -1,6 +1,6 @@ { "headerTitle": "{{daoName}} {{subject}}", - "proposals": "Proposals", + "proposals": "All Proposals", "proposalNew": "New Proposal", "nodes": "Hierarchy", "treasury": "Treasury", From debcc6eff4f31b5a4de00efc3d45ffb91fe7e3c1 Mon Sep 17 00:00:00 2001 From: Kellar Date: Fri, 26 Apr 2024 13:06:44 +0100 Subject: [PATCH 20/36] minor updates --- .../DaoSettings/components/ERC20TokenContainer.tsx | 1 - .../DaoSettings/components/MetadataContainer.tsx | 1 - .../components/Signers/SignersContainer.tsx | 14 ++++---------- .../Signers/modals/RemoveSignerModal.tsx | 2 +- src/components/ui/links/DisplayAddress.tsx | 9 ++++++--- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx b/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx index 4b503ef159..14823e62aa 100644 --- a/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx +++ b/src/components/pages/DaoSettings/components/ERC20TokenContainer.tsx @@ -51,7 +51,6 @@ export function ERC20TokenContainer() { {/* TOTAL SUPPLY */} - {' '} diff --git a/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx b/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx index 413598a455..3e9329c6c5 100644 --- a/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx +++ b/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx @@ -18,8 +18,8 @@ function Signer({ signer, disabled }: { signer: string; disabled: boolean }) { {!disabled && ( - + {t('signersRequired', { ns: 'common' })} - {`${safe?.threshold}/${safe?.owners.length}`} + {`${safe?.threshold}/${safe?.owners.length}`} } descriptionContent={t('signersDescription')} diff --git a/src/components/pages/DaoSettings/components/Signers/modals/RemoveSignerModal.tsx b/src/components/pages/DaoSettings/components/Signers/modals/RemoveSignerModal.tsx index 52bfcacb54..07f662b829 100644 --- a/src/components/pages/DaoSettings/components/Signers/modals/RemoveSignerModal.tsx +++ b/src/components/pages/DaoSettings/components/Signers/modals/RemoveSignerModal.tsx @@ -158,7 +158,7 @@ function RemoveSignerModal({ - + {children || displayAddress.displayName} - + ); From 781a7a84c0a4afeb5ca801a5b90fa632de166e0b Mon Sep 17 00:00:00 2001 From: Kellar Date: Fri, 26 Apr 2024 13:17:10 +0100 Subject: [PATCH 21/36] Reskin updateSignerWarning box --- public/images/alert-triangle.svg | 3 -- .../Signers/modals/AddSignerModal.tsx | 49 ++++++++++++------- .../Signers/modals/RemoveSignerModal.tsx | 8 +-- 3 files changed, 32 insertions(+), 28 deletions(-) delete mode 100644 public/images/alert-triangle.svg diff --git a/public/images/alert-triangle.svg b/public/images/alert-triangle.svg deleted file mode 100644 index 817caf48c1..0000000000 --- a/public/images/alert-triangle.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/components/pages/DaoSettings/components/Signers/modals/AddSignerModal.tsx b/src/components/pages/DaoSettings/components/Signers/modals/AddSignerModal.tsx index ecbac3c7e7..e5c54dd6c0 100644 --- a/src/components/pages/DaoSettings/components/Signers/modals/AddSignerModal.tsx +++ b/src/components/pages/DaoSettings/components/Signers/modals/AddSignerModal.tsx @@ -5,11 +5,10 @@ import { HStack, Select, Text, - Alert, - AlertTitle, - Image, + Icon, } from '@chakra-ui/react'; import { LabelWrapper } from '@decent-org/fractal-ui'; +import { WarningCircle } from '@phosphor-icons/react'; import { Field, FieldAttributes, Formik } from 'formik'; import { useCallback, useRef } from 'react'; import { useTranslation } from 'react-i18next'; @@ -148,22 +147,34 @@ function AddSignerModal({ )}`} - - alert triangle - - {t('updateSignerWarning', { ns: 'modals' })} - - + + + + + + {t('updateSignerWarning', { ns: 'modals' })} + + + + - + {t('updateThreshold', { ns: 'modals' })} @@ -158,7 +155,7 @@ function RemoveSignerModal({ From b2275f4081f77b1e0c5f7dfa6666c6ea53bc66c3 Mon Sep 17 00:00:00 2001 From: Kellar Date: Fri, 26 Apr 2024 13:17:27 +0100 Subject: [PATCH 22/36] Prettier --- .../components/Signers/SignersContainer.tsx | 4 +- .../Signers/modals/AddSignerModal.tsx | 67 +++++++------------ .../Signers/modals/RemoveSignerModal.tsx | 4 +- 3 files changed, 28 insertions(+), 47 deletions(-) diff --git a/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx b/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx index 3e9329c6c5..27832c6b9c 100644 --- a/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx +++ b/src/components/pages/DaoSettings/components/Signers/SignersContainer.tsx @@ -113,9 +113,7 @@ export function SignersContainer() { } descriptionHeader={ - - {t('signersRequired', { ns: 'common' })} - + {t('signersRequired', { ns: 'common' })} {`${safe?.threshold}/${safe?.owners.length}`} } diff --git a/src/components/pages/DaoSettings/components/Signers/modals/AddSignerModal.tsx b/src/components/pages/DaoSettings/components/Signers/modals/AddSignerModal.tsx index e5c54dd6c0..1796fc8229 100644 --- a/src/components/pages/DaoSettings/components/Signers/modals/AddSignerModal.tsx +++ b/src/components/pages/DaoSettings/components/Signers/modals/AddSignerModal.tsx @@ -1,12 +1,4 @@ -import { - Box, - Button, - Flex, - HStack, - Select, - Text, - Icon, -} from '@chakra-ui/react'; +import { Box, Button, Flex, HStack, Select, Text, Icon } from '@chakra-ui/react'; import { LabelWrapper } from '@decent-org/fractal-ui'; import { WarningCircle } from '@phosphor-icons/react'; import { Field, FieldAttributes, Formik } from 'formik'; @@ -102,12 +94,7 @@ function AddSignerModal({ mb={4} /> - - {t('updateThreshold', { ns: 'modals' })} - + {t('updateThreshold', { ns: 'modals' })} - - - - - - {t('updateSignerWarning', { ns: 'modals' })} - - + + + + {t('updateSignerWarning', { ns: 'modals' })} + + - - {t('updateThreshold', { ns: 'modals' })} - + {t('updateThreshold', { ns: 'modals' })} Date: Fri, 26 Apr 2024 13:49:37 +0100 Subject: [PATCH 23/36] cleanup --- .../pages/DaoSettings/components/ModulesContainer.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/pages/DaoSettings/components/ModulesContainer.tsx b/src/components/pages/DaoSettings/components/ModulesContainer.tsx index 64fbf629d6..59e4e47b83 100644 --- a/src/components/pages/DaoSettings/components/ModulesContainer.tsx +++ b/src/components/pages/DaoSettings/components/ModulesContainer.tsx @@ -26,11 +26,7 @@ export function ModulesContainer() { descriptionHeader={t('modulesAndGuardsTitle')} descriptionContent={ <> - + {t('modulesAndGuardsDescription1')} Date: Fri, 26 Apr 2024 09:29:15 -0400 Subject: [PATCH 24/36] Remove unnecessary brackets, put rounded corners on Image component --- src/components/ui/page/Header/Avatar.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/ui/page/Header/Avatar.tsx b/src/components/ui/page/Header/Avatar.tsx index b182a0c488..51cdc1874c 100644 --- a/src/components/ui/page/Header/Avatar.tsx +++ b/src/components/ui/page/Header/Avatar.tsx @@ -16,12 +16,11 @@ function BlockieAvatar({ address, size }: { size: AvatarSize; address: string }) - {address} ); From 5bba169dc66bb2d3facb517f0c5b8d61b739407f Mon Sep 17 00:00:00 2001 From: Kellar Date: Fri, 26 Apr 2024 14:40:42 +0100 Subject: [PATCH 25/36] Reskin signers' radio buttons --- .../components/ModulesContainer.tsx | 4 +--- .../components/Signers/SignersContainer.tsx | 19 +++++++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/components/pages/DaoSettings/components/ModulesContainer.tsx b/src/components/pages/DaoSettings/components/ModulesContainer.tsx index 59e4e47b83..02cad50cc5 100644 --- a/src/components/pages/DaoSettings/components/ModulesContainer.tsx +++ b/src/components/pages/DaoSettings/components/ModulesContainer.tsx @@ -26,9 +26,7 @@ export function ModulesContainer() { descriptionHeader={t('modulesAndGuardsTitle')} descriptionContent={ <> - - {t('modulesAndGuardsDescription1')} - + {t('modulesAndGuardsDescription1')} )} Date: Fri, 26 Apr 2024 16:30:20 +0100 Subject: [PATCH 26/36] Fix helper text size --- src/components/ProposalBuilder/ProposalTransaction.tsx | 2 +- src/components/ProposalBuilder/ProposalTransactions.tsx | 2 +- src/components/ProposalBuilder/index.tsx | 6 +++--- src/components/ui/forms/InputComponent.tsx | 1 + .../daos/[daoAddress]/proposal-templates/new/index.tsx | 2 +- src/pages/daos/[daoAddress]/proposals/new/index.tsx | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/ProposalBuilder/ProposalTransaction.tsx b/src/components/ProposalBuilder/ProposalTransaction.tsx index 7f0a7c14fe..3498ffc450 100644 --- a/src/components/ProposalBuilder/ProposalTransaction.tsx +++ b/src/components/ProposalBuilder/ProposalTransaction.tsx @@ -75,7 +75,7 @@ export default function ProposalTransaction({ isRequired disabled={transactionPending} subLabel={ - + {t('example', { ns: 'common' })}: yourdomain.eth {t('or', { ns: 'common' })} diff --git a/src/components/ProposalBuilder/ProposalTransactions.tsx b/src/components/ProposalBuilder/ProposalTransactions.tsx index 4bba04bb31..ea5e09a7fc 100644 --- a/src/components/ProposalBuilder/ProposalTransactions.tsx +++ b/src/components/ProposalBuilder/ProposalTransactions.tsx @@ -41,7 +41,7 @@ export default function ProposalTransactions({ const removeTransaction = (transactionIndex: number) => { setFieldValue( 'transactions', - transactions.filter((tx, i) => i !== transactionIndex), + transactions.filter((_, i) => i !== transactionIndex), ); }; return ( diff --git a/src/components/ProposalBuilder/index.tsx b/src/components/ProposalBuilder/index.tsx index cc1ec9cf46..7d51ce71c9 100644 --- a/src/components/ProposalBuilder/index.tsx +++ b/src/components/ProposalBuilder/index.tsx @@ -19,17 +19,17 @@ import ProposalMetadata from './ProposalMetadata'; import ProposalTransactionsForm from './ProposalTransactionsForm'; import StateButtons from './StateButtons'; -interface IProposalBuilder { +interface ProposalBuilderProps { mode: ProposalBuilderMode; prepareProposalData: (values: CreateProposalForm) => Promise; initialValues: CreateProposalForm; } -export default function ProposalBuilder({ +export function ProposalBuilder({ mode, initialValues, prepareProposalData, -}: IProposalBuilder) { +}: ProposalBuilderProps) { const [formState, setFormState] = useState(CreateProposalState.METADATA_FORM); const { t } = useTranslation(['proposalTemplate', 'proposal']); diff --git a/src/components/ui/forms/InputComponent.tsx b/src/components/ui/forms/InputComponent.tsx index 9bef1f07bd..d9ff8d5a6d 100644 --- a/src/components/ui/forms/InputComponent.tsx +++ b/src/components/ui/forms/InputComponent.tsx @@ -89,6 +89,7 @@ export function LabelComponent(props: Omit) { )} {helperSlot === 'start' && {helper}} + Date: Fri, 26 Apr 2024 16:23:29 -0400 Subject: [PATCH 27/36] Remove unused variable --- src/models/AzoriusTxBuilder.ts | 3 --- src/models/TxBuilderFactory.ts | 1 - 2 files changed, 4 deletions(-) diff --git a/src/models/AzoriusTxBuilder.ts b/src/models/AzoriusTxBuilder.ts index cc919d50b4..2d89f37044 100644 --- a/src/models/AzoriusTxBuilder.ts +++ b/src/models/AzoriusTxBuilder.ts @@ -25,7 +25,6 @@ import { generateContractByteCodeLinear, generateSalt } from './helpers/utils'; export class AzoriusTxBuilder extends BaseTxBuilder { private readonly safeContract: GnosisSafeL2; - private readonly predictedSafeAddress: string; private encodedSetupTokenData: string | undefined; private encodedSetupERC20WrapperData: string | undefined; @@ -54,7 +53,6 @@ export class AzoriusTxBuilder extends BaseTxBuilder { azoriusContracts: AzoriusContracts, daoData: AzoriusERC20DAO | AzoriusERC721DAO, safeContract: GnosisSafeL2, - predictedSafeAddress: string, parentAddress?: string, parentTokenAddress?: string, ) { @@ -68,7 +66,6 @@ export class AzoriusTxBuilder extends BaseTxBuilder { ); this.safeContract = safeContract; - this.predictedSafeAddress = predictedSafeAddress; this.tokenNonce = getRandomBytes(); this.claimNonce = getRandomBytes(); diff --git a/src/models/TxBuilderFactory.ts b/src/models/TxBuilderFactory.ts index 392452bb2d..c452b0a902 100644 --- a/src/models/TxBuilderFactory.ts +++ b/src/models/TxBuilderFactory.ts @@ -130,7 +130,6 @@ export class TxBuilderFactory extends BaseTxBuilder { this.azoriusContracts!, this.daoData as AzoriusERC20DAO, this.safeContract!, - this.predictedSafeAddress!, this.parentAddress, this.parentTokenAddress, ); From 2df103fd3ceae4e4a1207c3007822454e38b1cd2 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Fri, 26 Apr 2024 16:39:24 -0400 Subject: [PATCH 28/36] Add missing abi parameter on "setUp" encoding for ERC20Claim --- src/models/AzoriusTxBuilder.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/models/AzoriusTxBuilder.ts b/src/models/AzoriusTxBuilder.ts index 2d89f37044..a6c860dd38 100644 --- a/src/models/AzoriusTxBuilder.ts +++ b/src/models/AzoriusTxBuilder.ts @@ -346,8 +346,9 @@ export class AzoriusTxBuilder extends BaseTxBuilder { private setEncodedSetupTokenClaimData() { const azoriusGovernanceDaoData = this.daoData as AzoriusERC20DAO; const encodedInitTokenData = defaultAbiCoder.encode( - ['address', 'address', 'address', 'uint256'], + ['uint32', 'address', 'address', 'address', 'uint256'], [ + 0, // deadlineBlock. do we capture this in the UI? this.safeContract.address, this.parentTokenAddress, this.predictedTokenAddress, From e0b112665510ff184e21790d6382f14327e4a328 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Fri, 26 Apr 2024 16:40:12 -0400 Subject: [PATCH 29/36] Clean up ABI encoding for a couple of contract calls, but I bet they do work currently, the code is just misleading --- src/models/FreezeGuardTxBuilder.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/models/FreezeGuardTxBuilder.ts b/src/models/FreezeGuardTxBuilder.ts index 666c531c86..a2ef2b21be 100644 --- a/src/models/FreezeGuardTxBuilder.ts +++ b/src/models/FreezeGuardTxBuilder.ts @@ -217,7 +217,7 @@ export class FreezeGuardTxBuilder extends BaseTxBuilder { 'setUp', [ ethers.utils.defaultAbiCoder.encode( - ['uint256', 'uint256', 'address', 'address', 'address'], + ['uint32', 'uint32', 'address', 'address', 'address'], [ subDaoData.timelockPeriod, // Timelock Period subDaoData.executionPeriod, // Execution Period @@ -231,19 +231,14 @@ export class FreezeGuardTxBuilder extends BaseTxBuilder { } private setFreezeGuardCallDataAzorius() { - const subDaoData = this.daoData as SubDAO; - this.freezeGuardCallData = AzoriusFreezeGuard__factory.createInterface().encodeFunctionData( 'setUp', [ ethers.utils.defaultAbiCoder.encode( - ['address', 'address', 'address', 'address', 'uint256'], + ['address', 'address'], [ this.parentAddress, // Owner -- Parent DAO this.freezeVotingAddress, // Freeze Voting - this.strategyAddress, // Base Strategy - this.azoriusAddress, // Azorius - subDaoData.executionPeriod, // Execution Period ], ), ], From 667bb65e9a8a23f97399188f3b50d17222dc8570 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Fri, 26 Apr 2024 21:50:45 -0400 Subject: [PATCH 30/36] Clean up a comment on a magic number --- src/models/AzoriusTxBuilder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/AzoriusTxBuilder.ts b/src/models/AzoriusTxBuilder.ts index a6c860dd38..64a1b39868 100644 --- a/src/models/AzoriusTxBuilder.ts +++ b/src/models/AzoriusTxBuilder.ts @@ -348,7 +348,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { const encodedInitTokenData = defaultAbiCoder.encode( ['uint32', 'address', 'address', 'address', 'uint256'], [ - 0, // deadlineBlock. do we capture this in the UI? + 0, // deadlineBlock. We don't capture this in the UI. 0 means no deadline to claim. this.safeContract.address, this.parentTokenAddress, this.predictedTokenAddress, From 10661f869396ca568d63a305cecc0eaf1f84d0d8 Mon Sep 17 00:00:00 2001 From: Kellar Date: Mon, 29 Apr 2024 13:50:05 +0100 Subject: [PATCH 31/36] cleanup --- .../pages/DaoSettings/components/MetadataContainer.tsx | 1 - .../pages/DaoSettings/components/ModulesContainer.tsx | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/components/pages/DaoSettings/components/MetadataContainer.tsx b/src/components/pages/DaoSettings/components/MetadataContainer.tsx index 3906152dfd..fc2cf57636 100644 --- a/src/components/pages/DaoSettings/components/MetadataContainer.tsx +++ b/src/components/pages/DaoSettings/components/MetadataContainer.tsx @@ -141,7 +141,6 @@ export function MetadataContainer() {