Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v0.4.0 #2644

Open
wants to merge 94 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
5e64ab2
Refactor network configuration handling and introduce Zustand store f…
Da-Colon Dec 5, 2024
44e090b
Refactor network configuration imports to use new Zustand store
Da-Colon Dec 5, 2024
1915478
Remove unused network configuration hook and clean up imports
Da-Colon Dec 5, 2024
dae8741
Refactor SafeMenuItem and related hooks to simplify network handling …
Da-Colon Dec 5, 2024
dc95f17
Refactor DaoHierarchyNode to remove unused chainId and streamline net…
Da-Colon Dec 5, 2024
19dcca0
Merge branch 'develop' of github.com:decentdao/decent-interface into …
Da-Colon Dec 6, 2024
c894027
refactor: simplify WalletMenu component by removing containerRef prop
Da-Colon Dec 6, 2024
32e1ec5
refactor: update network config hook usage to useNetworkConfigStore
Da-Colon Dec 6, 2024
047d978
refactor: reorganize DAOInfoCard layout by grouping FavoriteIcon and …
Da-Colon Dec 6, 2024
2e3b524
refactor: add network icon to DAOInfoCard component
Da-Colon Dec 6, 2024
1091123
refactor: rename NetworkSelector component and update import paths
Da-Colon Dec 6, 2024
1845811
feat: add DropdownMenu component and remove obsolete NetworkSelector
Da-Colon Dec 6, 2024
d226d81
refactor: streamline DAOInfoCard component by enhancing layout and im…
Da-Colon Dec 6, 2024
0ff3f84
refactor: update network configuration to use mainnet instead of sepolia
Da-Colon Dec 6, 2024
736377c
feat: implement DropdownMenu for network selection in EstablishEssent…
Da-Colon Dec 6, 2024
30d8411
refactor: adjust label alignment in EstablishEssentials component
Da-Colon Dec 6, 2024
e2197ba
refactor: adjust icon size and text style in DropdownMenu component
Da-Colon Dec 6, 2024
f3f971e
Merge branch 'develop' of github.com:decentdao/decent-interface into …
Da-Colon Dec 6, 2024
56b0eda
feat: implement dynamic Wagmi configuration and update providers to u…
Da-Colon Dec 6, 2024
a3f879b
refactor: remove unused dynamic Wagmi configuration hook
Da-Colon Dec 7, 2024
999f0f6
feat: integrate automatic chain switching and update Wagmi configurat…
Da-Colon Dec 7, 2024
3d324ce
Refactor useHatsTree and useKeyValuePairs hooks to remove unused vari…
Da-Colon Dec 9, 2024
d1f5bb0
Add error handling for smart account predictions and validate smart a…
Da-Colon Dec 9, 2024
fb9c751
feat: integrate chain switching functionality in EstablishEssentials …
Da-Colon Dec 10, 2024
af55ec0
Merge branch 'issue/noIssue-state-loading-cleanup' of github.com:dece…
Da-Colon Dec 10, 2024
d11ff98
Merge branch 'issue/2565-network-config-updates' of github.com:decent…
Da-Colon Dec 10, 2024
5adc033
Update useHatsTree hook to accept safeAddress parameter and adjust re…
Da-Colon Dec 11, 2024
5337915
Merge branch 'issue/noIssue-state-loading-cleanup' of github.com:dece…
Da-Colon Dec 11, 2024
c05f818
Merge branch 'issue/2565-network-config-updates' of github.com:decent…
Da-Colon Dec 11, 2024
23cab88
Delay setting current config after switching chain to ensure proper s…
Da-Colon Dec 12, 2024
9094eb3
Remove SafesList component and its associated logic
Da-Colon Dec 12, 2024
17bc618
Add null check for modules and improve safeAddress validation in useG…
Da-Colon Dec 12, 2024
fc918d5
Merge branch 'issue/noIssue-state-loading-cleanup' of github.com:dece…
Da-Colon Dec 12, 2024
9f2ffaf
Merge branch 'issue/2565-network-config-updates' of github.com:decent…
Da-Colon Dec 12, 2024
32c9961
Add error handling for uninitialized modules in useGovernanceContract…
Da-Colon Dec 12, 2024
d76ec5b
Refactor loadGovernanceContracts to accept daoModules parameter
Da-Colon Dec 12, 2024
113d28f
Update error message for invalid DAO search to reflect support for al…
Da-Colon Dec 13, 2024
d2319e5
Enhance useIsSafe hook to search across all supported networks and re…
Da-Colon Dec 13, 2024
2bb83c1
Refactor DAOSearch to display multiple network prefixes in SearchDisp…
Da-Colon Dec 13, 2024
8dab85b
Refactor DAOSearch component to remove extra gap
Da-Colon Dec 13, 2024
25866db
Refactor useGovernanceContracts to streamline token address assignmen…
Da-Colon Dec 13, 2024
9dbe57e
Merge branch 'develop' of github.com:decentdao/decent-interface into …
Da-Colon Dec 13, 2024
ef7a3de
revert: changes made to hook.
Da-Colon Dec 13, 2024
2118a5d
Add useResolveAddressMultiChain hook for multi-chain address resolution
Da-Colon Dec 14, 2024
1e8292a
Refactor DAOSearch to use resolved addresses with chain IDs and updat…
Da-Colon Dec 14, 2024
a25fd55
move translation initialization
Da-Colon Dec 14, 2024
8dace81
Remove 'wrongNetwork' type from LoadingProblem component and its usag…
Da-Colon Dec 14, 2024
d4aff40
resetHats store when safeAddress changes
Da-Colon Dec 14, 2024
4e673cb
remove role store reset, since its not in useKeyValuePairs
Da-Colon Dec 14, 2024
359cb0e
Merge branch 'develop' of github.com:decentdao/decent-interface into …
Da-Colon Dec 14, 2024
0352fdd
Merge branch 'issue/noIssue-state-loading-cleanup' of github.com:dece…
Da-Colon Dec 14, 2024
5b8556b
Merge branch 'issue/2565-network-config-updates' of github.com:decent…
Da-Colon Dec 14, 2024
992c141
Merge branch 'issue/2565-network-config-extended' of github.com:decen…
Da-Colon Dec 14, 2024
921c1df
Merge branch 'release/v0.3.13' into develop
adamgall Dec 16, 2024
89b2989
Merge pull request #2630 from decentdao/issue/2565-cross-chain-dao-se…
Da-Colon Dec 16, 2024
c7b41c5
Merge pull request #2609 from decentdao/issue/2565-network-config-ext…
Da-Colon Dec 16, 2024
be9678e
Fix color of "My DAOs" button in header
adamgall Dec 16, 2024
cb0e07f
We only really need to search for ENS names on mainnet
adamgall Dec 16, 2024
cba45d2
Merge pull request #2636 from decentdao/only-mainnet-ens-search
Da-Colon Dec 16, 2024
c44efe8
Refactor useResolveAddressMultiChain to utilize mainnet client for EN…
Da-Colon Dec 16, 2024
6cdc66e
Rename useResolveAddressMultiChain to useResolveENSName and refactor …
Da-Colon Dec 16, 2024
8fc85e2
Refactor useSearchDao to utilize useResolveENSName for address resolu…
Da-Colon Dec 16, 2024
98d5e0a
Refactor useSearchDao to use resolveENSName for address resolution an…
Da-Colon Dec 16, 2024
30b14dc
remove try/catch
Da-Colon Dec 16, 2024
5d4c6fd
Merge pull request #2637 from decentdao/issue/2565-resolve-mainnet-ens
Da-Colon Dec 16, 2024
8d66374
Merge pull request #2635 from decentdao/my-daos-color
adamgall Dec 16, 2024
3a6d01e
wait for wallet to be fetch before trying to switch chain
Da-Colon Dec 17, 2024
63c1575
refactor: update useWalletClient to use isFetchedAfterMount for chain…
Da-Colon Dec 17, 2024
fec54ef
Merge pull request #2595 from decentdao/issue/2565-network-config-upd…
Da-Colon Dec 17, 2024
16f83aa
Merge branch 'develop' into issue/noIssue-state-loading-cleanup
Da-Colon Dec 17, 2024
fa6c333
Merge pull request #2615 from decentdao/issue/noIssue-state-loading-c…
Da-Colon Dec 17, 2024
a084dbc
Fix arrow color
adamgall Dec 17, 2024
929838a
Make both buttons in header look and behave the same
adamgall Dec 17, 2024
b921b82
Refactor useKeyValuePairs to check for undefined safeAddress before r…
Da-Colon Dec 18, 2024
264e14e
remove streams retreival from `useHatsTree`
Da-Colon Dec 18, 2024
2ac122d
update getHatsTree to also retrieve payment data in one go
Da-Colon Dec 18, 2024
f226c83
refactor useHatsTree to replace 'props' with 'params' for consistency
Da-Colon Dec 18, 2024
b23c8de
Cleanup dependency array
DarksightKellar Dec 18, 2024
41a83d9
cleanup some role types
DarksightKellar Dec 18, 2024
039ac72
Fix undefined bug
DarksightKellar Dec 18, 2024
877aa66
Fix Address xyz is invalid bug
DarksightKellar Dec 18, 2024
9f0017d
Add chain switching logic in EstablishEssentials component
Da-Colon Dec 18, 2024
b7f0048
actually switch network when selected
Da-Colon Dec 18, 2024
0cefdf3
Merge pull request #2640 from decentdao/issue/2638-cleanup
DarksightKellar Dec 18, 2024
8ceb565
refactor useHatsTree to optimize key loading logic and incorporate sa…
Da-Colon Dec 18, 2024
ee07371
update base logo
Da-Colon Dec 18, 2024
e87860e
Merge pull request #2641 from decentdao/ENG-45-fix-address-invalid
DarksightKellar Dec 19, 2024
e72e445
Don't try to load hats tree if loaded DAO is stuck with the same hats…
DarksightKellar Dec 19, 2024
f4a8fa8
cleanup
DarksightKellar Dec 19, 2024
f2a0710
Merge pull request #2639 from decentdao/issue/2638-unwanted-toasts
adamgall Dec 19, 2024
b4b0a95
Merge pull request #2643 from decentdao/issue/2623-update-base-logo
adamgall Dec 19, 2024
a0773eb
Update dependency array in EstablishEssentials to include addressPrefix
Da-Colon Dec 19, 2024
327c957
Merge pull request #2642 from decentdao/bugfix-create-dao-networkswit…
adamgall Dec 19, 2024
2d6f76d
Bump version to 0.4.0
adamgall Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion netlify/shared/moralisBalances.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Store } from '@netlify/blobs';
import Moralis from 'moralis';
import { isAddress } from 'viem';
import type { Address } from 'viem';
import { moralisSupportedChainIds } from '../../src/providers/NetworkConfig/NetworkConfigProvider';
import { moralisSupportedChainIds } from '../../src/providers/NetworkConfig/useNetworkConfigStore';

export interface BalanceDataWithMetadata<T> {
data: T[];
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "decent-interface",
"version": "0.3.13",
"version": "0.4.0",
"private": true,
"dependencies": {
"@amplitude/analytics-browser": "^2.11.1",
Expand Down
13 changes: 5 additions & 8 deletions public/images/coin-icon-base.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/DAOTreasury/components/Transactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
import { getAddress } from 'viem';
import { useDateTimeDisplay } from '../../../helpers/dateTime';
import { useFractal } from '../../../providers/App/AppProvider';
import { useNetworkConfig } from '../../../providers/NetworkConfig/NetworkConfigProvider';
import { useNetworkConfigStore } from '../../../providers/NetworkConfig/useNetworkConfigStore';
import { useDaoInfoStore } from '../../../store/daoInfo/useDaoInfoStore';
import { TokenEventType, TransferDisplayData, TransferType } from '../../../types';
import { DecentTooltip } from '../../ui/DecentTooltip';
Expand All @@ -14,7 +14,7 @@ import { BarLoader } from '../../ui/loaders/BarLoader';

function TransferRow({ displayData }: { displayData: TransferDisplayData }) {
const { t } = useTranslation(['treasury', 'common']);
const { etherscanBaseURL } = useNetworkConfig();
const { etherscanBaseURL } = useNetworkConfigStore();

return (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import LidoWithdrawalQueueAbi from '../../../assets/abi/LidoWithdrawalQueueAbi';
import useLidoStaking from '../../../hooks/stake/lido/useLidoStaking';
import { useCanUserCreateProposal } from '../../../hooks/utils/useCanUserSubmitProposal';
import { useFractal } from '../../../providers/App/AppProvider';
import { useNetworkConfig } from '../../../providers/NetworkConfig/NetworkConfigProvider';
import { useNetworkConfigStore } from '../../../providers/NetworkConfig/useNetworkConfigStore';
import { ModalType } from '../../ui/modals/ModalProvider';
import { useDecentModal } from '../../ui/modals/useDecentModal';

Expand All @@ -16,7 +16,7 @@ export default function useTreasuryLidoInteractions() {
const ethAsset = assetsFungible.find(asset => !asset.tokenAddress);
const { handleUnstake, handleClaimUnstakedETH } = useLidoStaking();
const { canUserCreateProposal } = useCanUserCreateProposal();
const { staking } = useNetworkConfig();
const { staking } = useNetworkConfigStore();
const publicClient = usePublicClient();

// --- Lido Stake button setup ---
Expand Down
4 changes: 2 additions & 2 deletions src/components/DaoCreator/StepController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
import { Navigate, Route, Routes, useLocation } from 'react-router-dom';
import { toast } from 'sonner';
import { useAccount } from 'wagmi';
import { useNetworkConfig } from '../../providers/NetworkConfig/NetworkConfigProvider';
import { useNetworkConfigStore } from '../../providers/NetworkConfig/useNetworkConfigStore';
import {
ChildERC20Steps,
ChildERC721Steps,
Expand All @@ -25,7 +25,7 @@ import useStepRedirect from './hooks/useStepRedirect';

function StepController(props: Omit<ICreationStepProps, 'steps'>) {
const { t } = useTranslation('daoCreate');
const { createOptions } = useNetworkConfig();
const { createOptions } = useNetworkConfigStore();
const location = useLocation();

const { values, mode, setFieldValue } = props;
Expand Down
4 changes: 2 additions & 2 deletions src/components/DaoCreator/StepWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { BASE_ROUTES, DAO_ROUTES } from '../../constants/routes';
import { useNetworkConfig } from '../../providers/NetworkConfig/NetworkConfigProvider';
import { useNetworkConfigStore } from '../../providers/NetworkConfig/useNetworkConfigStore';
import { useDaoInfoStore } from '../../store/daoInfo/useDaoInfoStore';
import { CreatorSteps } from '../../types';
import PageHeader from '../ui/page/Header/PageHeader';
Expand Down Expand Up @@ -49,7 +49,7 @@ export function StepWrapper({
shouldWrapChildren = true,
}: IStepWrapper) {
const { safe } = useDaoInfoStore();
const { addressPrefix } = useNetworkConfig();
const { addressPrefix } = useNetworkConfigStore();
const { t } = useTranslation(['breadcrumbs']);
const navigate = useNavigate();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ export function AzoriusTokenDetails(props: ICreationStepProps) {
let tokenErrorMsg = '';

if (touched.erc20Token?.tokenImportAddress) {
console.log(errors?.erc20Token?.tokenImportAddress);

tokenErrorMsg =
errors?.erc20Token?.tokenImportAddress ||
(!isImportedVotesToken ? t('errorNotVotingToken') : '');
Expand Down
86 changes: 83 additions & 3 deletions src/components/DaoCreator/formComponents/EstablishEssentials.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import { Box, Input, RadioGroup } from '@chakra-ui/react';
import { Box, Flex, Icon, Image, Input, RadioGroup } from '@chakra-ui/react';
import { CheckCircle } from '@phosphor-icons/react';
import debounce from 'lodash.debounce';
import { useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useChainId, useSwitchChain } from 'wagmi';
import { createAccountSubstring } from '../../../hooks/utils/useGetAccountName';
import { useNetworkConfig } from '../../../providers/NetworkConfig/NetworkConfigProvider';
import {
supportedNetworks,
useNetworkConfigStore,
} from '../../../providers/NetworkConfig/useNetworkConfigStore';
import { useDaoInfoStore } from '../../../store/daoInfo/useDaoInfoStore';
import { GovernanceType, ICreationStepProps, VotingStrategyType } from '../../../types';
import { getChainIdFromPrefix, getNetworkIcon } from '../../../utils/url';
import { InputComponent, LabelComponent } from '../../ui/forms/InputComponent';
import LabelWrapper from '../../ui/forms/LabelWrapper';
import { RadioWithText } from '../../ui/forms/Radio/RadioWithText';
import { DropdownMenu } from '../../ui/menus/DropdownMenu';
import { StepButtons } from '../StepButtons';
import { StepWrapper } from '../StepWrapper';

Expand Down Expand Up @@ -65,7 +72,9 @@ export function EstablishEssentials(props: ICreationStepProps) {
setFieldValue('essentials.governance', value);
};

const { createOptions } = useNetworkConfig();
const { createOptions, setCurrentConfig, chain, getConfigByChainId, addressPrefix } =
useNetworkConfigStore();
const walletChainID = useChainId();

const [snapshotENSInput, setSnapshotENSInput] = useState('');

Expand All @@ -81,6 +90,31 @@ export function EstablishEssentials(props: ICreationStepProps) {
debounceENSInput(snapshotENSInput);
}, [debounceENSInput, snapshotENSInput]);

const dropdownItems = supportedNetworks.map(network => ({
value: network.chain.id.toString(),
label: network.chain.name,
icon: getNetworkIcon(network.addressPrefix),
selected: chain.id === network.chain.id,
}));

const { switchChain } = useSwitchChain({
mutation: {
onError: () => {
if (chain.id !== walletChainID) {
const chainId = getChainIdFromPrefix(addressPrefix);
switchChain({ chainId });
}
},
},
});

useEffect(() => {
if (chain.id !== walletChainID) {
const chainId = getChainIdFromPrefix(addressPrefix);
switchChain({ chainId });
}
}, [chain.id, walletChainID, addressPrefix, switchChain]);

return (
<>
<StepWrapper
Expand All @@ -102,6 +136,52 @@ export function EstablishEssentials(props: ICreationStepProps) {
placeholder={t('daoNamePlaceholder')}
testId="essentials-daoName"
/>
<Box
mt="2rem"
mb="1.5rem"
>
<LabelComponent
label={t('networks')}
helper={t('networkDescription')}
isRequired
alignLabel="flex-start"
>
<DropdownMenu
items={dropdownItems}
selectedItem={dropdownItems.find(item => item.selected)}
onSelect={item => {
setCurrentConfig(getConfigByChainId(Number(item.value)));
switchChain({ chainId: Number(item.value) });
}}
title={t('networks')}
isDisabled={false}
renderItem={(item, isSelected) => {
return (
<>
<Flex
alignItems="center"
gap="1rem"
>
<Image
src={item.icon}
fallbackSrc="/images/coin-icon-default.svg"
boxSize="2rem"
/>
{item.label}
</Flex>
{isSelected && (
<Icon
as={CheckCircle}
boxSize="1.5rem"
color="lilac-0"
/>
)}
</>
);
}}
/>
</LabelComponent>
</Box>
<Box
mt="2rem"
mb="1.5rem"
Expand Down
4 changes: 2 additions & 2 deletions src/components/DaoDashboard/Activities/ProposalsHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DAO_ROUTES } from '../../../constants/routes';
import { useProposalsSortedAndFiltered } from '../../../hooks/DAO/proposal/useProposals';
import { useCanUserCreateProposal } from '../../../hooks/utils/useCanUserSubmitProposal';
import { useFractal } from '../../../providers/App/AppProvider';
import { useNetworkConfig } from '../../../providers/NetworkConfig/NetworkConfigProvider';
import { useNetworkConfigStore } from '../../../providers/NetworkConfig/useNetworkConfigStore';
import { useDaoInfoStore } from '../../../store/daoInfo/useDaoInfoStore';
import {
AzoriusGovernance,
Expand Down Expand Up @@ -39,7 +39,7 @@ export function ProposalsHome() {
const { governance, guardContracts } = useFractal();
const { safe } = useDaoInfoStore();

const { addressPrefix } = useNetworkConfig();
const { addressPrefix } = useNetworkConfigStore();
const azoriusGovernance = governance as AzoriusGovernance;
const delegate = useDecentModal(ModalType.DELEGATE);

Expand Down
4 changes: 2 additions & 2 deletions src/components/DaoDashboard/Info/ParentLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { ArrowBendLeftUp } from '@phosphor-icons/react';
import { useTranslation } from 'react-i18next';
import { Link as RouterLink } from 'react-router-dom';
import { DAO_ROUTES } from '../../../constants/routes';
import { useNetworkConfig } from '../../../providers/NetworkConfig/NetworkConfigProvider';
import { useNetworkConfigStore } from '../../../providers/NetworkConfig/useNetworkConfigStore';
import { useDaoInfoStore } from '../../../store/daoInfo/useDaoInfoStore';
/**
* Displays a link to the current DAO's parent, if it has one.
*/
export function ParentLink() {
const { subgraphInfo } = useDaoInfoStore();
const { addressPrefix } = useNetworkConfig();
const { addressPrefix } = useNetworkConfigStore();
const { t } = useTranslation('breadcrumbs');

if (!subgraphInfo?.parentAddress) {
Expand Down
11 changes: 5 additions & 6 deletions src/components/DaoHierarchy/DaoHierarchyNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Link as RouterLink } from 'react-router-dom';
import { Address, getContract, zeroAddress } from 'viem';
import { useChainId, usePublicClient } from 'wagmi';
import { usePublicClient } from 'wagmi';
import { DAOQueryDocument } from '../../../.graphclient';
import { SENTINEL_ADDRESS } from '../../constants/common';
import { DAO_ROUTES } from '../../constants/routes';
Expand All @@ -15,7 +15,7 @@ import { CacheKeys } from '../../hooks/utils/cache/cacheDefaults';
import { setValue, getValue } from '../../hooks/utils/cache/useLocalStorage';
import { useAddressContractType } from '../../hooks/utils/useAddressContractType';
import { useSafeAPI } from '../../providers/App/hooks/useSafeAPI';
import { useNetworkConfig } from '../../providers/NetworkConfig/NetworkConfigProvider';
import { useNetworkConfigStore } from '../../providers/NetworkConfig/useNetworkConfigStore';
import { useDaoInfoStore } from '../../store/daoInfo/useDaoInfoStore';
import { DaoHierarchyInfo, DaoHierarchyStrategyType, DecentModule } from '../../types';
import { getAzoriusModuleFromModules } from '../../utils';
Expand Down Expand Up @@ -43,8 +43,7 @@ export function DaoHierarchyNode({
const safeApi = useSafeAPI();
const [hierarchyNode, setHierarchyNode] = useState<DaoHierarchyInfo>();
const [hasErrorLoading, setErrorLoading] = useState<boolean>(false);
const { addressPrefix, subgraph } = useNetworkConfig();
const chainId = useChainId();
const { addressPrefix, subgraph, chain } = useNetworkConfigStore();
const publicClient = usePublicClient();

const { getAddressContractType } = useAddressContractType();
Expand Down Expand Up @@ -168,7 +167,7 @@ export function DaoHierarchyNode({
if (safeAddress) {
const cachedNode = getValue({
cacheName: CacheKeys.HIERARCHY_DAO_INFO,
chainId,
chainId: chain.id,
daoAddress: safeAddress,
});
if (cachedNode) {
Expand All @@ -182,7 +181,7 @@ export function DaoHierarchyNode({
setValue(
{
cacheName: CacheKeys.HIERARCHY_DAO_INFO,
chainId,
chainId: chain.id,
daoAddress: safeAddress,
},
_node,
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProposalBuilder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import useSubmitProposal from '../../hooks/DAO/proposal/useSubmitProposal';
import useCreateProposalSchema from '../../hooks/schemas/proposalBuilder/useCreateProposalSchema';
import { useCanUserCreateProposal } from '../../hooks/utils/useCanUserSubmitProposal';
import { useFractal } from '../../providers/App/AppProvider';
import { useNetworkConfig } from '../../providers/NetworkConfig/NetworkConfigProvider';
import { useNetworkConfigStore } from '../../providers/NetworkConfig/useNetworkConfigStore';
import { useProposalActionsStore } from '../../store/actions/useProposalActionsStore';
import { useDaoInfoStore } from '../../store/daoInfo/useDaoInfoStore';
import { CreateProposalSteps, ProposalExecuteData } from '../../types';
Expand Down Expand Up @@ -58,7 +58,7 @@ export function ProposalBuilder({
const { safe } = useDaoInfoStore();
const safeAddress = safe?.address;

const { addressPrefix } = useNetworkConfig();
const { addressPrefix } = useNetworkConfigStore();
const { submitProposal, pendingCreateTx } = useSubmitProposal();
const { canUserCreateProposal } = useCanUserCreateProposal();
const { createProposalValidation } = useCreateProposalSchema();
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProposalTemplates/ProposalTemplateCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DAO_ROUTES } from '../../constants/routes';
import useRemoveProposalTemplate from '../../hooks/DAO/proposal/useRemoveProposalTemplate';
import useSubmitProposal from '../../hooks/DAO/proposal/useSubmitProposal';
import { useCanUserCreateProposal } from '../../hooks/utils/useCanUserSubmitProposal';
import { useNetworkConfig } from '../../providers/NetworkConfig/NetworkConfigProvider';
import { useNetworkConfigStore } from '../../providers/NetworkConfig/useNetworkConfigStore';
import { useDaoInfoStore } from '../../store/daoInfo/useDaoInfoStore';
import { ProposalTemplate } from '../../types/proposalBuilder';
import ContentBox from '../ui/containers/ContentBox';
Expand All @@ -29,7 +29,7 @@ export default function ProposalTemplateCard({
const { t } = useTranslation('proposalTemplate');
const { safe } = useDaoInfoStore();

const { addressPrefix } = useNetworkConfig();
const { addressPrefix } = useNetworkConfigStore();

const { prepareRemoveProposalTemplateProposal } = useRemoveProposalTemplate();
const { submitProposal } = useSubmitProposal();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useAsyncRequest } from '../../../hooks/utils/useAsyncRequest';
import { useTransaction } from '../../../hooks/utils/useTransaction';
import { useFractal } from '../../../providers/App/AppProvider';
import { useSafeAPI } from '../../../providers/App/hooks/useSafeAPI';
import { useNetworkConfig } from '../../../providers/NetworkConfig/NetworkConfigProvider';
import { useNetworkConfigStore } from '../../../providers/NetworkConfig/useNetworkConfigStore';
import { useDaoInfoStore } from '../../../store/daoInfo/useDaoInfoStore';
import { MultisigProposal, FractalProposalState } from '../../../types';
import { DecentTooltip } from '../../ui/DecentTooltip';
Expand Down Expand Up @@ -42,7 +42,7 @@ export function TxActions({ proposal }: { proposal: MultisigProposal }) {
}
}, [proposal.state]);

const { chain } = useNetworkConfig();
const { chain } = useNetworkConfigStore();
const { t } = useTranslation(['proposal', 'common', 'transaction']);

const [asyncRequest, asyncRequestPending] = useAsyncRequest();
Expand Down
4 changes: 2 additions & 2 deletions src/components/Proposals/ProposalCard/ProposalCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { format } from 'date-fns';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router-dom';
import { DAO_ROUTES } from '../../../constants/routes';
import { useNetworkConfig } from '../../../providers/NetworkConfig/NetworkConfigProvider';
import { useNetworkConfigStore } from '../../../providers/NetworkConfig/useNetworkConfigStore';
import { useDaoInfoStore } from '../../../store/daoInfo/useDaoInfoStore';
import { AzoriusProposal, FractalProposal, SnapshotProposal } from '../../../types';
import { DEFAULT_DATE_FORMAT } from '../../../utils';
Expand All @@ -15,7 +15,7 @@ import { ProposalCountdown } from '../../ui/proposal/ProposalCountdown';

function ProposalCard({ proposal }: { proposal: FractalProposal }) {
const { safe } = useDaoInfoStore();
const { addressPrefix } = useNetworkConfig();
const { addressPrefix } = useNetworkConfigStore();
const { t } = useTranslation('common');

if (!safe?.address) {
Expand Down
Loading
Loading