From 5ca82d4660ea6f91ec5c6af7be878ed39471ef72 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 21 Oct 2022 17:05:13 -0700 Subject: [PATCH] Moved proposal and voting module adapters into common package. --- apps/dapp/components/TokenCard.tsx | 2 +- .../dao/tabs/TreasuryAndNftsTab.tsx | 8 ++--- .../profile/ProfileNewProposalCard.tsx | 4 +-- .../profile/ProfileProposalCard.tsx | 4 +-- apps/dapp/next.config.js | 2 -- apps/dapp/package.json | 2 -- apps/dapp/pages/dao/[address]/index.tsx | 6 ++-- .../dao/[address]/proposals/[proposalId].tsx | 8 ++--- .../pages/dao/[address]/proposals/create.tsx | 4 +-- apps/dapp/pages/wallet.tsx | 2 +- package.json | 2 -- .../common/actions/actions/Instantiate.tsx | 2 +- packages/common/actions/actions/Spend.tsx | 2 +- packages/common/atoms/newDao.ts | 5 +-- packages/common/components/CreateDaoForm.tsx | 22 ++++++------ packages/common/components/DaoInfoBar.tsx | 6 ++-- packages/common/components/DaoPageWrapper.tsx | 2 +- packages/common/components/ProposalLine.tsx | 11 +++--- packages/common/components/ProposalList.tsx | 5 +-- .../useEncodedCwdProposalSinglePrefill.ts | 9 ++--- packages/common/package.json | 5 +-- .../proposal-module-adapter/README.md | 10 +++--- .../common/actions/index.tsx | 0 ...pdatePreProposeConfigComponent.stories.tsx | 0 .../UpdatePreProposeConfigComponent.tsx | 7 ++-- .../index.tsx | 2 +- .../UpdateProposalConfigComponent.tsx | 21 +++++------ .../index.tsx | 2 +- .../UpdateProposalConfigComponent.tsx | 21 +++++------ .../index.tsx | 2 +- .../common/components/NewProposal.tsx | 6 ++-- .../common/components/index.tsx | 0 .../CwdProposalSingle/common/hooks/index.ts | 0 .../common/hooks/makeUseActions.ts | 2 +- .../makeUseProfileNewProposalCardInfoLines.ts | 0 .../common/hooks/useProcessTQ.ts | 0 .../CwdProposalSingle/common/index.ts | 0 .../CwdProposalSingle/common/selectors.ts | 0 .../common/ui/NewProposal.stories.tsx | 6 ++-- .../common/ui/NewProposal.tsx | 22 ++++++------ .../components/ProposalActionDisplay.tsx | 2 +- .../ProposalLine/ProposalStatus.tsx | 0 .../components/ProposalLine/index.tsx | 2 +- .../components/ProposalStatusAndInfo.tsx | 2 +- .../components/ProposalVoteTally.tsx | 0 .../components/ProposalVotes/VoteDisplay.tsx | 0 .../components/ProposalVotes/index.tsx | 2 +- .../components/ProposalWalletVote.tsx | 0 .../CwdProposalSingle/components/index.tsx | 0 .../ui/ProposalVoteTally.stories.tsx | 0 .../components/ui/ProposalVoteTally.tsx | 16 ++++----- .../contracts/CwProposalSingle.v1.client.ts | 0 .../contracts/CwProposalSingle.v1.hooks.ts | 0 .../contracts/CwProposalSingle.v1.recoil.ts | 0 .../contracts/CwdPreProposeSingle.client.ts | 0 .../contracts/CwdPreProposeSingle.hooks.ts | 0 .../contracts/CwdPreProposeSingle.recoil.ts | 0 .../CwdProposalSingle.common.recoil.ts | 0 .../contracts/CwdProposalSingle.v2.client.ts | 0 .../contracts/CwdProposalSingle.v2.hooks.ts | 0 .../contracts/CwdProposalSingle.v2.recoil.ts | 0 .../AllowRevotingVotingConfigItem.tsx | 0 .../ProposalDepositVotingConfigItem.tsx | 6 ++-- .../daoCreation/QuorumVotingConfigItem.tsx | 0 .../daoCreation/ThresholdVotingConfigItem.tsx | 0 .../VotingDurationVotingConfigItem.tsx | 0 .../daoCreation/getInstantiateInfo.ts | 6 ++-- .../CwdProposalSingle/daoCreation/index.tsx | 0 .../daoCreation/instantiate_schema.json | 0 .../pre_propose_instantiate_schema.json | 0 .../functions/fetchPreProposeAddress.ts | 0 .../CwdProposalSingle/functions/index.ts | 0 .../functions/makeGetProposalInfo.ts | 10 +++--- .../adapters/CwdProposalSingle/hooks/index.ts | 0 .../CwdProposalSingle/hooks/useCastVote.ts | 0 .../CwdProposalSingle/hooks/useDepositInfo.ts | 0 .../hooks/useProfileVoteCardOptions.ts | 0 .../CwdProposalSingle/hooks/useProposal.ts | 0 .../hooks/useProposalExecutionTxHash.ts | 0 .../hooks/useProposalProcessedTQ.ts | 0 .../hooks/useProposalRefreshers.ts | 0 .../CwdProposalSingle/hooks/useVotesInfo.ts | 0 .../hooks/useWalletVoteInfo.tsx | 0 .../adapters/CwdProposalSingle/index.tsx | 7 ++-- .../adapters/CwdProposalSingle/types.ts | 0 .../adapters/CwdProposalSingle/utils.ts | 0 .../adapters/index.tsx | 0 .../proposal-module-adapter/core.ts | 10 +++--- .../proposal-module-adapter/index.tsx | 1 - .../proposal-module-adapter/react/context.ts | 2 +- .../proposal-module-adapter/react/index.tsx | 0 .../react/provider.tsx | 8 ++--- .../proposal-module-adapter/recoil/index.ts | 0 .../recoil/selectors.ts | 0 .../proposal-module-adapter/tsconfig.json | 0 packages/common/selectors/dao.ts | 6 ++-- .../common/server/makeGetDaoStaticProps.ts | 16 +++++---- packages/common/tailwind.config.js | 5 +-- packages/common/utils/fetchProposalModules.ts | 10 +++--- .../voting-module-adapter/README.md | 10 +++--- .../CwdVotingCw20Staked/actions/index.tsx | 0 .../actions/makeMintAction/MintComponent.tsx | 5 +-- .../actions/makeMintAction/index.tsx | 0 .../ProfileCardMemberInfo/StakingModal.tsx | 4 +-- .../ProfileCardMemberInfo/index.tsx | 0 .../CwdVotingCw20Staked/components/index.tsx | 0 .../daoCreation/DisplayInfoIcon.tsx | 0 .../GovernanceConfigurationInput.tsx | 26 +++++++------- .../GovernanceConfigurationReview.tsx | 4 +-- .../daoCreation/TierCard.stories.tsx | 2 +- .../daoCreation/TierCard.tsx | 12 +++---- .../UnstakingDurationVotingConfigItem.tsx | 0 .../daoCreation/getInstantiateInfo.ts | 0 .../CwdVotingCw20Staked/daoCreation/index.tsx | 0 .../daoCreation/instantiate_schema.json | 0 .../CwdVotingCw20Staked/hooks/index.ts | 0 .../CwdVotingCw20Staked/hooks/useActions.ts | 2 +- .../hooks/useDaoInfoBarItems.tsx | 0 .../hooks/useGovernanceTokenInfo.ts | 0 .../useProfileNewProposalCardAddresses.ts | 0 .../hooks/useStakingInfo.ts | 0 .../adapters/CwdVotingCw20Staked/index.tsx | 0 .../adapters/CwdVotingCw20Staked/types.ts | 0 .../adapters/CwdVotingCw4/actions/index.tsx | 0 .../ManageMembersComponent.tsx | 7 ++-- .../actions/makeManageMembersAction/index.tsx | 0 .../CwdVotingCw4/components/MembersTab.tsx | 8 ++--- .../components/ProfileCardMemberInfo.tsx | 0 .../CwdVotingCw4/components/index.tsx | 0 .../daoCreation/DisplayInfoIcon.tsx | 0 .../GovernanceConfigurationInput.tsx | 2 +- .../GovernanceConfigurationReview.tsx | 0 .../daoCreation/TierCard.stories.tsx | 2 +- .../CwdVotingCw4/daoCreation/TierCard.tsx | 12 +++---- .../daoCreation/getInstantiateInfo.ts | 0 .../CwdVotingCw4/daoCreation/index.tsx | 0 .../daoCreation/instantiate_schema.json | 0 .../adapters/CwdVotingCw4/hooks/index.ts | 0 .../adapters/CwdVotingCw4/hooks/useActions.ts | 2 +- .../CwdVotingCw4/hooks/useDaoInfoBarItems.ts | 0 .../useProfileNewProposalCardAddresses.ts | 0 .../CwdVotingCw4/hooks/useVotingModule.ts | 0 .../adapters/CwdVotingCw4/index.tsx | 0 .../adapters/CwdVotingCw4/types.ts | 0 .../ui/ProfileCardMemberInfo.stories.tsx | 0 .../CwdVotingCw4/ui/ProfileCardMemberInfo.tsx | 2 +- .../ProfileCardMemberInfo/StakingModal.tsx | 4 +-- .../ProfileCardMemberInfo/index.tsx | 0 .../components/index.tsx | 0 .../CwdVotingNativeStaked/hooks/index.ts | 0 .../hooks/useDaoInfoBarItems.tsx | 0 .../hooks/useGovernanceTokenInfo.ts | 0 .../hooks/useStakingInfo.ts | 0 .../adapters/CwdVotingNativeStaked/index.tsx | 0 .../adapters/Fallback/Placeholder.tsx | 7 ++-- .../adapters/Fallback/index.tsx | 0 .../voting-module-adapter/adapters/index.tsx | 0 .../ProfileCardMemberInfoTokens.stories.tsx | 0 .../ProfileCardMemberInfoTokens.tsx | 2 +- .../components/index.tsx | 0 .../voting-module-adapter/core.ts | 10 +++--- .../voting-module-adapter/index.tsx | 1 - .../voting-module-adapter/react/context.ts | 0 .../react/hooks/index.ts | 0 ...Cw20GovernanceTokenInfoResponseIfExists.ts | 0 ...tiveGovernanceTokenInfoResponseIfExists.ts | 0 .../voting-module-adapter/react/index.tsx | 0 .../voting-module-adapter/react/provider.tsx | 0 packages/proposal-module-adapter/.eslintrc.js | 10 ------ packages/proposal-module-adapter/LICENSE | 32 ----------------- packages/proposal-module-adapter/package.json | 33 ----------------- packages/proposal-module-adapter/types.ts | 1 - .../components/StatusDisplay.stories.tsx | 2 +- .../DaoCreateConfigInputCard.stories.tsx | 2 +- .../DaoCreateConfigReviewCard.stories.tsx | 2 +- .../dao/create/DaoStructureCard.stories.tsx | 2 +- .../pages/CreateDaoGovernance.stories.tsx | 2 +- .../create/pages/CreateDaoReview.stories.tsx | 4 +-- .../create/pages/CreateDaoStart.stories.tsx | 4 +-- .../create/pages/CreateDaoVoting.stories.tsx | 4 +-- .../profile/ProfileCantVoteCard.stories.tsx | 4 +-- .../profile/ProfileMemberCard.stories.tsx | 4 +-- .../profile/ProfileNotMemberCard.stories.tsx | 4 +-- .../profile/ProfileVotedCard.stories.tsx | 2 +- .../ProposalLine.ProposalLine.stories.tsx | 2 +- .../proposal/ProposalVotes.stories.tsx | 2 +- .../proposal/ProposalWalletVote.stories.tsx | 2 +- .../pages/CreateProposal.stories.tsx | 6 ++-- packages/stateless/pages/Proposal.stories.tsx | 4 +-- packages/stateless/pages/Wallet.stories.tsx | 2 +- packages/stateless/tailwind.config.js | 5 +-- .../makeProposalModuleAdapterDecorator.tsx | 2 +- packages/storybook/tailwind.config.js | 4 +-- packages/voting-module-adapter/.eslintrc.js | 10 ------ packages/voting-module-adapter/LICENSE | 32 ----------------- packages/voting-module-adapter/package.json | 35 ------------------- packages/voting-module-adapter/tsconfig.json | 5 --- packages/voting-module-adapter/types.ts | 1 - 198 files changed, 256 insertions(+), 417 deletions(-) rename packages/{ => common}/proposal-module-adapter/README.md (93%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/index.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/UpdatePreProposeConfigComponent.stories.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/UpdatePreProposeConfigComponent.tsx (96%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/index.tsx (98%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/UpdateProposalConfigComponent.tsx (91%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/index.tsx (99%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/UpdateProposalConfigComponent.tsx (91%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/index.tsx (99%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/components/NewProposal.tsx (98%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/components/index.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/index.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/makeUseActions.ts (92%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/makeUseProfileNewProposalCardInfoLines.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/useProcessTQ.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/index.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/selectors.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.stories.tsx (94%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.tsx (95%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalActionDisplay.tsx (98%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalLine/ProposalStatus.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalLine/index.tsx (97%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalStatusAndInfo.tsx (99%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalVoteTally.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalVotes/VoteDisplay.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalVotes/index.tsx (98%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalWalletVote.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/components/index.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/components/ui/ProposalVoteTally.stories.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/components/ui/ProposalVoteTally.tsx (93%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.client.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.hooks.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.recoil.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.client.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.hooks.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.recoil.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.common.recoil.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.client.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.hooks.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.recoil.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/AllowRevotingVotingConfigItem.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/ProposalDepositVotingConfigItem.tsx (98%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/QuorumVotingConfigItem.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/ThresholdVotingConfigItem.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/VotingDurationVotingConfigItem.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/getInstantiateInfo.ts (96%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/index.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/instantiate_schema.json (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/pre_propose_instantiate_schema.json (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/functions/fetchPreProposeAddress.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/functions/index.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/functions/makeGetProposalInfo.ts (97%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/hooks/index.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useCastVote.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useDepositInfo.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProfileVoteCardOptions.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposal.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalExecutionTxHash.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalProcessedTQ.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalRefreshers.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useVotesInfo.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useWalletVoteInfo.tsx (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/index.tsx (96%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/types.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/CwdProposalSingle/utils.ts (100%) rename packages/{ => common}/proposal-module-adapter/adapters/index.tsx (100%) rename packages/{ => common}/proposal-module-adapter/core.ts (98%) rename packages/{ => common}/proposal-module-adapter/index.tsx (80%) rename packages/{ => common}/proposal-module-adapter/react/context.ts (97%) rename packages/{ => common}/proposal-module-adapter/react/index.tsx (100%) rename packages/{ => common}/proposal-module-adapter/react/provider.tsx (94%) rename packages/{ => common}/proposal-module-adapter/recoil/index.ts (100%) rename packages/{ => common}/proposal-module-adapter/recoil/selectors.ts (100%) rename packages/{ => common}/proposal-module-adapter/tsconfig.json (100%) rename packages/{ => common}/voting-module-adapter/README.md (96%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/makeMintAction/MintComponent.tsx (95%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/makeMintAction/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/components/ProfileCardMemberInfo/StakingModal.tsx (98%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/components/ProfileCardMemberInfo/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/components/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/DisplayInfoIcon.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/GovernanceConfigurationInput.tsx (93%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/GovernanceConfigurationReview.tsx (96%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.stories.tsx (96%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.tsx (94%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/UnstakingDurationVotingConfigItem.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/getInstantiateInfo.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/instantiate_schema.json (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/index.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useActions.ts (80%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useDaoInfoBarItems.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useGovernanceTokenInfo.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useProfileNewProposalCardAddresses.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useStakingInfo.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw20Staked/types.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/actions/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/actions/makeManageMembersAction/ManageMembersComponent.tsx (97%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/actions/makeManageMembersAction/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/components/MembersTab.tsx (91%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/components/ProfileCardMemberInfo.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/components/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/DisplayInfoIcon.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/GovernanceConfigurationInput.tsx (98%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/GovernanceConfigurationReview.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.stories.tsx (96%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.tsx (93%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/getInstantiateInfo.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/instantiate_schema.json (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/hooks/index.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/hooks/useActions.ts (81%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/hooks/useDaoInfoBarItems.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/hooks/useProfileNewProposalCardAddresses.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/hooks/useVotingModule.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/types.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/ui/ProfileCardMemberInfo.stories.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingCw4/ui/ProfileCardMemberInfo.tsx (94%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingNativeStaked/components/ProfileCardMemberInfo/StakingModal.tsx (98%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingNativeStaked/components/ProfileCardMemberInfo/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingNativeStaked/components/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/index.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useDaoInfoBarItems.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useGovernanceTokenInfo.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useStakingInfo.ts (100%) rename packages/{ => common}/voting-module-adapter/adapters/CwdVotingNativeStaked/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/Fallback/Placeholder.tsx (71%) rename packages/{ => common}/voting-module-adapter/adapters/Fallback/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/adapters/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/components/ProfileCardMemberInfoTokens.stories.tsx (100%) rename packages/{ => common}/voting-module-adapter/components/ProfileCardMemberInfoTokens.tsx (99%) rename packages/{ => common}/voting-module-adapter/components/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/core.ts (98%) rename packages/{ => common}/voting-module-adapter/index.tsx (75%) rename packages/{ => common}/voting-module-adapter/react/context.ts (100%) rename packages/{ => common}/voting-module-adapter/react/hooks/index.ts (100%) rename packages/{ => common}/voting-module-adapter/react/hooks/useCw20GovernanceTokenInfoResponseIfExists.ts (100%) rename packages/{ => common}/voting-module-adapter/react/hooks/useNativeGovernanceTokenInfoResponseIfExists.ts (100%) rename packages/{ => common}/voting-module-adapter/react/index.tsx (100%) rename packages/{ => common}/voting-module-adapter/react/provider.tsx (100%) delete mode 100644 packages/proposal-module-adapter/.eslintrc.js delete mode 100644 packages/proposal-module-adapter/LICENSE delete mode 100644 packages/proposal-module-adapter/package.json delete mode 100644 packages/proposal-module-adapter/types.ts delete mode 100644 packages/voting-module-adapter/.eslintrc.js delete mode 100644 packages/voting-module-adapter/LICENSE delete mode 100644 packages/voting-module-adapter/package.json delete mode 100644 packages/voting-module-adapter/tsconfig.json delete mode 100644 packages/voting-module-adapter/types.ts diff --git a/apps/dapp/components/TokenCard.tsx b/apps/dapp/components/TokenCard.tsx index 4b8ea8d62..cc07f270e 100644 --- a/apps/dapp/components/TokenCard.tsx +++ b/apps/dapp/components/TokenCard.tsx @@ -5,8 +5,8 @@ import { useRouter } from 'next/router' import { useCallback, useEffect } from 'react' import { useSetRecoilState } from 'recoil' -import { useActionForKey } from '@dao-dao/common/actions' import { useEncodedCwdProposalSinglePrefill } from '@dao-dao/common' +import { useActionForKey } from '@dao-dao/common/actions' import { refreshNativeTokenStakingInfoAtom, tokenCardLazyStakingInfoSelector, diff --git a/apps/dapp/components/dao/tabs/TreasuryAndNftsTab.tsx b/apps/dapp/components/dao/tabs/TreasuryAndNftsTab.tsx index 230c21216..f0a1bbf82 100644 --- a/apps/dapp/components/dao/tabs/TreasuryAndNftsTab.tsx +++ b/apps/dapp/components/dao/tabs/TreasuryAndNftsTab.tsx @@ -7,6 +7,10 @@ import { useEncodedCwdProposalSinglePrefill, } from '@dao-dao/common' import { useActionForKey } from '@dao-dao/common/actions' +import { + useCw20GovernanceTokenInfoResponseIfExists, + useNativeGovernanceTokenInfoResponseIfExists, +} from '@dao-dao/common/voting-module-adapter' import { nftCardInfosSelector, treasuryTokenCardInfosSelector, @@ -20,10 +24,6 @@ import { } from '@dao-dao/stateless' import { ActionKey } from '@dao-dao/types' import { loadableToLoadingData } from '@dao-dao/utils' -import { - useCw20GovernanceTokenInfoResponseIfExists, - useNativeGovernanceTokenInfoResponseIfExists, -} from '@dao-dao/voting-module-adapter' import { TokenCard } from '@/components' diff --git a/apps/dapp/components/profile/ProfileNewProposalCard.tsx b/apps/dapp/components/profile/ProfileNewProposalCard.tsx index 5ec1d21cf..a5f824d9a 100644 --- a/apps/dapp/components/profile/ProfileNewProposalCard.tsx +++ b/apps/dapp/components/profile/ProfileNewProposalCard.tsx @@ -4,14 +4,14 @@ import { useTranslation } from 'react-i18next' import { SuspenseLoader } from '@dao-dao/common' -import { matchAndLoadCommon } from '@dao-dao/proposal-module-adapter' +import { matchAndLoadCommon } from '@dao-dao/common/proposal-module-adapter' +import { useVotingModuleAdapter } from '@dao-dao/common/voting-module-adapter' import { useWalletProfile } from '@dao-dao/state' import { ProfileNewProposalCard as StatelessProfileNewProposalCard, useAppLayoutContext, useDaoInfoContext, } from '@dao-dao/stateless' -import { useVotingModuleAdapter } from '@dao-dao/voting-module-adapter' export interface ProfileNewProposalCardProps { proposalModuleAdapterCommon: ReturnType diff --git a/apps/dapp/components/profile/ProfileProposalCard.tsx b/apps/dapp/components/profile/ProfileProposalCard.tsx index 3535ecfb2..614795965 100644 --- a/apps/dapp/components/profile/ProfileProposalCard.tsx +++ b/apps/dapp/components/profile/ProfileProposalCard.tsx @@ -8,7 +8,8 @@ import { useRecoilValue, waitForAll } from 'recoil' import { matchAndLoadCommon, useProposalModuleAdapter, -} from '@dao-dao/proposal-module-adapter' +} from '@dao-dao/common/proposal-module-adapter' +import { useVotingModuleAdapter } from '@dao-dao/common/voting-module-adapter' import { useVotingModule, useWalletProfile } from '@dao-dao/state' import { Loader, @@ -20,7 +21,6 @@ import { useDaoInfoContext, } from '@dao-dao/stateless' import { CheckedDepositInfo } from '@dao-dao/types/contracts/common' -import { useVotingModuleAdapter } from '@dao-dao/voting-module-adapter' export interface ProfileProposalCardProps { onVoteSuccess: () => void | Promise diff --git a/apps/dapp/next.config.js b/apps/dapp/next.config.js index c4dab2b1f..2cc8f8fd2 100644 --- a/apps/dapp/next.config.js +++ b/apps/dapp/next.config.js @@ -13,8 +13,6 @@ const withTM = require('next-transpile-modules')([ '@dao-dao/state', '@dao-dao/common', '@dao-dao/i18n', - '@dao-dao/voting-module-adapter', - '@dao-dao/proposal-module-adapter', '@dao-dao/types', ]) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index 598315dd8..5ff1ba232 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -21,11 +21,9 @@ "@cosmjs/stargate": "0.28.10", "@dao-dao/common": "2.0.1", "@dao-dao/i18n": "2.0.1", - "@dao-dao/proposal-module-adapter": "2.0.1", "@dao-dao/types": "2.0.1", "@dao-dao/stateless": "2.0.1", "@dao-dao/utils": "2.0.1", - "@dao-dao/voting-module-adapter": "2.0.1", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@mui/icons-material": "^5.10.3", diff --git a/apps/dapp/pages/dao/[address]/index.tsx b/apps/dapp/pages/dao/[address]/index.tsx index b00cfb000..5a2ee5310 100644 --- a/apps/dapp/pages/dao/[address]/index.tsx +++ b/apps/dapp/pages/dao/[address]/index.tsx @@ -14,15 +14,16 @@ import { waitForAll, } from 'recoil' -import { useActionForKey } from '@dao-dao/common/actions' import { DaoInfoBar, DaoPageWrapper, DaoPageWrapperProps, useEncodedCwdProposalSinglePrefill, } from '@dao-dao/common' +import { useActionForKey } from '@dao-dao/common/actions' +import { matchAndLoadCommon } from '@dao-dao/common/proposal-module-adapter' import { makeGetDaoStaticProps } from '@dao-dao/common/server' -import { matchAndLoadCommon } from '@dao-dao/proposal-module-adapter' +import { useVotingModuleAdapter } from '@dao-dao/common/voting-module-adapter' import { CwdCoreV2Selectors, usePinnedDaos, @@ -42,7 +43,6 @@ import { import { ActionKey } from '@dao-dao/types' import { CheckedDepositInfo } from '@dao-dao/types/contracts/common' import { SITE_URL } from '@dao-dao/utils' -import { useVotingModuleAdapter } from '@dao-dao/voting-module-adapter' import { ProposalsTab, SubDaosTab, TreasuryAndNftsTab } from '@/components' diff --git a/apps/dapp/pages/dao/[address]/proposals/[proposalId].tsx b/apps/dapp/pages/dao/[address]/proposals/[proposalId].tsx index 673fb038a..d5abf7a37 100644 --- a/apps/dapp/pages/dao/[address]/proposals/[proposalId].tsx +++ b/apps/dapp/pages/dao/[address]/proposals/[proposalId].tsx @@ -8,18 +8,19 @@ import { useCallback, useMemo } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import { useActions } from '@dao-dao/common/actions' import { DaoPageWrapper, DaoProposalPageWrapperProps, Trans, } from '@dao-dao/common' -import { makeGetDaoProposalStaticProps } from '@dao-dao/common/server' +import { useActions } from '@dao-dao/common/actions' import { CommonProposalInfo, ProposalModuleAdapterProvider, useProposalModuleAdapterContext, -} from '@dao-dao/proposal-module-adapter' +} from '@dao-dao/common/proposal-module-adapter' +import { makeGetDaoProposalStaticProps } from '@dao-dao/common/server' +import { useVotingModuleAdapter } from '@dao-dao/common/voting-module-adapter' import { useProfile } from '@dao-dao/state' import { Loader, @@ -31,7 +32,6 @@ import { } from '@dao-dao/stateless' import { ActionKey } from '@dao-dao/types' import { SITE_URL } from '@dao-dao/utils' -import { useVotingModuleAdapter } from '@dao-dao/voting-module-adapter' import { ProfileProposalCard } from '@/components' diff --git a/apps/dapp/pages/dao/[address]/proposals/create.tsx b/apps/dapp/pages/dao/[address]/proposals/create.tsx index 6ff1f9f39..9ebb348cd 100644 --- a/apps/dapp/pages/dao/[address]/proposals/create.tsx +++ b/apps/dapp/pages/dao/[address]/proposals/create.tsx @@ -16,13 +16,13 @@ import { DaoPageWrapperProps, SuspenseLoader, } from '@dao-dao/common' -import { makeGetDaoStaticProps } from '@dao-dao/common/server' import { BaseNewProposalProps, CwdProposalSingleAdapter, matchAndLoadCommon, matchAdapter as matchProposalModuleAdapter, -} from '@dao-dao/proposal-module-adapter' +} from '@dao-dao/common/proposal-module-adapter' +import { makeGetDaoStaticProps } from '@dao-dao/common/server' import { proposalCreatedCardPropsAtom, proposalDraftsAtom, diff --git a/apps/dapp/pages/wallet.tsx b/apps/dapp/pages/wallet.tsx index a6db4464c..543a3c9b6 100644 --- a/apps/dapp/pages/wallet.tsx +++ b/apps/dapp/pages/wallet.tsx @@ -9,8 +9,8 @@ import { useForm } from 'react-hook-form' import { useTranslation } from 'react-i18next' import { useRecoilState } from 'recoil' -import { ActionsProvider, useActions } from '@dao-dao/common/actions' import { SuspenseLoader } from '@dao-dao/common' +import { ActionsProvider, useActions } from '@dao-dao/common/actions' import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations' import { walletTransactionAtom } from '@dao-dao/state' import { diff --git a/package.json b/package.json index c8e0dc8c2..eab28d325 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,6 @@ "common": "yarn workspace @dao-dao/common", "i18n": "yarn workspace @dao-dao/i18n", "storybook": "yarn workspace @dao-dao/storybook", - "proposal-module-adapter": "yarn workspace @dao-dao/proposal-module-adapter", - "voting-module-adapter": "yarn workspace @dao-dao/voting-module-adapter", "types": "yarn workspace @dao-dao/types" }, "devDependencies": { diff --git a/packages/common/actions/actions/Instantiate.tsx b/packages/common/actions/actions/Instantiate.tsx index 847780519..3f3b5c496 100644 --- a/packages/common/actions/actions/Instantiate.tsx +++ b/packages/common/actions/actions/Instantiate.tsx @@ -4,7 +4,6 @@ import { useCallback, useMemo } from 'react' import { useFormContext } from 'react-hook-form' import { constSelector, useRecoilValue } from 'recoil' -import { useProposalModuleAdapterIfAvailable } from '@dao-dao/proposal-module-adapter/react/context' import { nativeBalancesSelector, transactionEventsSelector, @@ -25,6 +24,7 @@ import { makeWasmMessage, } from '@dao-dao/utils' +import { useProposalModuleAdapterIfAvailable } from '../../proposal-module-adapter/react/context' import { InstantiateComponent as StatelessInstantiateComponent } from '../components/Instantiate' interface InstantiateData { diff --git a/packages/common/actions/actions/Spend.tsx b/packages/common/actions/actions/Spend.tsx index 863f2120a..3a54f8d86 100644 --- a/packages/common/actions/actions/Spend.tsx +++ b/packages/common/actions/actions/Spend.tsx @@ -24,8 +24,8 @@ import { makeWasmMessage, nativeTokenDecimals, } from '@dao-dao/utils' -import { useCw20GovernanceTokenInfoResponseIfExists } from '@dao-dao/voting-module-adapter' +import { useCw20GovernanceTokenInfoResponseIfExists } from '../../voting-module-adapter' import { SpendComponent as StatelessSpendComponent } from '../components/Spend' interface SpendData { diff --git a/packages/common/atoms/newDao.ts b/packages/common/atoms/newDao.ts index cd0756ac5..5d64db271 100644 --- a/packages/common/atoms/newDao.ts +++ b/packages/common/atoms/newDao.ts @@ -1,9 +1,10 @@ import { atom, atomFamily } from 'recoil' -import { CwdProposalSingleAdapter } from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle' import { localStorageEffectJSON } from '@dao-dao/state/recoil/effects' import { DaoCreatedCardProps, NewDao } from '@dao-dao/types' -import { CwdVotingCw4Adapter } from '@dao-dao/voting-module-adapter' + +import { CwdProposalSingleAdapter } from '../proposal-module-adapter/adapters/CwdProposalSingle' +import { CwdVotingCw4Adapter } from '../voting-module-adapter' export const DefaultNewDao: NewDao = { name: '', diff --git a/packages/common/components/CreateDaoForm.tsx b/packages/common/components/CreateDaoForm.tsx index d96fdd94f..d1f5af7c8 100644 --- a/packages/common/components/CreateDaoForm.tsx +++ b/packages/common/components/CreateDaoForm.tsx @@ -9,10 +9,6 @@ import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { useRecoilState } from 'recoil' -import { - ProposalModuleAdapter, - getAdapterById as getProposalModuleAdapterById, -} from '@dao-dao/proposal-module-adapter' import { CwAdminFactoryHooks, useAwaitNextBlock, @@ -33,6 +29,7 @@ import { CreateDaoCustomValidator, DaoParentInfo, NewDao, + ProposalModuleAdapter, } from '@dao-dao/types' import { InstantiateMsg as CwdCoreV2InstantiateMsg } from '@dao-dao/types/contracts/CwdCore.v2' import instantiateSchema from '@dao-dao/types/contracts/CwdCore.v2.instantiate_schema.json' @@ -51,21 +48,22 @@ import { processError, validateUrl, } from '@dao-dao/utils' + +import { + DefaultNewDao, + daoCreatedCardPropsAtom, + newDaoAtom, +} from '../atoms/newDao' +import { getAdapterById as getProposalModuleAdapterById } from '../proposal-module-adapter' import { CwdVotingCw20StakedAdapter, getAdapterById as getVotingModuleAdapterById, getAdapters as getVotingModuleAdapters, -} from '@dao-dao/voting-module-adapter' +} from '../voting-module-adapter' import { DaoCreationConfig as CwdVotingCw20StakedCreationConfig, GovernanceTokenType, -} from '@dao-dao/voting-module-adapter/adapters/CwdVotingCw20Staked/types' - -import { - DefaultNewDao, - daoCreatedCardPropsAtom, - newDaoAtom, -} from '../atoms/newDao' +} from '../voting-module-adapter/adapters/CwdVotingCw20Staked/types' import { SuspenseLoader } from './SuspenseLoader' // i18n keys diff --git a/packages/common/components/DaoInfoBar.tsx b/packages/common/components/DaoInfoBar.tsx index da2c4f891..850de11fd 100644 --- a/packages/common/components/DaoInfoBar.tsx +++ b/packages/common/components/DaoInfoBar.tsx @@ -12,12 +12,12 @@ import { useDaoInfoContext, } from '@dao-dao/stateless' import { loadableToLoadingData } from '@dao-dao/utils' + import { useCw20GovernanceTokenInfoResponseIfExists, useVotingModuleAdapter, -} from '@dao-dao/voting-module-adapter' -import { useVotingModuleAdapterOptions } from '@dao-dao/voting-module-adapter/react/context' - +} from '../voting-module-adapter' +import { useVotingModuleAdapterOptions } from '../voting-module-adapter/react/context' import { SuspenseLoader } from './SuspenseLoader' export const DaoInfoBar = (props: InnerDaoInfoBarProps) => { diff --git a/packages/common/components/DaoPageWrapper.tsx b/packages/common/components/DaoPageWrapper.tsx index bb5f8fe42..f3488e2bc 100644 --- a/packages/common/components/DaoPageWrapper.tsx +++ b/packages/common/components/DaoPageWrapper.tsx @@ -19,9 +19,9 @@ import { DaoInfo, DaoInfoSerializable, } from '@dao-dao/types' -import { VotingModuleAdapterProvider } from '@dao-dao/voting-module-adapter' import { ActionsProvider } from '../actions' +import { VotingModuleAdapterProvider } from '../voting-module-adapter' import { SuspenseLoader } from './SuspenseLoader' import { Trans } from './Trans' diff --git a/packages/common/components/ProposalLine.tsx b/packages/common/components/ProposalLine.tsx index 1be832b80..670a3beaa 100644 --- a/packages/common/components/ProposalLine.tsx +++ b/packages/common/components/ProposalLine.tsx @@ -1,10 +1,5 @@ import { ComponentType } from 'react' -import { SuspenseLoader } from '@dao-dao/common' -import { - ProposalModuleAdapterProvider, - useProposalModuleAdapter, -} from '@dao-dao/proposal-module-adapter' import { Loader as DefaultLoader, Logo as DefaultLogo, @@ -14,6 +9,12 @@ import { } from '@dao-dao/stateless' import { ProposalModule } from '@dao-dao/types' +import { + ProposalModuleAdapterProvider, + useProposalModuleAdapter, +} from '../proposal-module-adapter' +import { SuspenseLoader } from './SuspenseLoader' + export interface ProposalLineProps { chainId: string coreAddress: string diff --git a/packages/common/components/ProposalList.tsx b/packages/common/components/ProposalList.tsx index 29f6733e9..f46a381b0 100644 --- a/packages/common/components/ProposalList.tsx +++ b/packages/common/components/ProposalList.tsx @@ -4,8 +4,6 @@ import { useEffect, useMemo, useState } from 'react' import { useRecoilCallback } from 'recoil' -import { ProposalLine, ProposalLineProps } from '@dao-dao/common' -import { matchAndLoadCommon } from '@dao-dao/proposal-module-adapter' import { useVotingModule } from '@dao-dao/state' import { Loader, @@ -14,6 +12,9 @@ import { useDaoInfoContext, } from '@dao-dao/stateless' +import { matchAndLoadCommon } from '../proposal-module-adapter' +import { ProposalLine, ProposalLineProps } from './ProposalLine' + // Contracts enforce a max of 30, though this is on the edge for DAOs with // proposals that have a large size. const PROP_LOAD_LIMIT = 20 diff --git a/packages/common/hooks/useEncodedCwdProposalSinglePrefill.ts b/packages/common/hooks/useEncodedCwdProposalSinglePrefill.ts index 72f9efaba..13b4479b4 100644 --- a/packages/common/hooks/useEncodedCwdProposalSinglePrefill.ts +++ b/packages/common/hooks/useEncodedCwdProposalSinglePrefill.ts @@ -1,10 +1,11 @@ +import { useDaoInfoContext } from '@dao-dao/stateless' +import { Action, ProposalPrefill } from '@dao-dao/types' + import { CwdProposalSingleAdapter, matchAdapter as matchProposalModuleAdapter, -} from '@dao-dao/proposal-module-adapter' -import { NewProposalForm } from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle/types' -import { useDaoInfoContext } from '@dao-dao/stateless' -import { Action, ProposalPrefill } from '@dao-dao/types' +} from '../proposal-module-adapter' +import { NewProposalForm } from '../proposal-module-adapter/adapters/CwdProposalSingle/types' interface ActionAndData { action: Action diff --git a/packages/common/package.json b/packages/common/package.json index 23cbe3f3f..2169f9434 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -8,17 +8,17 @@ "dependencies": { "@cosmjs/encoding": "0.28.10", "@cosmjs/stargate": "0.28.10", - "@dao-dao/proposal-module-adapter": "2.0.1", "@dao-dao/state": "2.0.1", "@dao-dao/stateless": "2.0.1", "@dao-dao/utils": "2.0.1", - "@dao-dao/voting-module-adapter": "2.0.1", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", "@mui/material": "^5.10.3", "@walletconnect/browser-utils": "^1.8.0", "axios": "^0.26.1", + "a11y-react-emoji": "^1.2.0", + "buffer": "^6.0.3", "clsx": "^1.1.1", "fuse.js": "^6.6.2", "i18next": "^21.8.10", @@ -28,6 +28,7 @@ "react-hook-form": "7.20.4", "react-hot-toast": "^2.1.1", "react-i18next": "^11.0.0", + "react-timeago": "^7.1.0", "recoil": "^0.7.2", "remove-markdown": "^0.5.0" }, diff --git a/packages/proposal-module-adapter/README.md b/packages/common/proposal-module-adapter/README.md similarity index 93% rename from packages/proposal-module-adapter/README.md rename to packages/common/proposal-module-adapter/README.md index aca2fd2db..ee69d1396 100644 --- a/packages/proposal-module-adapter/README.md +++ b/packages/common/proposal-module-adapter/README.md @@ -1,4 +1,4 @@ -# @dao-dao/proposal-module-adapter +# @dao-dao/common/proposal-module-adapter Author: [@NoahSaso](https://github.com/NoahSaso) @@ -34,7 +34,7 @@ of the DAO's core contract, as well as some commonly used components, like `Logo` and `Loader`. ```tsx -import { ProposalModuleAdapterProvider } from '@dao-dao/proposal-module-adapter' +import { ProposalModuleAdapterProvider } from '@dao-dao/common/proposal-module-adapter' const App = () => ( { const { @@ -87,7 +87,7 @@ Here is an example that displays a dropdown of proposal modules and lets you view the voting configuration for each one: ```tsx -import { matchAndLoadCommon } from '@dao-dao/proposal-module-adapter' +import { matchAndLoadCommon } from '@dao-dao/common/proposal-module-adapter' export const DaoInfo = () => { const { coreAddress, proposalModules } = useDaoInfoContext() @@ -137,7 +137,7 @@ All you need to do is define an adapter object and add it to the list of adapters in `core.ts`. ```ts -import { ProposalModuleAdapter } from '@dao-dao/proposal-module-adapter/types' +import { ProposalModuleAdapter } from '@dao-dao/types/proposal-module-adapter' const MyProposalModuleAdapter: ProposalModuleAdapter = { id: 'my_proposal_module_adapter_id', diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/index.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/index.tsx similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/index.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/index.tsx diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/UpdatePreProposeConfigComponent.stories.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/UpdatePreProposeConfigComponent.stories.tsx similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/UpdatePreProposeConfigComponent.stories.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/UpdatePreProposeConfigComponent.stories.tsx diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/UpdatePreProposeConfigComponent.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/UpdatePreProposeConfigComponent.tsx similarity index 96% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/UpdatePreProposeConfigComponent.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/UpdatePreProposeConfigComponent.tsx index 9dd95820f..4f12d6d78 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/UpdatePreProposeConfigComponent.tsx +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/UpdatePreProposeConfigComponent.tsx @@ -1,8 +1,6 @@ import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' -import { ActionCard } from '@dao-dao/common/actions' -import { Trans } from '@dao-dao/common' import { AddressInput, FormSwitchCard, @@ -26,6 +24,9 @@ import { validateRequired, } from '@dao-dao/utils' +import { ActionCard } from '../../../../../../actions' +import { Trans } from '../../../../../../components/Trans' + const DepositRefundPolicyValues = Object.values(DepositRefundPolicy) export interface UpdatePreProposeConfigData { @@ -93,7 +94,7 @@ export const UpdatePreProposeConfigComponent: ActionComponent<

-
+

diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/index.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/index.tsx similarity index 98% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/index.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/index.tsx index 812c698c8..0ec5df144 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/index.tsx +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdatePreProposeConfigAction/index.tsx @@ -27,8 +27,8 @@ import { isValidContractAddress, makeWasmMessage, } from '@dao-dao/utils' -import { useCw20GovernanceTokenInfoResponseIfExists } from '@dao-dao/voting-module-adapter/react/hooks' +import { useCw20GovernanceTokenInfoResponseIfExists } from '../../../../../../voting-module-adapter/react/hooks/useCw20GovernanceTokenInfoResponseIfExists' import { configSelector } from '../../../contracts/CwdPreProposeSingle.recoil' import { UpdatePreProposeConfigComponent, diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/UpdateProposalConfigComponent.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/UpdateProposalConfigComponent.tsx similarity index 91% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/UpdateProposalConfigComponent.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/UpdateProposalConfigComponent.tsx index fd037655c..b02556ff5 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/UpdateProposalConfigComponent.tsx +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/UpdateProposalConfigComponent.tsx @@ -2,8 +2,6 @@ import Emoji from 'a11y-react-emoji' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' -import { ActionCard } from '@dao-dao/common/actions' -import { Trans } from '@dao-dao/common' import { FormSwitch, FormSwitchCard, @@ -21,6 +19,9 @@ import { validateRequired, } from '@dao-dao/utils' +import { ActionCard } from '../../../../../../actions' +import { Trans } from '../../../../../../components/Trans' + export interface UpdateProposalConfigOptions { governanceTokenSymbol?: string } @@ -74,7 +75,7 @@ export const UpdateProposalConfigComponent: ActionComponent<

{governanceTokenSymbol !== undefined && ( -
+
)} -
+
{depositRequired && ( -
+

{' '} @@ -143,7 +144,7 @@ export const UpdateProposalConfigComponent: ActionComponent< />

-
+
)} -
+

{' '} @@ -215,7 +216,7 @@ export const UpdateProposalConfigComponent: ActionComponent<

-
+

@@ -272,7 +273,7 @@ export const UpdateProposalConfigComponent: ActionComponent<

)}
-
+

{' '} @@ -343,7 +344,7 @@ export const UpdateProposalConfigComponent: ActionComponent<

-
+

{' '} diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/index.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/index.tsx similarity index 99% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/index.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/index.tsx index a9a6c5255..081761567 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/index.tsx +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV1Action/index.tsx @@ -19,8 +19,8 @@ import { convertMicroDenomToDenomWithDecimals, makeWasmMessage, } from '@dao-dao/utils' -import { useVotingModuleAdapter } from '@dao-dao/voting-module-adapter' +import { useVotingModuleAdapter } from '../../../../../../voting-module-adapter' import { configSelector } from '../../../contracts/CwProposalSingle.v1.recoil' import { UpdateProposalConfigComponent } from './UpdateProposalConfigComponent' diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/UpdateProposalConfigComponent.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/UpdateProposalConfigComponent.tsx similarity index 91% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/UpdateProposalConfigComponent.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/UpdateProposalConfigComponent.tsx index fd037655c..b02556ff5 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/UpdateProposalConfigComponent.tsx +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/UpdateProposalConfigComponent.tsx @@ -2,8 +2,6 @@ import Emoji from 'a11y-react-emoji' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' -import { ActionCard } from '@dao-dao/common/actions' -import { Trans } from '@dao-dao/common' import { FormSwitch, FormSwitchCard, @@ -21,6 +19,9 @@ import { validateRequired, } from '@dao-dao/utils' +import { ActionCard } from '../../../../../../actions' +import { Trans } from '../../../../../../components/Trans' + export interface UpdateProposalConfigOptions { governanceTokenSymbol?: string } @@ -74,7 +75,7 @@ export const UpdateProposalConfigComponent: ActionComponent<

{governanceTokenSymbol !== undefined && ( -
+
)} -
+
{depositRequired && ( -
+

{' '} @@ -143,7 +144,7 @@ export const UpdateProposalConfigComponent: ActionComponent< />

-
+
)} -
+

{' '} @@ -215,7 +216,7 @@ export const UpdateProposalConfigComponent: ActionComponent<

-
+

@@ -272,7 +273,7 @@ export const UpdateProposalConfigComponent: ActionComponent<

)}
-
+

{' '} @@ -343,7 +344,7 @@ export const UpdateProposalConfigComponent: ActionComponent<

-
+

{' '} diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/index.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/index.tsx similarity index 99% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/index.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/index.tsx index fe740f23c..b34966a56 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/index.tsx +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/actions/makeUpdateProposalConfigV2Action/index.tsx @@ -15,8 +15,8 @@ import { import { Threshold } from '@dao-dao/types/contracts/CwdProposalSingle.common' import { ExecuteMsg } from '@dao-dao/types/contracts/CwdProposalSingle.v2' import { makeWasmMessage } from '@dao-dao/utils' -import { useVotingModuleAdapter } from '@dao-dao/voting-module-adapter' +import { useVotingModuleAdapter } from '../../../../../../voting-module-adapter' import { configSelector } from '../../../contracts/CwdProposalSingle.v2.recoil' import { UpdateProposalConfigComponent } from './UpdateProposalConfigComponent' diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/components/NewProposal.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/components/NewProposal.tsx similarity index 98% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/components/NewProposal.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/components/NewProposal.tsx index f7a41d68d..863a25943 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/components/NewProposal.tsx +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/components/NewProposal.tsx @@ -13,7 +13,6 @@ import { useSetRecoilState, } from 'recoil' -import { useActions } from '@dao-dao/common/actions' import { Cw20BaseHooks, Cw20BaseSelectors, @@ -29,6 +28,7 @@ import { useCachedLoadable, useDaoInfoContext } from '@dao-dao/stateless' import { Action, ActionKey, + BaseNewProposalProps, ContractVersion, UseDefaults, UseTransformToCosmos, @@ -39,9 +39,9 @@ import { expirationExpired, processError, } from '@dao-dao/utils' -import { useVotingModuleAdapter } from '@dao-dao/voting-module-adapter' -import { BaseNewProposalProps } from '../../../../types' +import { useActions } from '../../../../../actions' +import { useVotingModuleAdapter } from '../../../../../voting-module-adapter' import { usePropose as useProposePrePropose } from '../../contracts/CwdPreProposeSingle.hooks' import { proposalSelector } from '../../contracts/CwdProposalSingle.common.recoil' import { usePropose as useProposeV2 } from '../../contracts/CwdProposalSingle.v2.hooks' diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/components/index.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/components/index.tsx similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/components/index.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/components/index.tsx diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/index.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/index.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/index.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/index.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/makeUseActions.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/makeUseActions.ts similarity index 92% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/makeUseActions.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/makeUseActions.ts index c5101e5a7..e6248abde 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/makeUseActions.ts +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/makeUseActions.ts @@ -1,8 +1,8 @@ import { useMemo } from 'react' -import { useActionOptions } from '@dao-dao/common/actions/react/context' import { Action, IProposalModuleAdapterCommonOptions } from '@dao-dao/types' +import { useActionOptions } from '../../../../../actions' import { makeUpdatePreProposeConfigAction, makeUpdateProposalConfigV1Action, diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/makeUseProfileNewProposalCardInfoLines.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/makeUseProfileNewProposalCardInfoLines.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/makeUseProfileNewProposalCardInfoLines.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/makeUseProfileNewProposalCardInfoLines.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/useProcessTQ.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/useProcessTQ.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/useProcessTQ.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/hooks/useProcessTQ.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/index.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/index.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/index.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/index.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/selectors.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/selectors.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/selectors.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/selectors.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.stories.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.stories.tsx similarity index 94% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.stories.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.stories.tsx index 7c6b2074f..f53e1da0e 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.stories.tsx +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.stories.tsx @@ -2,7 +2,6 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { useMemo } from 'react' import { FormProvider, useForm } from 'react-hook-form' -import { useActions } from '@dao-dao/common/actions' import { Loader, Logo, useDaoInfoContext } from '@dao-dao/stateless' import { DaoPageWrapperDecorator, @@ -14,10 +13,11 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types' -import { useVotingModuleAdapter } from '@dao-dao/voting-module-adapter' -import { CwdProposalSingleAdapter } from '../..' +import { useActions } from '../../../../../actions' +import { useVotingModuleAdapter } from '../../../../../voting-module-adapter' import { matchAdapter as matchProposalModuleAdapter } from '../../../../core' +import { CwdProposalSingleAdapter } from '../../index' import { NewProposalForm } from '../../types' import { makeUseActions as makeUseProposalModuleActions } from '../hooks' import { NewProposal } from './NewProposal' diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.tsx similarity index 95% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.tsx index 91e35e240..08334a1f7 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.tsx +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.tsx @@ -14,7 +14,6 @@ import { } from 'react-hook-form' import { useTranslation } from 'react-i18next' -import { SuspenseLoader } from '@dao-dao/common' import { useWalletProfile } from '@dao-dao/state' import { ActionCardLoader, @@ -32,16 +31,15 @@ import { import { Action, ActionKey, + BaseNewProposalProps, + IProposalModuleAdapterCommonOptions, UseDefaults, UseTransformToCosmos, } from '@dao-dao/types' import { CosmosMsgFor_Empty } from '@dao-dao/types/contracts/common' import { decodedMessagesString, validateRequired } from '@dao-dao/utils' -import { - BaseNewProposalProps, - IProposalModuleAdapterCommonOptions, -} from '../../../../types' +import { SuspenseLoader } from '../../../../../components/SuspenseLoader' import { NewProposalData, NewProposalForm } from '../../types' enum ProposeSubmitValue { @@ -157,8 +155,8 @@ export const NewProposal = ({ return (
-
-
+
+

{t('form.proposalsName')}

@@ -198,7 +196,7 @@ export const NewProposal = ({
-

+

{t('title.actions', { count: proposalActionData.length })}

@@ -244,9 +242,9 @@ export const NewProposal = ({ }} /> -
+
-

+

{t('info.reviewYourProposal')}

@@ -299,13 +297,13 @@ export const NewProposal = ({
{showSubmitErrorNote && ( -

+

{t('error.createProposalSubmitInvalid')}

)} {showPreview && ( -
+
+
{/* Threshold title */}

@@ -156,11 +156,11 @@ export const ProposalVoteTally = ({ {/* A proposal will automatically close once no more votes can affect the outcome, not waiting for the expiration time. This means we can simply check if the proposal is open to know whether the threshold being reached indicates a final verdict or just the current state of the turnout. We could, more verbosely, always display the final verdict (reached/not met) when there is no quorum (i.e. if using an absolute threshold config), but once the final verdict is set, the status will change. Thus, we don't need to check if a quorum exists to choose this status indicator. */} {thresholdReached ? ( - + ) : ( - + )}

@@ -169,7 +169,7 @@ export const ProposalVoteTally = ({ {/* Quorum, if present */} {effectiveQuorum && ( -
+
{/* Quorum title */}

{t('title.percentTurnout', { @@ -213,11 +213,11 @@ export const ProposalVoteTally = ({ {quorumReached ? ( - + ) : ( - + )}

@@ -233,7 +233,7 @@ export const ProposalVoteTally = ({ effectiveThresholdValue === 50 && turnoutTotal > 0 && yesVotes === noVotes && ( -
+

{t('title.proposalTieClarification')}

@@ -247,7 +247,7 @@ export const ProposalVoteTally = ({ {/* Provide clarification for what happens in the event that all voters abstain. */} {turnoutTotal > 0 && abstainVotes === turnoutTotal && ( -
+

{t('title.proposalAllAbstain')}

diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.client.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.client.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.client.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.client.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.hooks.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.hooks.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.hooks.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.hooks.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.recoil.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.recoil.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.recoil.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwProposalSingle.v1.recoil.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.client.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.client.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.client.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.client.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.hooks.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.hooks.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.hooks.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.hooks.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.recoil.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.recoil.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.recoil.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdPreProposeSingle.recoil.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.common.recoil.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.common.recoil.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.common.recoil.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.common.recoil.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.client.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.client.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.client.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.client.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.hooks.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.hooks.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.hooks.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.hooks.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.recoil.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.recoil.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.recoil.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/contracts/CwdProposalSingle.v2.recoil.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/AllowRevotingVotingConfigItem.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/AllowRevotingVotingConfigItem.tsx similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/AllowRevotingVotingConfigItem.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/AllowRevotingVotingConfigItem.tsx diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/ProposalDepositVotingConfigItem.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/ProposalDepositVotingConfigItem.tsx similarity index 98% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/ProposalDepositVotingConfigItem.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/ProposalDepositVotingConfigItem.tsx index 4c920ad06..1d0051c3a 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/ProposalDepositVotingConfigItem.tsx +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/ProposalDepositVotingConfigItem.tsx @@ -29,12 +29,12 @@ import { validateContractAddress, validatePositive, } from '@dao-dao/utils' -import { CwdVotingCw20StakedAdapter } from '@dao-dao/voting-module-adapter' + +import { CwdVotingCw20StakedAdapter } from '../../../../voting-module-adapter' import { DaoCreationConfig as CwdVotingCw20StakedConfig, GovernanceTokenType, -} from '@dao-dao/voting-module-adapter/adapters/CwdVotingCw20Staked/types' - +} from '../../../../voting-module-adapter/adapters/CwdVotingCw20Staked/types' import { DaoCreationConfig } from '../types' const DepositRefundPolicyValues = Object.values(DepositRefundPolicy) diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/QuorumVotingConfigItem.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/QuorumVotingConfigItem.tsx similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/QuorumVotingConfigItem.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/QuorumVotingConfigItem.tsx diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/ThresholdVotingConfigItem.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/ThresholdVotingConfigItem.tsx similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/ThresholdVotingConfigItem.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/ThresholdVotingConfigItem.tsx diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/VotingDurationVotingConfigItem.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/VotingDurationVotingConfigItem.tsx similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/VotingDurationVotingConfigItem.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/VotingDurationVotingConfigItem.tsx diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/getInstantiateInfo.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/getInstantiateInfo.ts similarity index 96% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/getInstantiateInfo.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/getInstantiateInfo.ts index e3a955295..9bd8d3271 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/getInstantiateInfo.ts +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/getInstantiateInfo.ts @@ -12,12 +12,12 @@ import { nativeTokenDecimals, } from '@dao-dao/utils' import { makeValidateMsg } from '@dao-dao/utils/validation/makeValidateMsg' -import { CwdVotingCw20StakedAdapter } from '@dao-dao/voting-module-adapter/adapters/CwdVotingCw20Staked' + +import { CwdVotingCw20StakedAdapter } from '../../../../voting-module-adapter/adapters/CwdVotingCw20Staked' import { DaoCreationConfig as CwdVotingCw20StakedConfig, GovernanceTokenType, -} from '@dao-dao/voting-module-adapter/adapters/CwdVotingCw20Staked/types' - +} from '../../../../voting-module-adapter/adapters/CwdVotingCw20Staked/types' import { CwdProposalSingleAdapter } from '../../index' import { DaoCreationConfig } from '../types' import { convertThresholdValueToPercentageThreshold } from '../utils' diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/index.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/index.tsx similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/index.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/index.tsx diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/instantiate_schema.json b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/instantiate_schema.json similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/instantiate_schema.json rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/instantiate_schema.json diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/pre_propose_instantiate_schema.json b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/pre_propose_instantiate_schema.json similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/pre_propose_instantiate_schema.json rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation/pre_propose_instantiate_schema.json diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/functions/fetchPreProposeAddress.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/functions/fetchPreProposeAddress.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/functions/fetchPreProposeAddress.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/functions/fetchPreProposeAddress.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/functions/index.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/functions/index.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/functions/index.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/functions/index.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/functions/makeGetProposalInfo.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/functions/makeGetProposalInfo.ts similarity index 97% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/functions/makeGetProposalInfo.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/functions/makeGetProposalInfo.ts index 34c25b44e..9a697a9cb 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/functions/makeGetProposalInfo.ts +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/functions/makeGetProposalInfo.ts @@ -7,7 +7,11 @@ import { getGetProposalSubqueryId, client as subqueryClient, } from '@dao-dao/state/subquery' -import { ContractVersion } from '@dao-dao/types' +import { + CommonProposalInfo, + ContractVersion, + IProposalModuleAdapterOptions, +} from '@dao-dao/types' import { Status } from '@dao-dao/types/contracts/CwdProposalSingle.common' import { InfoResponse, @@ -16,10 +20,6 @@ import { import { ProposalResponse as ProposalV1Response } from '@dao-dao/types/contracts/CwProposalSingle.v1' import { parseContractVersion, processError } from '@dao-dao/utils' -import { - CommonProposalInfo, - IProposalModuleAdapterOptions, -} from '../../../types' import { CwdProposalSingleV2QueryClient as CwdProposalSingleV2QueryClient } from '../contracts/CwdProposalSingle.v2.client' import { CwProposalSingleV1QueryClient as CwProposalSingleV1QueryClient } from '../contracts/CwProposalSingle.v1.client' diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/index.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/index.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/index.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/index.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useCastVote.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useCastVote.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useCastVote.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useCastVote.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useDepositInfo.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useDepositInfo.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useDepositInfo.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useDepositInfo.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProfileVoteCardOptions.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProfileVoteCardOptions.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProfileVoteCardOptions.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProfileVoteCardOptions.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposal.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposal.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposal.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposal.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalExecutionTxHash.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalExecutionTxHash.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalExecutionTxHash.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalExecutionTxHash.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalProcessedTQ.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalProcessedTQ.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalProcessedTQ.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalProcessedTQ.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalRefreshers.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalRefreshers.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalRefreshers.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useProposalRefreshers.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useVotesInfo.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useVotesInfo.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useVotesInfo.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useVotesInfo.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useWalletVoteInfo.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useWalletVoteInfo.tsx similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useWalletVoteInfo.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/hooks/useWalletVoteInfo.tsx diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/index.tsx b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/index.tsx similarity index 96% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/index.tsx rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/index.tsx index 1d0c79cb5..99def015c 100644 --- a/packages/proposal-module-adapter/adapters/CwdProposalSingle/index.tsx +++ b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/index.tsx @@ -1,7 +1,10 @@ -import { DepositRefundPolicy, DurationUnits } from '@dao-dao/types' +import { + DepositRefundPolicy, + DurationUnits, + ProposalModuleAdapter, +} from '@dao-dao/types' import { Vote } from '@dao-dao/types/contracts/CwdProposalSingle.common' -import { ProposalModuleAdapter } from '../../types' import { NewProposal, makeDepositInfo, diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/types.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/types.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/types.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/types.ts diff --git a/packages/proposal-module-adapter/adapters/CwdProposalSingle/utils.ts b/packages/common/proposal-module-adapter/adapters/CwdProposalSingle/utils.ts similarity index 100% rename from packages/proposal-module-adapter/adapters/CwdProposalSingle/utils.ts rename to packages/common/proposal-module-adapter/adapters/CwdProposalSingle/utils.ts diff --git a/packages/proposal-module-adapter/adapters/index.tsx b/packages/common/proposal-module-adapter/adapters/index.tsx similarity index 100% rename from packages/proposal-module-adapter/adapters/index.tsx rename to packages/common/proposal-module-adapter/adapters/index.tsx diff --git a/packages/proposal-module-adapter/core.ts b/packages/common/proposal-module-adapter/core.ts similarity index 98% rename from packages/proposal-module-adapter/core.ts rename to packages/common/proposal-module-adapter/core.ts index 3619c7afe..7aea7cbe7 100644 --- a/packages/proposal-module-adapter/core.ts +++ b/packages/common/proposal-module-adapter/core.ts @@ -1,14 +1,14 @@ -import { ProposalModule } from '@dao-dao/types' -import { normalizeContractName } from '@dao-dao/utils' - -import { CwdProposalSingleAdapter } from './adapters' import { IProposalModuleAdapterCommon, IProposalModuleAdapterInitialOptions, IProposalModuleAdapterOptions, IProposalModuleContext, + ProposalModule, ProposalModuleAdapter, -} from './types' +} from '@dao-dao/types' +import { normalizeContractName } from '@dao-dao/utils' + +import { CwdProposalSingleAdapter } from './adapters' // Adapters need to be loaded lazily like this, as opposed to just defining a // global array, due to cyclic dependencies. The adapter defintion files include diff --git a/packages/proposal-module-adapter/index.tsx b/packages/common/proposal-module-adapter/index.tsx similarity index 80% rename from packages/proposal-module-adapter/index.tsx rename to packages/common/proposal-module-adapter/index.tsx index 70caadf5a..0ff24aec0 100644 --- a/packages/proposal-module-adapter/index.tsx +++ b/packages/common/proposal-module-adapter/index.tsx @@ -2,4 +2,3 @@ export * from './adapters' export * from './core' export * from './react' export * from './recoil' -export * from './types' diff --git a/packages/proposal-module-adapter/react/context.ts b/packages/common/proposal-module-adapter/react/context.ts similarity index 97% rename from packages/proposal-module-adapter/react/context.ts rename to packages/common/proposal-module-adapter/react/context.ts index 330560546..ddcae20ca 100644 --- a/packages/proposal-module-adapter/react/context.ts +++ b/packages/common/proposal-module-adapter/react/context.ts @@ -5,7 +5,7 @@ import { IProposalModuleAdapterCommon, IProposalModuleAdapterOptions, IProposalModuleContext, -} from '../types' +} from '@dao-dao/types' // External API diff --git a/packages/proposal-module-adapter/react/index.tsx b/packages/common/proposal-module-adapter/react/index.tsx similarity index 100% rename from packages/proposal-module-adapter/react/index.tsx rename to packages/common/proposal-module-adapter/react/index.tsx diff --git a/packages/proposal-module-adapter/react/provider.tsx b/packages/common/proposal-module-adapter/react/provider.tsx similarity index 94% rename from packages/proposal-module-adapter/react/provider.tsx rename to packages/common/proposal-module-adapter/react/provider.tsx index f21ae9852..5f638eb92 100644 --- a/packages/proposal-module-adapter/react/provider.tsx +++ b/packages/common/proposal-module-adapter/react/provider.tsx @@ -1,12 +1,12 @@ import { ReactNode, useState } from 'react' -import { ProposalModule } from '@dao-dao/types' - -import { matchAndLoadAdapter } from '../core' import { IProposalModuleAdapterInitialOptions, IProposalModuleContext, -} from '../types' + ProposalModule, +} from '@dao-dao/types' + +import { matchAndLoadAdapter } from '../core' import { ProposalModuleAdapterContext } from './context' export interface ProposalModuleAdapterProviderProps { diff --git a/packages/proposal-module-adapter/recoil/index.ts b/packages/common/proposal-module-adapter/recoil/index.ts similarity index 100% rename from packages/proposal-module-adapter/recoil/index.ts rename to packages/common/proposal-module-adapter/recoil/index.ts diff --git a/packages/proposal-module-adapter/recoil/selectors.ts b/packages/common/proposal-module-adapter/recoil/selectors.ts similarity index 100% rename from packages/proposal-module-adapter/recoil/selectors.ts rename to packages/common/proposal-module-adapter/recoil/selectors.ts diff --git a/packages/proposal-module-adapter/tsconfig.json b/packages/common/proposal-module-adapter/tsconfig.json similarity index 100% rename from packages/proposal-module-adapter/tsconfig.json rename to packages/common/proposal-module-adapter/tsconfig.json diff --git a/packages/common/selectors/dao.ts b/packages/common/selectors/dao.ts index ccb14ac91..942ed74a1 100644 --- a/packages/common/selectors/dao.ts +++ b/packages/common/selectors/dao.ts @@ -1,6 +1,5 @@ import { selectorFamily, waitForAll } from 'recoil' -import { proposalModuleAdapterProposalCountSelector } from '@dao-dao/proposal-module-adapter' import { CwdCoreV2Selectors, CwdVotingCw20StakedSelectors, @@ -13,10 +12,11 @@ import { ProposalModule, WithChainId, } from '@dao-dao/types' -import { matchAdapter as matchVotingModuleAdapter } from '@dao-dao/voting-module-adapter' -import { CwdVotingCw20StakedAdapter } from '@dao-dao/voting-module-adapter/adapters/CwdVotingCw20Staked' +import { proposalModuleAdapterProposalCountSelector } from '../proposal-module-adapter' import { fetchProposalModules } from '../utils/fetchProposalModules' +import { matchAdapter as matchVotingModuleAdapter } from '../voting-module-adapter' +import { CwdVotingCw20StakedAdapter } from '../voting-module-adapter/adapters/CwdVotingCw20Staked' export const cwCoreProposalModulesSelector = selectorFamily< ProposalModule[], diff --git a/packages/common/server/makeGetDaoStaticProps.ts b/packages/common/server/makeGetDaoStaticProps.ts index d0be1e622..5fe4c9d2b 100644 --- a/packages/common/server/makeGetDaoStaticProps.ts +++ b/packages/common/server/makeGetDaoStaticProps.ts @@ -6,15 +6,15 @@ import { TFunction } from 'next-i18next' import removeMarkdown from 'remove-markdown' import { serverSideTranslationsWithServerT } from '@dao-dao/i18n/serverSideTranslations' -import { - CommonProposalInfo, - ProposalModuleAdapterError, - matchAndLoadAdapter, -} from '@dao-dao/proposal-module-adapter' import { CwdCoreV2QueryClient } from '@dao-dao/state' import { getDaoCreated } from '@dao-dao/state/subquery/daos/created' import { Loader, Logo } from '@dao-dao/stateless' -import { ContractVersion, DaoParentInfo, ProposalModule } from '@dao-dao/types' +import { + CommonProposalInfo, + ContractVersion, + DaoParentInfo, + ProposalModule, +} from '@dao-dao/types' import { ConfigResponse as ConfigV1Response } from '@dao-dao/types/contracts/CwCore.v1' import { ConfigResponse as ConfigV2Response } from '@dao-dao/types/contracts/CwdCore.v2' import { @@ -32,6 +32,10 @@ import { } from '@dao-dao/utils' import { DaoPageWrapperProps } from '../components' +import { + ProposalModuleAdapterError, + matchAndLoadAdapter, +} from '../proposal-module-adapter' import { fetchProposalModules } from '../utils/fetchProposalModules' interface GetDaoStaticPropsMakerProps { diff --git a/packages/common/tailwind.config.js b/packages/common/tailwind.config.js index ed7e1e58b..73703ee5b 100644 --- a/packages/common/tailwind.config.js +++ b/packages/common/tailwind.config.js @@ -1,9 +1,6 @@ /** @type {import("tailwindcss/tailwind-config").TailwindConfig} */ const tailwindConfig = { - content: [ - './**/*.{js,jsx,ts,tsx}', - '../{stateless,state,actions}/**/*.{js,jsx,ts,tsx}', - ], + content: ['./**/*.{js,jsx,ts,tsx}', '../**/*.{js,jsx,ts,tsx}'], presets: [require('@dao-dao/config/tailwind/config')], } diff --git a/packages/common/utils/fetchProposalModules.ts b/packages/common/utils/fetchProposalModules.ts index 0c67ccb30..3be0089f9 100644 --- a/packages/common/utils/fetchProposalModules.ts +++ b/packages/common/utils/fetchProposalModules.ts @@ -1,17 +1,19 @@ import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate' +import { CwCoreV1QueryClient, CwdCoreV2QueryClient } from '@dao-dao/state' import { + ContractVersion, FetchPreProposeAddressFunction, - matchAdapter, -} from '@dao-dao/proposal-module-adapter' -import { CwCoreV1QueryClient, CwdCoreV2QueryClient } from '@dao-dao/state' -import { ContractVersion, ProposalModule } from '@dao-dao/types' + ProposalModule, +} from '@dao-dao/types' import { InfoResponse } from '@dao-dao/types/contracts/common' import { indexToProposalModulePrefix, parseContractVersion, } from '@dao-dao/utils' +import { matchAdapter } from '../proposal-module-adapter' + export const fetchProposalModules = async ( cwClient: CosmWasmClient, coreAddress: string, diff --git a/packages/voting-module-adapter/README.md b/packages/common/voting-module-adapter/README.md similarity index 96% rename from packages/voting-module-adapter/README.md rename to packages/common/voting-module-adapter/README.md index f7ebc539c..c6dc24aa1 100644 --- a/packages/voting-module-adapter/README.md +++ b/packages/common/voting-module-adapter/README.md @@ -1,4 +1,4 @@ -# @dao-dao/voting-module-adapter +# @dao-dao/common/voting-module-adapter Author: [@NoahSaso](https://github.com/NoahSaso) @@ -309,7 +309,7 @@ of the DAO's core contract, as well as some commonly used components, like `Logo` and `Loader`. ```tsx -import { VotingModuleAdapterProvider } from '@dao-dao/voting-module-adapter' +import { VotingModuleAdapterProvider } from '@dao-dao/common/voting-module-adapter' const App = () => ( { const { @@ -382,7 +382,7 @@ All you need to do is define an adapter object and register it using the registration function shown above. ```ts -import { VotingModuleAdapter } from '@dao-dao/voting-module-adapter/types' +import { VotingModuleAdapter } from '@dao-dao/types/voting-module-adapter' const MyVotingModuleAdapter: VotingModuleAdapter = { id: 'my_voting_module_adapter_id', @@ -420,7 +420,7 @@ Example: `CwdVotingCw20Staked/components/DaoTreasuryFooter.tsx` ```tsx -import { useVotingModuleAdapterOptions } from '@dao-dao/voting-module-adapter/react/context' +import { useVotingModuleAdapterOptions } from '@dao-dao/common/voting-module-adapter/react/context' const DaoTreasuryFooter = () => { const { t } = useTranslation() diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/index.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/index.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/index.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/index.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/makeMintAction/MintComponent.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/makeMintAction/MintComponent.tsx similarity index 95% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/makeMintAction/MintComponent.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/makeMintAction/MintComponent.tsx index 03593c4e1..e8d9af0a2 100644 --- a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/makeMintAction/MintComponent.tsx +++ b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/makeMintAction/MintComponent.tsx @@ -2,7 +2,6 @@ import Emoji from 'a11y-react-emoji' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' -import { ActionCard } from '@dao-dao/common/actions' import { AddressInput, InputErrorMessage, @@ -15,6 +14,8 @@ import { validateRequired, } from '@dao-dao/utils' +import { ActionCard } from '../../../../../actions' + export interface MintOptions { govTokenSymbol: string } @@ -58,7 +59,7 @@ export const MintComponent: ActionComponent = ({
{govTokenSymbol && ( -

+

${govTokenSymbol}

)} diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/makeMintAction/index.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/makeMintAction/index.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/makeMintAction/index.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/actions/makeMintAction/index.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/components/ProfileCardMemberInfo/StakingModal.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/components/ProfileCardMemberInfo/StakingModal.tsx similarity index 98% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/components/ProfileCardMemberInfo/StakingModal.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/components/ProfileCardMemberInfo/StakingModal.tsx index 8bb05c497..44e981ad8 100644 --- a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/components/ProfileCardMemberInfo/StakingModal.tsx +++ b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/components/ProfileCardMemberInfo/StakingModal.tsx @@ -9,7 +9,6 @@ import { useSetRecoilState, } from 'recoil' -import { SuspenseLoader } from '@dao-dao/common' import { Cw20BaseHooks, Cw20StakeHooks, @@ -24,14 +23,15 @@ import { StakingMode, StakingModal as StatelessStakingModal, } from '@dao-dao/stateless' +import { BaseStakingModalProps } from '@dao-dao/types' import { convertDenomToMicroDenomWithDecimals, convertMicroDenomToDenomWithDecimals, processError, } from '@dao-dao/utils' +import { SuspenseLoader } from '../../../../../components' import { useVotingModuleAdapterOptions } from '../../../../react/context' -import { BaseStakingModalProps } from '../../../../types' import { useGovernanceTokenInfo, useStakingInfo } from '../../hooks' export const StakingModal = (props: BaseStakingModalProps) => ( diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/components/ProfileCardMemberInfo/index.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/components/ProfileCardMemberInfo/index.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/components/ProfileCardMemberInfo/index.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/components/ProfileCardMemberInfo/index.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/components/index.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/components/index.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/components/index.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/components/index.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/DisplayInfoIcon.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/DisplayInfoIcon.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/DisplayInfoIcon.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/DisplayInfoIcon.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/GovernanceConfigurationInput.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/GovernanceConfigurationInput.tsx similarity index 93% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/GovernanceConfigurationInput.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/GovernanceConfigurationInput.tsx index 39212f59e..e423f0fa7 100644 --- a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/GovernanceConfigurationInput.tsx +++ b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/GovernanceConfigurationInput.tsx @@ -266,8 +266,8 @@ export const GovernanceConfigurationInput = ({ {data.tokenType === GovernanceTokenType.New ? ( <> -
-
+
+

{t('form.tokenDefinition')}

@@ -285,11 +285,11 @@ export const GovernanceConfigurationInput = ({ watch={watch} />
-
+
-

+

$

-
+

{t('form.initialSupply')}

@@ -334,7 +334,7 @@ export const GovernanceConfigurationInput = ({
-

+

$ {data.newInfo.symbol.trim() || t('info.token').toLocaleUpperCase()} @@ -370,7 +370,7 @@ export const GovernanceConfigurationInput = ({

-

+

%

@@ -453,7 +453,7 @@ export const GovernanceConfigurationInput = ({ ref={addTierRef} variant="secondary" > - +

{t('button.addTier')}

@@ -464,8 +464,8 @@ export const GovernanceConfigurationInput = ({
) : data.tokenType === GovernanceTokenType.Existing ? ( -
-
+
+

{t('form.tokenContractAddressTitle')}

@@ -474,7 +474,7 @@ export const GovernanceConfigurationInput = ({
-
+
+

{t('title.existingToken')}

diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.stories.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.stories.tsx similarity index 96% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.stories.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.stories.tsx index 7cf2eca7b..0023ff9c9 100644 --- a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.stories.tsx +++ b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.stories.tsx @@ -1,9 +1,9 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { useForm } from 'react-hook-form' -import { DefaultNewDao } from '@dao-dao/common' import { NewDao } from '@dao-dao/types' +import { DefaultNewDao } from '../../../../atoms' import { CwdVotingCw20StakedAdapter } from '../../../index' import { DaoCreationConfig } from '../types' import { TierCard } from './TierCard' diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.tsx similarity index 94% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.tsx index da5c2abdf..01eafe881 100644 --- a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.tsx +++ b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/TierCard.tsx @@ -80,8 +80,8 @@ export const TierCard = ({ const tierVotingWeight = data.tiers?.[tierIndex]?.weight ?? 0 return ( -
-
+
+
{!showColorDotOnMember && (
-
+
-
+
(
@@ -251,7 +251,7 @@ export const TierCard = ({ onClick={() => appendMember({ address: '' })} variant="ghost" > - +

{t('button.addMember')}

diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/UnstakingDurationVotingConfigItem.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/UnstakingDurationVotingConfigItem.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/UnstakingDurationVotingConfigItem.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/UnstakingDurationVotingConfigItem.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/getInstantiateInfo.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/getInstantiateInfo.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/getInstantiateInfo.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/getInstantiateInfo.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/index.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/index.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/index.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/index.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/instantiate_schema.json b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/instantiate_schema.json similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/instantiate_schema.json rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/daoCreation/instantiate_schema.json diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/index.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/index.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/index.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/index.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useActions.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useActions.ts similarity index 80% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useActions.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useActions.ts index 2e6bf4b29..42b8fe954 100644 --- a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useActions.ts +++ b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useActions.ts @@ -1,8 +1,8 @@ import { useMemo } from 'react' -import { useActionOptions } from '@dao-dao/common/actions/react/context' import { Action } from '@dao-dao/types' +import { useActionOptions } from '../../../../actions' import { makeMintAction } from '../actions' export const useActions = (): Action[] => { diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useDaoInfoBarItems.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useDaoInfoBarItems.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useDaoInfoBarItems.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useDaoInfoBarItems.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useGovernanceTokenInfo.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useGovernanceTokenInfo.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useGovernanceTokenInfo.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useGovernanceTokenInfo.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useProfileNewProposalCardAddresses.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useProfileNewProposalCardAddresses.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useProfileNewProposalCardAddresses.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useProfileNewProposalCardAddresses.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useStakingInfo.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useStakingInfo.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useStakingInfo.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/hooks/useStakingInfo.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/index.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/index.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/index.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/index.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw20Staked/types.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/types.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw20Staked/types.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw20Staked/types.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/actions/index.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/actions/index.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/actions/index.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/actions/index.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/actions/makeManageMembersAction/ManageMembersComponent.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/actions/makeManageMembersAction/ManageMembersComponent.tsx similarity index 97% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/actions/makeManageMembersAction/ManageMembersComponent.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/actions/makeManageMembersAction/ManageMembersComponent.tsx index 7192658b3..4ad90f498 100644 --- a/packages/voting-module-adapter/adapters/CwdVotingCw4/actions/makeManageMembersAction/ManageMembersComponent.tsx +++ b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/actions/makeManageMembersAction/ManageMembersComponent.tsx @@ -3,7 +3,6 @@ import Emoji from 'a11y-react-emoji' import { useFieldArray, useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' -import { ActionCard } from '@dao-dao/common/actions' import { AddressInput, Button, @@ -20,6 +19,8 @@ import { validateRequired, } from '@dao-dao/utils' +import { ActionCard } from '../../../../../actions' + export interface ManageMembersData { toAdd: Member[] toRemove: { addr: string }[] @@ -127,7 +128,7 @@ export const ManageMembersComponent: ActionComponent = ({ ) })} {!isCreating && toAddFields.length === 0 && ( -

{t('info.none')}

+

{t('info.none')}

)} {isCreating && (
))} {!isCreating && toRemoveFields.length === 0 && ( -

{t('info.none')}

+

{t('info.none')}

)} {isCreating && ( diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/GovernanceConfigurationReview.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/GovernanceConfigurationReview.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/GovernanceConfigurationReview.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/GovernanceConfigurationReview.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.stories.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.stories.tsx similarity index 96% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.stories.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.stories.tsx index 9ace75fe2..967608199 100644 --- a/packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.stories.tsx +++ b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.stories.tsx @@ -1,9 +1,9 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { useForm } from 'react-hook-form' -import { DefaultNewDao } from '@dao-dao/common' import { NewDao } from '@dao-dao/types' +import { DefaultNewDao } from '../../../../atoms' import { CwdVotingCw4Adapter } from '../../../index' import { DaoCreationConfig } from '../types' import { TierCard } from './TierCard' diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.tsx similarity index 93% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.tsx index a13dd5e5b..f0a33857c 100644 --- a/packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.tsx +++ b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/TierCard.tsx @@ -77,8 +77,8 @@ export const TierCard = ({ const tierVotingWeight = data.tiers?.[tierIndex]?.weight ?? 0 return ( -
-
+
+
{!showColorDotOnMember && (
-
+
-
+
(
@@ -224,7 +224,7 @@ export const TierCard = ({ onClick={() => appendMember({ address: '' })} variant="ghost" > - +

{t('button.addMember')}

diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/getInstantiateInfo.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/getInstantiateInfo.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/getInstantiateInfo.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/getInstantiateInfo.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/index.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/index.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/index.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/index.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/instantiate_schema.json b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/instantiate_schema.json similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/instantiate_schema.json rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation/instantiate_schema.json diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/hooks/index.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/hooks/index.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/hooks/index.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/hooks/index.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/hooks/useActions.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/hooks/useActions.ts similarity index 81% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/hooks/useActions.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/hooks/useActions.ts index a5db1e6a6..936c9f57c 100644 --- a/packages/voting-module-adapter/adapters/CwdVotingCw4/hooks/useActions.ts +++ b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/hooks/useActions.ts @@ -1,8 +1,8 @@ import { useMemo } from 'react' -import { useActionOptions } from '@dao-dao/common/actions/react/context' import { Action } from '@dao-dao/types' +import { useActionOptions } from '../../../../actions' import { makeManageMembersAction } from '../actions' export const useActions = (): Action[] => { diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/hooks/useDaoInfoBarItems.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/hooks/useDaoInfoBarItems.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/hooks/useDaoInfoBarItems.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/hooks/useDaoInfoBarItems.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/hooks/useProfileNewProposalCardAddresses.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/hooks/useProfileNewProposalCardAddresses.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/hooks/useProfileNewProposalCardAddresses.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/hooks/useProfileNewProposalCardAddresses.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/hooks/useVotingModule.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/hooks/useVotingModule.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/hooks/useVotingModule.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/hooks/useVotingModule.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/index.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/index.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/index.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/index.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/types.ts b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/types.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/types.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/types.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/ui/ProfileCardMemberInfo.stories.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/ui/ProfileCardMemberInfo.stories.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/ui/ProfileCardMemberInfo.stories.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/ui/ProfileCardMemberInfo.stories.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingCw4/ui/ProfileCardMemberInfo.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/ui/ProfileCardMemberInfo.tsx similarity index 94% rename from packages/voting-module-adapter/adapters/CwdVotingCw4/ui/ProfileCardMemberInfo.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingCw4/ui/ProfileCardMemberInfo.tsx index c4a440e28..efcd0d779 100644 --- a/packages/voting-module-adapter/adapters/CwdVotingCw4/ui/ProfileCardMemberInfo.tsx +++ b/packages/common/voting-module-adapter/adapters/CwdVotingCw4/ui/ProfileCardMemberInfo.tsx @@ -20,7 +20,7 @@ export const ProfileCardMemberInfo = ({ return votingPower > 0 ? (

{t('title.votingPower')}

-

+

{formatPercentOf100(votingPower)}

diff --git a/packages/voting-module-adapter/adapters/CwdVotingNativeStaked/components/ProfileCardMemberInfo/StakingModal.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/components/ProfileCardMemberInfo/StakingModal.tsx similarity index 98% rename from packages/voting-module-adapter/adapters/CwdVotingNativeStaked/components/ProfileCardMemberInfo/StakingModal.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/components/ProfileCardMemberInfo/StakingModal.tsx index 2f5b76fe6..bdef60770 100644 --- a/packages/voting-module-adapter/adapters/CwdVotingNativeStaked/components/ProfileCardMemberInfo/StakingModal.tsx +++ b/packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/components/ProfileCardMemberInfo/StakingModal.tsx @@ -5,7 +5,6 @@ import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { useRecoilState, useSetRecoilState } from 'recoil' -import { SuspenseLoader } from '@dao-dao/common' import { CwdVotingNativeStakedHooks, refreshDaoVotingPowerAtom, @@ -18,14 +17,15 @@ import { StakingMode, StakingModal as StatelessStakingModal, } from '@dao-dao/stateless' +import { BaseStakingModalProps } from '@dao-dao/types' import { convertDenomToMicroDenomWithDecimals, convertMicroDenomToDenomWithDecimals, processError, } from '@dao-dao/utils' +import { SuspenseLoader } from '../../../../../components' import { useVotingModuleAdapterOptions } from '../../../../react/context' -import { BaseStakingModalProps } from '../../../../types' import { useGovernanceTokenInfo, useStakingInfo } from '../../hooks' export const StakingModal = (props: BaseStakingModalProps) => ( diff --git a/packages/voting-module-adapter/adapters/CwdVotingNativeStaked/components/ProfileCardMemberInfo/index.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/components/ProfileCardMemberInfo/index.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingNativeStaked/components/ProfileCardMemberInfo/index.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/components/ProfileCardMemberInfo/index.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingNativeStaked/components/index.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/components/index.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingNativeStaked/components/index.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/components/index.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/index.ts b/packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/index.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/index.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/index.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useDaoInfoBarItems.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useDaoInfoBarItems.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useDaoInfoBarItems.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useDaoInfoBarItems.tsx diff --git a/packages/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useGovernanceTokenInfo.ts b/packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useGovernanceTokenInfo.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useGovernanceTokenInfo.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useGovernanceTokenInfo.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useStakingInfo.ts b/packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useStakingInfo.ts similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useStakingInfo.ts rename to packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/hooks/useStakingInfo.ts diff --git a/packages/voting-module-adapter/adapters/CwdVotingNativeStaked/index.tsx b/packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/index.tsx similarity index 100% rename from packages/voting-module-adapter/adapters/CwdVotingNativeStaked/index.tsx rename to packages/common/voting-module-adapter/adapters/CwdVotingNativeStaked/index.tsx diff --git a/packages/voting-module-adapter/adapters/Fallback/Placeholder.tsx b/packages/common/voting-module-adapter/adapters/Fallback/Placeholder.tsx similarity index 71% rename from packages/voting-module-adapter/adapters/Fallback/Placeholder.tsx rename to packages/common/voting-module-adapter/adapters/Fallback/Placeholder.tsx index 9a67f298f..d70a86756 100644 --- a/packages/voting-module-adapter/adapters/Fallback/Placeholder.tsx +++ b/packages/common/voting-module-adapter/adapters/Fallback/Placeholder.tsx @@ -1,20 +1,21 @@ import { useTranslation } from 'react-i18next' -import { Trans } from '@dao-dao/common' import { DiscordIcon } from '@dao-dao/stateless' +import { Trans } from '../../../components' + export const Placeholder = () => { const { t } = useTranslation() return ( -
+

{t('info.votingModuleNotYetSupported')}

Want to help us support this voting module? Join the{' '} 0 && (

diff --git a/packages/voting-module-adapter/components/index.tsx b/packages/common/voting-module-adapter/components/index.tsx similarity index 100% rename from packages/voting-module-adapter/components/index.tsx rename to packages/common/voting-module-adapter/components/index.tsx diff --git a/packages/voting-module-adapter/core.ts b/packages/common/voting-module-adapter/core.ts similarity index 98% rename from packages/voting-module-adapter/core.ts rename to packages/common/voting-module-adapter/core.ts index 5e6ef3259..d2afa54d8 100644 --- a/packages/voting-module-adapter/core.ts +++ b/packages/common/voting-module-adapter/core.ts @@ -1,3 +1,8 @@ +import { + IVotingModuleAdapterContext, + IVotingModuleAdapterOptions, + VotingModuleAdapter, +} from '@dao-dao/types' import { normalizeContractName } from '@dao-dao/utils' import { @@ -6,11 +11,6 @@ import { CwdVotingNativeStakedAdapter, FallbackAdapter, } from './adapters' -import { - IVotingModuleAdapterContext, - IVotingModuleAdapterOptions, - VotingModuleAdapter, -} from './types' // Adapters need to be loaded lazily like this, as opposed to just defining a // global array, due to cyclic dependencies. The adapter defintion files include diff --git a/packages/voting-module-adapter/index.tsx b/packages/common/voting-module-adapter/index.tsx similarity index 75% rename from packages/voting-module-adapter/index.tsx rename to packages/common/voting-module-adapter/index.tsx index 982ff310a..0542d18c9 100644 --- a/packages/voting-module-adapter/index.tsx +++ b/packages/common/voting-module-adapter/index.tsx @@ -1,4 +1,3 @@ export * from './adapters' export * from './core' export * from './react' -export * from './types' diff --git a/packages/voting-module-adapter/react/context.ts b/packages/common/voting-module-adapter/react/context.ts similarity index 100% rename from packages/voting-module-adapter/react/context.ts rename to packages/common/voting-module-adapter/react/context.ts diff --git a/packages/voting-module-adapter/react/hooks/index.ts b/packages/common/voting-module-adapter/react/hooks/index.ts similarity index 100% rename from packages/voting-module-adapter/react/hooks/index.ts rename to packages/common/voting-module-adapter/react/hooks/index.ts diff --git a/packages/voting-module-adapter/react/hooks/useCw20GovernanceTokenInfoResponseIfExists.ts b/packages/common/voting-module-adapter/react/hooks/useCw20GovernanceTokenInfoResponseIfExists.ts similarity index 100% rename from packages/voting-module-adapter/react/hooks/useCw20GovernanceTokenInfoResponseIfExists.ts rename to packages/common/voting-module-adapter/react/hooks/useCw20GovernanceTokenInfoResponseIfExists.ts diff --git a/packages/voting-module-adapter/react/hooks/useNativeGovernanceTokenInfoResponseIfExists.ts b/packages/common/voting-module-adapter/react/hooks/useNativeGovernanceTokenInfoResponseIfExists.ts similarity index 100% rename from packages/voting-module-adapter/react/hooks/useNativeGovernanceTokenInfoResponseIfExists.ts rename to packages/common/voting-module-adapter/react/hooks/useNativeGovernanceTokenInfoResponseIfExists.ts diff --git a/packages/voting-module-adapter/react/index.tsx b/packages/common/voting-module-adapter/react/index.tsx similarity index 100% rename from packages/voting-module-adapter/react/index.tsx rename to packages/common/voting-module-adapter/react/index.tsx diff --git a/packages/voting-module-adapter/react/provider.tsx b/packages/common/voting-module-adapter/react/provider.tsx similarity index 100% rename from packages/voting-module-adapter/react/provider.tsx rename to packages/common/voting-module-adapter/react/provider.tsx diff --git a/packages/proposal-module-adapter/.eslintrc.js b/packages/proposal-module-adapter/.eslintrc.js deleted file mode 100644 index ba31cb99a..000000000 --- a/packages/proposal-module-adapter/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -/** @type {import("eslint").Linter.Config} */ -const eslintConfig = { - extends: [require.resolve('@dao-dao/config/eslint')], - ignorePatterns: ['node_modules'], - root: true, -} - -module.exports = eslintConfig diff --git a/packages/proposal-module-adapter/LICENSE b/packages/proposal-module-adapter/LICENSE deleted file mode 100644 index 61d94297f..000000000 --- a/packages/proposal-module-adapter/LICENSE +++ /dev/null @@ -1,32 +0,0 @@ -The Clear BSD License - -Copyright (c) 2022 DAO DAO Contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted (subject to the limitations in the disclaimer -below) provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY -THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/proposal-module-adapter/package.json b/packages/proposal-module-adapter/package.json deleted file mode 100644 index 55e34f8f7..000000000 --- a/packages/proposal-module-adapter/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@dao-dao/proposal-module-adapter", - "version": "2.0.1", - "scripts": { - "format": "eslint . --fix", - "lint": "eslint ." - }, - "dependencies": { - "@dao-dao/common": "2.0.1", - "@dao-dao/state": "2.0.1", - "@dao-dao/stateless": "2.0.1", - "@dao-dao/utils": "2.0.1", - "@dao-dao/voting-module-adapter": "2.0.1", - "@mui/icons-material": "^5.10.3", - "a11y-react-emoji": "^1.2.0", - "buffer": "^6.0.3", - "react-hook-form": "7.20.4", - "react-hot-toast": "^2.1.1", - "react-timeago": "^7.1.0", - "recoil": "^0.7.2" - }, - "devDependencies": { - "@dao-dao/config": "2.0.1", - "@dao-dao/types": "2.0.1", - "@noahsaso/cosmodal": "^0.7.1", - "clsx": "^1.1.1", - "react": "18.1.0", - "react-i18next": "^11.0.0", - "typescript": "^4.8.3" - }, - "prettier": "@dao-dao/config/prettier", - "private": true -} diff --git a/packages/proposal-module-adapter/types.ts b/packages/proposal-module-adapter/types.ts deleted file mode 100644 index 81a775f0c..000000000 --- a/packages/proposal-module-adapter/types.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@dao-dao/types/proposal-module-adapter' diff --git a/packages/stateless/components/StatusDisplay.stories.tsx b/packages/stateless/components/StatusDisplay.stories.tsx index 3e32ad6f7..7aaef0b18 100644 --- a/packages/stateless/components/StatusDisplay.stories.tsx +++ b/packages/stateless/components/StatusDisplay.stories.tsx @@ -1,6 +1,6 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { ProposalStatusMap } from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalLine/ProposalStatus' +import { ProposalStatusMap } from '@dao-dao/common/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalLine/ProposalStatus' import { StatusDisplay } from './StatusDisplay' diff --git a/packages/stateless/components/dao/create/DaoCreateConfigInputCard.stories.tsx b/packages/stateless/components/dao/create/DaoCreateConfigInputCard.stories.tsx index d8be40292..f2080feea 100644 --- a/packages/stateless/components/dao/create/DaoCreateConfigInputCard.stories.tsx +++ b/packages/stateless/components/dao/create/DaoCreateConfigInputCard.stories.tsx @@ -5,7 +5,7 @@ import { DefaultNewDao, SuspenseLoader } from '@dao-dao/common' import { VotingDurationIcon, VotingDurationInput, -} from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation' +} from '@dao-dao/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation' import { NewDao } from '@dao-dao/types' import { DaoCreateConfigInputCard } from './DaoCreateConfigInputCard' diff --git a/packages/stateless/components/dao/create/DaoCreateConfigReviewCard.stories.tsx b/packages/stateless/components/dao/create/DaoCreateConfigReviewCard.stories.tsx index f64a32671..f066f5df5 100644 --- a/packages/stateless/components/dao/create/DaoCreateConfigReviewCard.stories.tsx +++ b/packages/stateless/components/dao/create/DaoCreateConfigReviewCard.stories.tsx @@ -5,7 +5,7 @@ import { DefaultNewDao } from '@dao-dao/common' import { VotingDurationIcon, VotingDurationReview, -} from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation' +} from '@dao-dao/common/proposal-module-adapter/adapters/CwdProposalSingle/daoCreation' import { NewDao } from '@dao-dao/types' import { DaoCreateConfigReviewCard } from './DaoCreateConfigReviewCard' diff --git a/packages/stateless/components/dao/create/DaoStructureCard.stories.tsx b/packages/stateless/components/dao/create/DaoStructureCard.stories.tsx index 10516188e..3724c8863 100644 --- a/packages/stateless/components/dao/create/DaoStructureCard.stories.tsx +++ b/packages/stateless/components/dao/create/DaoStructureCard.stories.tsx @@ -1,7 +1,7 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { useState } from 'react' -import { DisplayInfoIcon } from '@dao-dao/voting-module-adapter/adapters/CwdVotingCw4/daoCreation' +import { DisplayInfoIcon } from '@dao-dao/common/voting-module-adapter/adapters/CwdVotingCw4/daoCreation' import { DaoStructureCard } from './DaoStructureCard' diff --git a/packages/stateless/components/dao/create/pages/CreateDaoGovernance.stories.tsx b/packages/stateless/components/dao/create/pages/CreateDaoGovernance.stories.tsx index 92a78c5c2..b3087d952 100644 --- a/packages/stateless/components/dao/create/pages/CreateDaoGovernance.stories.tsx +++ b/packages/stateless/components/dao/create/pages/CreateDaoGovernance.stories.tsx @@ -1,11 +1,11 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' +import { CwdVotingCw20StakedAdapter } from '@dao-dao/common/voting-module-adapter/adapters/CwdVotingCw20Staked' import { WalletProviderDecorator, makeAppLayoutDecorator, makeCreateDaoFormDecorator, } from '@dao-dao/storybook/decorators' -import { CwdVotingCw20StakedAdapter } from '@dao-dao/voting-module-adapter/adapters/CwdVotingCw20Staked' import { CreateDaoGovernance } from './CreateDaoGovernance' diff --git a/packages/stateless/components/dao/create/pages/CreateDaoReview.stories.tsx b/packages/stateless/components/dao/create/pages/CreateDaoReview.stories.tsx index a80981699..1e37c595c 100644 --- a/packages/stateless/components/dao/create/pages/CreateDaoReview.stories.tsx +++ b/packages/stateless/components/dao/create/pages/CreateDaoReview.stories.tsx @@ -1,10 +1,10 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { CwdProposalSingleAdapter } from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle' +import { CwdProposalSingleAdapter } from '@dao-dao/common/proposal-module-adapter/adapters/CwdProposalSingle' +import { CwdVotingCw20StakedAdapter } from '@dao-dao/common/voting-module-adapter/adapters/CwdVotingCw20Staked' import { WalletProviderDecorator } from '@dao-dao/storybook/decorators' import { makeAppLayoutDecorator } from '@dao-dao/storybook/decorators/makeAppLayoutDecorator' import { makeCreateDaoFormDecorator } from '@dao-dao/storybook/decorators/makeCreateDaoFormDecorator' -import { CwdVotingCw20StakedAdapter } from '@dao-dao/voting-module-adapter/adapters/CwdVotingCw20Staked' import { CreateDaoReview } from './CreateDaoReview' diff --git a/packages/stateless/components/dao/create/pages/CreateDaoStart.stories.tsx b/packages/stateless/components/dao/create/pages/CreateDaoStart.stories.tsx index c99188921..4e3664963 100644 --- a/packages/stateless/components/dao/create/pages/CreateDaoStart.stories.tsx +++ b/packages/stateless/components/dao/create/pages/CreateDaoStart.stories.tsx @@ -1,12 +1,12 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { CwdProposalSingleAdapter } from '@dao-dao/proposal-module-adapter' +import { CwdProposalSingleAdapter } from '@dao-dao/common/proposal-module-adapter' +import { CwdVotingCw20StakedAdapter } from '@dao-dao/common/voting-module-adapter' import { WalletProviderDecorator, makeAppLayoutDecorator, makeCreateDaoFormDecorator, } from '@dao-dao/storybook/decorators' -import { CwdVotingCw20StakedAdapter } from '@dao-dao/voting-module-adapter' import { CreateDaoStart } from './CreateDaoStart' diff --git a/packages/stateless/components/dao/create/pages/CreateDaoVoting.stories.tsx b/packages/stateless/components/dao/create/pages/CreateDaoVoting.stories.tsx index b322cf56d..ca40cf4a8 100644 --- a/packages/stateless/components/dao/create/pages/CreateDaoVoting.stories.tsx +++ b/packages/stateless/components/dao/create/pages/CreateDaoVoting.stories.tsx @@ -1,10 +1,10 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { CwdProposalSingleAdapter } from '@dao-dao/proposal-module-adapter' +import { CwdProposalSingleAdapter } from '@dao-dao/common/proposal-module-adapter' +import { CwdVotingCw20StakedAdapter } from '@dao-dao/common/voting-module-adapter' import { WalletProviderDecorator } from '@dao-dao/storybook/decorators' import { makeAppLayoutDecorator } from '@dao-dao/storybook/decorators/makeAppLayoutDecorator' import { makeCreateDaoFormDecorator } from '@dao-dao/storybook/decorators/makeCreateDaoFormDecorator' -import { CwdVotingCw20StakedAdapter } from '@dao-dao/voting-module-adapter' import { CreateDaoVoting } from './CreateDaoVoting' diff --git a/packages/stateless/components/profile/ProfileCantVoteCard.stories.tsx b/packages/stateless/components/profile/ProfileCantVoteCard.stories.tsx index 970cddba5..23ad6cd28 100644 --- a/packages/stateless/components/profile/ProfileCantVoteCard.stories.tsx +++ b/packages/stateless/components/profile/ProfileCantVoteCard.stories.tsx @@ -1,10 +1,10 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { ProfileCardMemberInfoTokens } from '@dao-dao/voting-module-adapter/components/ProfileCardMemberInfoTokens' +import { ProfileCardMemberInfoTokens } from '@dao-dao/common/voting-module-adapter/components/ProfileCardMemberInfoTokens' import { makeProps as makeProfileCardMemberInfoTokenProps, makeCantVoteOnProposalProps as makeProfileCardMemberInfoTokensCantVoteOnProposalProps, -} from '@dao-dao/voting-module-adapter/components/ProfileCardMemberInfoTokens.stories' +} from '@dao-dao/common/voting-module-adapter/components/ProfileCardMemberInfoTokens.stories' import { ProfileCantVoteCard } from './ProfileCantVoteCard' diff --git a/packages/stateless/components/profile/ProfileMemberCard.stories.tsx b/packages/stateless/components/profile/ProfileMemberCard.stories.tsx index 43bc5c6ba..9b538bbf4 100644 --- a/packages/stateless/components/profile/ProfileMemberCard.stories.tsx +++ b/packages/stateless/components/profile/ProfileMemberCard.stories.tsx @@ -1,7 +1,7 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { ProfileCardMemberInfoTokens } from '@dao-dao/voting-module-adapter/components/ProfileCardMemberInfoTokens' -import { makeProps as makeProfileCardMemberInfoTokensProps } from '@dao-dao/voting-module-adapter/components/ProfileCardMemberInfoTokens.stories' +import { ProfileCardMemberInfoTokens } from '@dao-dao/common/voting-module-adapter/components/ProfileCardMemberInfoTokens' +import { makeProps as makeProfileCardMemberInfoTokensProps } from '@dao-dao/common/voting-module-adapter/components/ProfileCardMemberInfoTokens.stories' import { makeProps as makeUnstakingLineProps } from '../UnstakingLine.stories' import { UnstakingTaskStatus } from '../UnstakingStatus' diff --git a/packages/stateless/components/profile/ProfileNotMemberCard.stories.tsx b/packages/stateless/components/profile/ProfileNotMemberCard.stories.tsx index 5d48f83ef..e85d50388 100644 --- a/packages/stateless/components/profile/ProfileNotMemberCard.stories.tsx +++ b/packages/stateless/components/profile/ProfileNotMemberCard.stories.tsx @@ -1,7 +1,7 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { ProfileCardMemberInfoTokens } from '@dao-dao/voting-module-adapter/components/ProfileCardMemberInfoTokens' -import { makeProps as makeProfileCardMemberInfoTokensProps } from '@dao-dao/voting-module-adapter/components/ProfileCardMemberInfoTokens.stories' +import { ProfileCardMemberInfoTokens } from '@dao-dao/common/voting-module-adapter/components/ProfileCardMemberInfoTokens' +import { makeProps as makeProfileCardMemberInfoTokensProps } from '@dao-dao/common/voting-module-adapter/components/ProfileCardMemberInfoTokens.stories' import { ProfileNotMemberCard } from './ProfileNotMemberCard' diff --git a/packages/stateless/components/profile/ProfileVotedCard.stories.tsx b/packages/stateless/components/profile/ProfileVotedCard.stories.tsx index f00e398bc..14f570888 100644 --- a/packages/stateless/components/profile/ProfileVotedCard.stories.tsx +++ b/packages/stateless/components/profile/ProfileVotedCard.stories.tsx @@ -1,6 +1,6 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { ProposalWalletVote } from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalWalletVote' +import { ProposalWalletVote } from '@dao-dao/common/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalWalletVote' import { Vote } from '@dao-dao/types/contracts/CwdProposalSingle.common' import { ProfileVotedCard } from './ProfileVotedCard' diff --git a/packages/stateless/components/proposal/ProposalLine.ProposalLine.stories.tsx b/packages/stateless/components/proposal/ProposalLine.ProposalLine.stories.tsx index 753dd85a5..e87630399 100644 --- a/packages/stateless/components/proposal/ProposalLine.ProposalLine.stories.tsx +++ b/packages/stateless/components/proposal/ProposalLine.ProposalLine.stories.tsx @@ -3,7 +3,7 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { ProposalStatus, ProposalStatusMap, -} from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalLine/ProposalStatus' +} from '@dao-dao/common/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalLine/ProposalStatus' import { formatDate, secondsToWdhms } from '@dao-dao/utils' import { ProposalLine, ProposalLineProps } from './ProposalLine' diff --git a/packages/stateless/components/proposal/ProposalVotes.stories.tsx b/packages/stateless/components/proposal/ProposalVotes.stories.tsx index 4e80df954..943af4c64 100644 --- a/packages/stateless/components/proposal/ProposalVotes.stories.tsx +++ b/packages/stateless/components/proposal/ProposalVotes.stories.tsx @@ -1,6 +1,6 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { VoteDisplay } from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalVotes/VoteDisplay' +import { VoteDisplay } from '@dao-dao/common/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalVotes/VoteDisplay' import { Vote } from '@dao-dao/types/contracts/CwdProposalSingle.common' import { getFallbackImage } from '@dao-dao/utils' diff --git a/packages/stateless/components/proposal/ProposalWalletVote.stories.tsx b/packages/stateless/components/proposal/ProposalWalletVote.stories.tsx index 65481b356..a17d03804 100644 --- a/packages/stateless/components/proposal/ProposalWalletVote.stories.tsx +++ b/packages/stateless/components/proposal/ProposalWalletVote.stories.tsx @@ -1,6 +1,6 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { ProposalWalletVoteClassNameMap } from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalWalletVote' +import { ProposalWalletVoteClassNameMap } from '@dao-dao/common/proposal-module-adapter/adapters/CwdProposalSingle/components/ProposalWalletVote' import { Vote } from '@dao-dao/types/contracts/CwdProposalSingle.common' import { ProposalWalletVote } from './ProposalWalletVote' diff --git a/packages/stateless/pages/CreateProposal.stories.tsx b/packages/stateless/pages/CreateProposal.stories.tsx index d56b926a8..d0da454bd 100644 --- a/packages/stateless/pages/CreateProposal.stories.tsx +++ b/packages/stateless/pages/CreateProposal.stories.tsx @@ -4,9 +4,9 @@ import { useState } from 'react' import { CwdProposalSingleAdapter, matchAdapter as matchProposalModuleAdapter, -} from '@dao-dao/proposal-module-adapter' -import { NewProposalProps } from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal' -import { Default as NewProposalStory } from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.stories' +} from '@dao-dao/common/proposal-module-adapter' +import { NewProposalProps } from '@dao-dao/common/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal' +import { Default as NewProposalStory } from '@dao-dao/common/proposal-module-adapter/adapters/CwdProposalSingle/common/ui/NewProposal.stories' import { useDaoInfoContext } from '@dao-dao/stateless' import { DaoPageWrapperDecorator, diff --git a/packages/stateless/pages/Proposal.stories.tsx b/packages/stateless/pages/Proposal.stories.tsx index 9cab2293b..986207a5e 100644 --- a/packages/stateless/pages/Proposal.stories.tsx +++ b/packages/stateless/pages/Proposal.stories.tsx @@ -3,8 +3,8 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { ProposalVoteTally, ProposalVoteTallyProps, -} from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle/components/ui/ProposalVoteTally' -import { Default as ProposalVoteTallyStory } from '@dao-dao/proposal-module-adapter/adapters/CwdProposalSingle/components/ui/ProposalVoteTally.stories' +} from '@dao-dao/common/proposal-module-adapter/adapters/CwdProposalSingle/components/ui/ProposalVoteTally' +import { Default as ProposalVoteTallyStory } from '@dao-dao/common/proposal-module-adapter/adapters/CwdProposalSingle/components/ui/ProposalVoteTally.stories' import { useDaoInfoContext } from '@dao-dao/stateless' import { DaoPageWrapperDecorator, diff --git a/packages/stateless/pages/Wallet.stories.tsx b/packages/stateless/pages/Wallet.stories.tsx index 2e6cc7b8a..5eccc50cc 100644 --- a/packages/stateless/pages/Wallet.stories.tsx +++ b/packages/stateless/pages/Wallet.stories.tsx @@ -1,8 +1,8 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { useForm } from 'react-hook-form' -import { useActions } from '@dao-dao/common/actions' import { SuspenseLoader } from '@dao-dao/common' +import { useActions } from '@dao-dao/common/actions' import { WalletProviderDecorator, makeActionsProviderDecorator, diff --git a/packages/stateless/tailwind.config.js b/packages/stateless/tailwind.config.js index 2983b4df6..73703ee5b 100644 --- a/packages/stateless/tailwind.config.js +++ b/packages/stateless/tailwind.config.js @@ -1,9 +1,6 @@ /** @type {import("tailwindcss/tailwind-config").TailwindConfig} */ const tailwindConfig = { - content: [ - './**/*.{js,jsx,ts,tsx}', - '../{proposal,voting}-module-adapter/**/*.{js,jsx,ts,tsx}', - ], + content: ['./**/*.{js,jsx,ts,tsx}', '../**/*.{js,jsx,ts,tsx}'], presets: [require('@dao-dao/config/tailwind/config')], } diff --git a/packages/storybook/decorators/makeProposalModuleAdapterDecorator.tsx b/packages/storybook/decorators/makeProposalModuleAdapterDecorator.tsx index fc997170a..b0c90facd 100644 --- a/packages/storybook/decorators/makeProposalModuleAdapterDecorator.tsx +++ b/packages/storybook/decorators/makeProposalModuleAdapterDecorator.tsx @@ -2,7 +2,7 @@ import { DecoratorFn } from '@storybook/react' -import { ProposalModuleAdapterProvider } from '@dao-dao/proposal-module-adapter' +import { ProposalModuleAdapterProvider } from '@dao-dao/common/proposal-module-adapter' import { Loader, Logo, useDaoInfoContext } from '@dao-dao/stateless' export const makeProposalModuleAdapterDecorator: ( diff --git a/packages/storybook/tailwind.config.js b/packages/storybook/tailwind.config.js index 5f8f00c34..73703ee5b 100644 --- a/packages/storybook/tailwind.config.js +++ b/packages/storybook/tailwind.config.js @@ -1,8 +1,6 @@ /** @type {import("tailwindcss/tailwind-config").TailwindConfig} */ const tailwindConfig = { - content: [ - '../{common,stateless,proposal-module-adapter,voting-module-adapter}/**/*.{js,jsx,ts,tsx}', - ], + content: ['./**/*.{js,jsx,ts,tsx}', '../**/*.{js,jsx,ts,tsx}'], presets: [require('@dao-dao/config/tailwind/config')], } diff --git a/packages/voting-module-adapter/.eslintrc.js b/packages/voting-module-adapter/.eslintrc.js deleted file mode 100644 index ba31cb99a..000000000 --- a/packages/voting-module-adapter/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -/** @type {import("eslint").Linter.Config} */ -const eslintConfig = { - extends: [require.resolve('@dao-dao/config/eslint')], - ignorePatterns: ['node_modules'], - root: true, -} - -module.exports = eslintConfig diff --git a/packages/voting-module-adapter/LICENSE b/packages/voting-module-adapter/LICENSE deleted file mode 100644 index 61d94297f..000000000 --- a/packages/voting-module-adapter/LICENSE +++ /dev/null @@ -1,32 +0,0 @@ -The Clear BSD License - -Copyright (c) 2022 DAO DAO Contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted (subject to the limitations in the disclaimer -below) provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY -THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/voting-module-adapter/package.json b/packages/voting-module-adapter/package.json deleted file mode 100644 index d39fd607a..000000000 --- a/packages/voting-module-adapter/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@dao-dao/voting-module-adapter", - "version": "2.0.1", - "scripts": { - "format": "eslint . --fix", - "lint": "eslint ." - }, - "dependencies": { - "@dao-dao/common": "2.0.1", - "@dao-dao/state": "2.0.1", - "@dao-dao/stateless": "2.0.1", - "@dao-dao/utils": "2.0.1", - "@emotion/react": "^11.10.4", - "@emotion/styled": "^11.10.4", - "@mui/icons-material": "^5.10.3", - "@mui/material": "^5.10.3", - "a11y-react-emoji": "^1.2.0", - "buffer": "^6.0.3", - "lodash.clonedeep": "^4.5.0", - "react-hook-form": "7.20.4", - "react-hot-toast": "^2.1.1", - "recoil": "^0.7.2" - }, - "devDependencies": { - "@dao-dao/types": "2.0.1", - "@types/lodash.clonedeep": "^4.5.0", - "@noahsaso/cosmodal": "^0.7.1", - "clsx": "^1.1.1", - "react": "18.1.0", - "react-i18next": "^11.0.0", - "typescript": "^4.8.3" - }, - "prettier": "@dao-dao/config/prettier", - "private": true -} diff --git a/packages/voting-module-adapter/tsconfig.json b/packages/voting-module-adapter/tsconfig.json deleted file mode 100644 index 977eed25e..000000000 --- a/packages/voting-module-adapter/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "@dao-dao/config/ts/react-library.json", - "include": ["**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] -} diff --git a/packages/voting-module-adapter/types.ts b/packages/voting-module-adapter/types.ts deleted file mode 100644 index d8dcdd36f..000000000 --- a/packages/voting-module-adapter/types.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@dao-dao/types/voting-module-adapter'