From 1da577d9dd47787d04a688a194e836091f25e13b Mon Sep 17 00:00:00 2001 From: Zeke Medley Date: Tue, 5 Apr 2022 14:36:59 -0700 Subject: [PATCH] Fix build errors. --- apps/dapp/components/BetaWarning.tsx | 1 + apps/dapp/components/CodeIdSelect.tsx | 7 +- apps/dapp/components/ConnectWalletButton.tsx | 2 +- apps/dapp/components/ContractCard.tsx | 2 +- apps/dapp/components/ContractView.tsx | 6 +- apps/dapp/components/CopyToClipboard.tsx | 4 +- apps/dapp/components/Execute.tsx | 2 + apps/dapp/components/Paginator.tsx | 1 + apps/dapp/components/ProposalDetails.tsx | 8 +-- apps/dapp/components/ProposalForm.tsx | 2 +- apps/dapp/components/ProposalVoteStatus.tsx | 68 ------------------- apps/dapp/components/SidebarLayout.tsx | 2 +- apps/dapp/components/StakingModal.tsx | 3 +- apps/dapp/components/TemplateSelector.tsx | 6 +- apps/dapp/components/Vote.tsx | 4 +- apps/dapp/pages/_app.tsx | 2 +- apps/dapp/pages/index.tsx | 2 +- .../multisig/[contractAddress]/index.tsx | 2 +- apps/dapp/pages/multisig/list.tsx | 2 +- apps/dapp/templates/addToken.tsx | 1 - apps/dapp/templates/changeMembers.tsx | 3 - apps/dapp/templates/removeToken.tsx | 1 - packages/ui/package.json | 3 - 23 files changed, 33 insertions(+), 101 deletions(-) delete mode 100644 apps/dapp/components/ProposalVoteStatus.tsx diff --git a/apps/dapp/components/BetaWarning.tsx b/apps/dapp/components/BetaWarning.tsx index 8d7bbde6a1..b81e08c900 100644 --- a/apps/dapp/components/BetaWarning.tsx +++ b/apps/dapp/components/BetaWarning.tsx @@ -1,4 +1,5 @@ import { ChevronRightIcon, XIcon } from '@heroicons/react/outline' + import { Button } from '@components' import SvgMessage from 'components/icons/Message' diff --git a/apps/dapp/components/CodeIdSelect.tsx b/apps/dapp/components/CodeIdSelect.tsx index 999e9a38a8..478339a32c 100644 --- a/apps/dapp/components/CodeIdSelect.tsx +++ b/apps/dapp/components/CodeIdSelect.tsx @@ -20,11 +20,8 @@ export default function CodeIdSelect({
Contract Version
-
    diff --git a/apps/dapp/components/ContractView.tsx b/apps/dapp/components/ContractView.tsx index 9d1f14daf9..30b0e6f572 100644 --- a/apps/dapp/components/ContractView.tsx +++ b/apps/dapp/components/ContractView.tsx @@ -4,10 +4,11 @@ import Link from 'next/link' import { useRecoilValue, waitForAll } from 'recoil' -import { Button } from '@components' - import { StarIcon as StarOutline, PlusIcon } from '@heroicons/react/outline' import { StarIcon as StarSolid } from '@heroicons/react/solid' +import { useThemeContext } from 'ui' + +import { Button } from '@components' import { contractInstantiateTime } from 'selectors/contracts' import { isMemberSelector } from 'selectors/daos' @@ -28,7 +29,6 @@ import { import { Logo, LogoNoBorder } from './Logo' import { ProposalList } from './ProposalList' -import { useThemeContext } from 'ui' export function GradientHero({ children }: { children: ReactNode }) { const theme = useThemeContext() diff --git a/apps/dapp/components/CopyToClipboard.tsx b/apps/dapp/components/CopyToClipboard.tsx index d497248b29..21b40608ee 100644 --- a/apps/dapp/components/CopyToClipboard.tsx +++ b/apps/dapp/components/CopyToClipboard.tsx @@ -1,6 +1,8 @@ -import { CheckCircleIcon, PaperClipIcon } from '@heroicons/react/outline' import { useState } from 'react' + +import { CheckCircleIcon, PaperClipIcon } from '@heroicons/react/outline' import toast from 'react-hot-toast' + import SvgCopy from './icons/Copy' function concatAddressImpl( diff --git a/apps/dapp/components/Execute.tsx b/apps/dapp/components/Execute.tsx index 5c8aca1665..997477cf58 100644 --- a/apps/dapp/components/Execute.tsx +++ b/apps/dapp/components/Execute.tsx @@ -1,6 +1,8 @@ import { useState } from 'react' import { FC } from 'react' + import { Button } from 'ui' + import SvgAirplane from './icons/Airplane' export interface ExecuteProps { diff --git a/apps/dapp/components/Paginator.tsx b/apps/dapp/components/Paginator.tsx index af40575b27..b95a3b81c3 100644 --- a/apps/dapp/components/Paginator.tsx +++ b/apps/dapp/components/Paginator.tsx @@ -1,4 +1,5 @@ import Link from 'next/link' + import { Button } from 'ui' function Paginator({ diff --git a/apps/dapp/components/ProposalDetails.tsx b/apps/dapp/components/ProposalDetails.tsx index df48a174d8..6631d484e6 100644 --- a/apps/dapp/components/ProposalDetails.tsx +++ b/apps/dapp/components/ProposalDetails.tsx @@ -21,6 +21,7 @@ import { } from '@heroicons/react/outline' import { FormProvider, useForm } from 'react-hook-form' import toast from 'react-hot-toast' +import { Button } from 'ui' import { ProposalStatus } from '@components' @@ -60,12 +61,11 @@ import { decodedMessagesString, decodeMessages } from 'util/messagehelpers' import { treasuryTokenListUpdates } from '../atoms/treasury' import { CopyToClipboard } from './CopyToClipboard' import { CosmosMessageDisplay } from './CosmosMessageDisplay' -import { getEnd } from './ProposalList' +import { Execute } from './Execute' +import SvgAbstain from './icons/Abstain' import { Progress } from './Progress' -import { Button } from 'ui' +import { getEnd } from './ProposalList' import { Vote, VoteChoice } from './Vote' -import SvgAbstain from './icons/Abstain' -import { Execute } from './Execute' function executeProposalVote( choice: VoteChoice, diff --git a/apps/dapp/components/ProposalForm.tsx b/apps/dapp/components/ProposalForm.tsx index 699f3a3949..f036944ec0 100644 --- a/apps/dapp/components/ProposalForm.tsx +++ b/apps/dapp/components/ProposalForm.tsx @@ -5,6 +5,7 @@ import { useRecoilValue } from 'recoil' import { CosmosMsgFor_Empty } from '@dao-dao/types/contracts/cw3-dao' import { EyeIcon, EyeOffIcon, PlusIcon, XIcon } from '@heroicons/react/outline' import { FormProvider, useFieldArray, useForm } from 'react-hook-form' +import { Button } from 'ui' import { walletAddress } from 'selectors/treasury' import { @@ -29,7 +30,6 @@ import { TextareaInput } from './input/TextAreaInput' import { TextInput } from './input/TextInput' import { MarkdownPreview } from './MarkdownPreview' import { ProposalTemplateSelector } from './TemplateSelector' -import { Button } from 'ui' interface FormProposalData { title: string diff --git a/apps/dapp/components/ProposalVoteStatus.tsx b/apps/dapp/components/ProposalVoteStatus.tsx deleted file mode 100644 index 2407711000..0000000000 --- a/apps/dapp/components/ProposalVoteStatus.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { Suspense } from 'react' - -import { useRecoilValue } from 'recoil' - -import { CheckIcon, XIcon } from '@heroicons/react/outline' - -import { walletVotedSelector } from 'selectors/proposals' - -import { LogoNoBorder } from './Logo' - -const VoteStatusLoading = () => { - return ( -
    -
    - -
    -

    Loading vote status.

    -
    - ) -} - -const VoteStatusLoaded = ({ - contractAddress, - proposalId, -}: { - contractAddress: string - proposalId: number -}) => { - const voted = useRecoilValue( - walletVotedSelector({ - contractAddress, - proposalId, - }) - ) - if (voted) { - return ( -
    - -

    You have voted.

    -
    - ) - } - return ( -
    - -

    You have not voted.

    -
    - ) -} - -const ProposalVoteStatus = ({ - contractAddress, - proposalId, -}: { - contractAddress: string - proposalId: number -}) => { - return ( - }> - - - ) -} - -export default ProposalVoteStatus diff --git a/apps/dapp/components/SidebarLayout.tsx b/apps/dapp/components/SidebarLayout.tsx index c72f2bf554..c10f8a7696 100644 --- a/apps/dapp/components/SidebarLayout.tsx +++ b/apps/dapp/components/SidebarLayout.tsx @@ -4,11 +4,11 @@ import { useState } from 'react' import Link from 'next/link' import { MenuIcon } from '@heroicons/react/outline' +import ReactTooltip from 'react-tooltip' import { SITE_TITLE } from '../util/constants' import { Logo } from './Logo' import Nav from './Nav' -import ReactTooltip from 'react-tooltip' const SmallScreenNav = ({ onMenuClick }: { onMenuClick: () => void }) => { return ( diff --git a/apps/dapp/components/StakingModal.tsx b/apps/dapp/components/StakingModal.tsx index 8c8460cdc4..da952ebd8b 100644 --- a/apps/dapp/components/StakingModal.tsx +++ b/apps/dapp/components/StakingModal.tsx @@ -18,6 +18,7 @@ import { XIcon, } from '@heroicons/react/outline' import toast from 'react-hot-toast' +import { Button } from 'ui' import { cosmWasmSigningClient, @@ -36,7 +37,7 @@ import { convertMicroDenomToDenomWithDecimals, humanReadableDuration, } from 'util/conversion' -import { Button } from 'ui' + import { Modal } from './Modal' export enum StakingMode { diff --git a/apps/dapp/components/TemplateSelector.tsx b/apps/dapp/components/TemplateSelector.tsx index 4706d6afe8..c181a706f8 100644 --- a/apps/dapp/components/TemplateSelector.tsx +++ b/apps/dapp/components/TemplateSelector.tsx @@ -1,7 +1,9 @@ -import { Config } from 'util/contractConfigWrapper' +import { XIcon } from '@heroicons/react/outline' + import { ContractSupport, MessageTemplate } from 'templates/templateList' +import { Config } from 'util/contractConfigWrapper' + import { Modal } from './Modal' -import { XIcon } from '@heroicons/react/outline' export function MessageTemplateDisplayItem({ template, diff --git a/apps/dapp/components/Vote.tsx b/apps/dapp/components/Vote.tsx index 66a4e2e348..7338ea3202 100644 --- a/apps/dapp/components/Vote.tsx +++ b/apps/dapp/components/Vote.tsx @@ -1,6 +1,8 @@ -import { CheckIcon, XIcon } from '@heroicons/react/outline' import { FC, useState } from 'react' + +import { CheckIcon, XIcon } from '@heroicons/react/outline' import { Button } from 'ui' + import SvgAbstain from './icons/Abstain' import SvgAirplane from './icons/Airplane' diff --git a/apps/dapp/pages/_app.tsx b/apps/dapp/pages/_app.tsx index a806978310..252038fde6 100644 --- a/apps/dapp/pages/_app.tsx +++ b/apps/dapp/pages/_app.tsx @@ -8,6 +8,7 @@ import { useRouter } from 'next/router' import { RecoilRoot } from 'recoil' +import ReactTooltip from 'react-tooltip' import { DEFAULT_THEME_NAME, ThemeProvider } from 'ui' import ErrorBoundary from 'components/ErrorBoundary' @@ -15,7 +16,6 @@ import { HomepageLayout } from 'components/HomepageLayout' import SidebarLayout from 'components/Layout' import LoadingScreen from 'components/LoadingScreen' import Notifications from 'components/Notifications' -import ReactTooltip from 'react-tooltip' function MyApp({ Component, pageProps }: AppProps) { const router = useRouter() diff --git a/apps/dapp/pages/index.tsx b/apps/dapp/pages/index.tsx index 33cf105a57..015333c180 100644 --- a/apps/dapp/pages/index.tsx +++ b/apps/dapp/pages/index.tsx @@ -12,6 +12,7 @@ import { import { Button } from '@components' +import SvgArrowUpRight from '@components/icons/ArrowUpRight' import SvgDiscord from '@components/icons/Discord' import { GradientWrapper } from 'components/GradientWrapper' import SvgGithub from 'components/icons/Github' @@ -20,7 +21,6 @@ import { Logo } from 'components/Logo' import ThemeToggle from 'components/ThemeToggle' import { SITE_TITLE } from '../util/constants' -import SvgArrowUpRight from '@components/icons/ArrowUpRight' function EnterAppButton({ small }: { small?: boolean }) { return ( diff --git a/apps/dapp/pages/multisig/[contractAddress]/index.tsx b/apps/dapp/pages/multisig/[contractAddress]/index.tsx index b3baef1d04..6149c7c9fe 100644 --- a/apps/dapp/pages/multisig/[contractAddress]/index.tsx +++ b/apps/dapp/pages/multisig/[contractAddress]/index.tsx @@ -10,6 +10,7 @@ import { VariableIcon, } from '@heroicons/react/outline' +import { CopyToClipboard } from '@components/CopyToClipboard' import { MultisigContractInfo } from '@components/MultisigContractInfo' import { pinnedMultisigsAtom } from 'atoms/pinned' import { sidebarExpandedAtom } from 'atoms/sidebar' @@ -31,7 +32,6 @@ import { totalWeight, } from 'selectors/multisigs' import { walletAddress } from 'selectors/treasury' -import { CopyToClipboard } from '@components/CopyToClipboard' const thresholdString = (t: Threshold) => { if ('absolute_count' in t) { diff --git a/apps/dapp/pages/multisig/list.tsx b/apps/dapp/pages/multisig/list.tsx index b323636652..2f14aa324c 100644 --- a/apps/dapp/pages/multisig/list.tsx +++ b/apps/dapp/pages/multisig/list.tsx @@ -18,6 +18,7 @@ import { SparklesIcon, UserIcon, } from '@heroicons/react/outline' +import { Button } from 'ui' import { pinnedMultisigsAtom } from 'atoms/pinned' import { sidebarExpandedAtom } from 'atoms/sidebar' @@ -38,7 +39,6 @@ import { MULTISIG_CODE_ID, NATIVE_DENOM, } from 'util/constants' -import { Button } from 'ui' export function MultisigCard({ multisig, diff --git a/apps/dapp/templates/addToken.tsx b/apps/dapp/templates/addToken.tsx index e3051eafb7..30401168e3 100644 --- a/apps/dapp/templates/addToken.tsx +++ b/apps/dapp/templates/addToken.tsx @@ -110,7 +110,6 @@ export const TokenSelector = ({ register={register} error={errors?.to} validation={[validateRequired, validateContractAddress]} - border={false} disabled={readOnly} /> diff --git a/apps/dapp/templates/changeMembers.tsx b/apps/dapp/templates/changeMembers.tsx index 94b181eb26..4793717aaa 100644 --- a/apps/dapp/templates/changeMembers.tsx +++ b/apps/dapp/templates/changeMembers.tsx @@ -124,7 +124,6 @@ export const ChangeMembersComponent: TemplateComponent = ({ validateRequired, validateNotMember, ]} - border={false} disabled={readOnly} /> @@ -136,7 +135,6 @@ export const ChangeMembersComponent: TemplateComponent = ({ register={register} error={weightError} validation={[validatePositive, validateRequired]} - border={false} disabled={readOnly} /> @@ -183,7 +181,6 @@ export const ChangeMembersComponent: TemplateComponent = ({ register={register} error={addrError} validation={[validateAddress, validateRequired, validateMember]} - border={false} disabled={readOnly} /> diff --git a/apps/dapp/templates/removeToken.tsx b/apps/dapp/templates/removeToken.tsx index 78e92c67c2..2d90e3f328 100644 --- a/apps/dapp/templates/removeToken.tsx +++ b/apps/dapp/templates/removeToken.tsx @@ -113,7 +113,6 @@ export const RemoveTokenComponent: TemplateComponent = ({ validateContractAddress, validateIsTreasuryToken, ]} - border={false} disabled={readOnly} /> diff --git a/packages/ui/package.json b/packages/ui/package.json index a89b2c6d02..4694b33bc2 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -13,9 +13,6 @@ "storybook": "start-storybook --ci -p 6006 --no-manager-cache", "build-storybook": "build-storybook" }, - "dependencies": { - "@dao-dao/dapp": "*" - }, "devDependencies": { "@babel/core": "^7.17.5", "@storybook/addon-actions": "^6.4.19",