From 1f968ea3b9ed0c4bad2938cbd291cd40ee13e100 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 14 Apr 2022 14:59:14 -0700 Subject: [PATCH] Deploy UI (#495) --- .prettierignore | 8 +- .prettierrc.json | 7 - .vscode/settings.json | 31 +- apps/dapp/.eslintrc.js | 11 +- apps/dapp/.prettierignore | 4 - apps/dapp/atoms/pinned.ts | 3 +- apps/dapp/atoms/proposals.ts | 2 + apps/dapp/atoms/status.ts | 1 + apps/dapp/components/BetaWarning.tsx | 22 +- apps/dapp/components/Breadcrumbs.tsx | 4 +- apps/dapp/components/ChainEnableModal.tsx | 8 +- apps/dapp/components/Claims.tsx | 20 +- apps/dapp/components/CodeIdSelect.tsx | 8 +- apps/dapp/components/ConnectWalletButton.tsx | 24 +- apps/dapp/components/ContractCard.tsx | 88 ++- apps/dapp/components/ContractView.tsx | 54 +- apps/dapp/components/CopyToClipboard.tsx | 13 +- apps/dapp/components/DaoContractInfo.tsx | 18 +- apps/dapp/components/DaoTreasury.tsx | 4 +- apps/dapp/components/EmptyContractCard.tsx | 33 + apps/dapp/components/EmptyDaoCard.tsx | 12 + apps/dapp/components/EmptyMultisigCard.tsx | 12 + apps/dapp/components/ErrorBoundary.tsx | 4 +- apps/dapp/components/Execute.tsx | 32 +- apps/dapp/components/FormCard.tsx | 2 +- apps/dapp/components/GradientWrapper.tsx | 10 +- apps/dapp/components/HomepageLayout.tsx | 4 +- apps/dapp/components/InstallKeplr.tsx | 8 +- apps/dapp/components/Layout.tsx | 5 +- apps/dapp/components/LoadingScreen.tsx | 4 +- apps/dapp/components/Logo.tsx | 20 +- apps/dapp/components/Modal.tsx | 2 +- apps/dapp/components/MultisigContractInfo.tsx | 12 +- apps/dapp/components/Nav.tsx | 36 +- apps/dapp/components/NoKeplrAccountModal.tsx | 16 +- apps/dapp/components/Paginator.tsx | 4 +- apps/dapp/components/Progress.tsx | 83 ++- apps/dapp/components/ProposalDetails.tsx | 298 +------- .../components/ProposalDetailsSidebar.tsx | 653 ++++++++++++++++++ apps/dapp/components/ProposalForm.tsx | 48 +- apps/dapp/components/ProposalList.tsx | 40 +- apps/dapp/components/SidebarLayout.tsx | 14 +- apps/dapp/components/StakingModal.tsx | 56 +- .../components/StatusIcons/StatusIcons.tsx | 2 - apps/dapp/components/TemplateSelector.tsx | 16 +- apps/dapp/components/ThemeToggle.tsx | 8 +- .../TooltipsDisplay/TooltipsDisplay.tsx | 4 +- apps/dapp/components/Transfers.tsx | 4 +- apps/dapp/components/Vote.tsx | 12 +- apps/dapp/components/icons/Abstain.tsx | 4 +- apps/dapp/components/icons/Airplane.tsx | 10 +- apps/dapp/components/icons/ArrowUpRight.tsx | 8 +- apps/dapp/components/icons/Connect.tsx | 8 +- apps/dapp/components/icons/Copy.tsx | 6 +- apps/dapp/components/icons/Dao.tsx | 4 +- apps/dapp/components/icons/Discord.tsx | 6 +- apps/dapp/components/icons/Draft.tsx | 6 +- apps/dapp/components/icons/Executed.tsx | 6 +- apps/dapp/components/icons/Github.tsx | 6 +- apps/dapp/components/icons/MemberCheck.tsx | 4 +- apps/dapp/components/icons/Message.tsx | 4 +- apps/dapp/components/icons/Open.tsx | 6 +- apps/dapp/components/icons/Passed.tsx | 6 +- apps/dapp/components/icons/Pencil.tsx | 4 +- apps/dapp/components/icons/Rejected.tsx | 6 +- apps/dapp/components/icons/TriangleUp.tsx | 17 + apps/dapp/components/icons/Twitter.tsx | 6 +- apps/dapp/components/icons/Votes.tsx | 4 +- apps/dapp/components/icons/Wallet.tsx | 6 +- apps/dapp/components/input/AddressInput.tsx | 9 +- .../dapp/components/input/CodeMirrorInput.tsx | 6 +- apps/dapp/components/input/ImageSelector.tsx | 32 +- .../components/input/InputErrorMessage.tsx | 2 +- apps/dapp/components/input/NumberInput.tsx | 31 +- apps/dapp/components/input/TextInput.tsx | 2 +- apps/dapp/components/input/ToggleInput.tsx | 4 +- .../components/input/TokenAmountInput.tsx | 34 +- apps/dapp/models/proposal/messageMap.ts | 2 +- apps/dapp/models/proposal/proposal.ts | 2 + apps/dapp/models/proposal/proposalActions.ts | 2 +- apps/dapp/next.config.js | 22 +- apps/dapp/package.json | 17 +- apps/dapp/pages/404.tsx | 2 +- apps/dapp/pages/500.tsx | 2 +- apps/dapp/pages/_app.tsx | 6 +- apps/dapp/pages/_document.tsx | 48 +- .../pages/dao/[contractAddress]/index.tsx | 57 +- .../proposals/[proposalId].tsx | 36 +- .../[contractAddress]/proposals/create.tsx | 12 +- apps/dapp/pages/dao/create.tsx | 186 ++--- apps/dapp/pages/dao/list.tsx | 51 +- apps/dapp/pages/index.tsx | 62 +- .../multisig/[contractAddress]/index.tsx | 34 +- .../proposals/[proposalId].tsx | 37 +- .../[contractAddress]/proposals/create.tsx | 6 +- apps/dapp/pages/multisig/create.tsx | 82 +-- apps/dapp/pages/multisig/list.tsx | 53 +- apps/dapp/pages/starred.tsx | 70 +- apps/dapp/public/empty-state-dao.jpeg | Bin 0 -> 769756 bytes apps/dapp/public/empty-state-multisig.jpeg | Bin 0 -> 275893 bytes apps/dapp/selectors/contracts.ts | 4 +- apps/dapp/selectors/cosm.ts | 47 +- apps/dapp/selectors/daos.ts | 40 +- apps/dapp/selectors/multisigs.ts | 8 +- apps/dapp/selectors/proposals.ts | 11 +- apps/dapp/selectors/treasury.ts | 8 +- apps/dapp/services/keplr.tsx | 3 +- apps/dapp/templates/addToken.tsx | 28 +- apps/dapp/templates/changeMembers.tsx | 62 +- apps/dapp/templates/configUpdate.tsx | 72 +- apps/dapp/templates/custom.tsx | 28 +- apps/dapp/templates/mint.tsx | 34 +- apps/dapp/templates/removeToken.tsx | 39 +- apps/dapp/templates/spend.tsx | 62 +- apps/dapp/templates/stake.tsx | 58 +- apps/dapp/templates/templateList.tsx | 4 +- apps/dapp/types/proposals.ts | 1 + apps/dapp/util/chainClientRouter.ts | 64 ++ apps/dapp/util/contractConfigWrapper.ts | 8 +- apps/dapp/util/conversion.ts | 44 +- apps/dapp/util/formValidation.ts | 4 +- apps/dapp/util/messagehelpers.ts | 3 +- apps/dapp/util/proposal.ts | 79 ++- apps/dapp/util/validateWasmMsg.ts | 1 + package.json | 6 +- packages/config/.eslintrc.js | 10 + .../{eslint-preset.js => eslint/import.js} | 25 +- packages/config/eslint/index.js | 42 ++ packages/config/eslint/overrides.js | 16 + packages/config/package.json | 28 +- packages/config/prettier/index.js | 12 + packages/icons/.eslintrc.js | 10 + packages/icons/package.json | 7 +- packages/icons/tsconfig.json | 4 - packages/tsconfig/package.json | 3 +- packages/ui/.eslintrc.js | 10 + packages/ui/globals.css | 231 ++++--- packages/ui/package.json | 5 +- packages/ui/tailwind.config.js | 118 +++- packages/utils/.eslintrc.js | 10 + packages/utils/package.json | 5 +- packages/utils/tsconfig.json | 6 +- yarn.lock | 469 +++++++++---- 143 files changed, 2888 insertions(+), 1661 deletions(-) delete mode 100644 .prettierrc.json delete mode 100644 apps/dapp/.prettierignore create mode 100644 apps/dapp/components/EmptyContractCard.tsx create mode 100644 apps/dapp/components/EmptyDaoCard.tsx create mode 100644 apps/dapp/components/EmptyMultisigCard.tsx create mode 100644 apps/dapp/components/ProposalDetailsSidebar.tsx create mode 100644 apps/dapp/components/icons/TriangleUp.tsx create mode 100644 apps/dapp/public/empty-state-dao.jpeg create mode 100644 apps/dapp/public/empty-state-multisig.jpeg create mode 100644 apps/dapp/util/chainClientRouter.ts create mode 100644 packages/config/.eslintrc.js rename packages/config/{eslint-preset.js => eslint/import.js} (69%) create mode 100644 packages/config/eslint/index.js create mode 100644 packages/config/eslint/overrides.js create mode 100644 packages/config/prettier/index.js create mode 100644 packages/icons/.eslintrc.js delete mode 100644 packages/icons/tsconfig.json create mode 100644 packages/ui/.eslintrc.js create mode 100644 packages/utils/.eslintrc.js diff --git a/.prettierignore b/.prettierignore index a82ef8324..f4d9962e3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,4 @@ -node_modules -.next -build -dist +**/.next/ +**/dist/ +**/node_modules/ +**/out/ diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 043b0cd76..000000000 --- a/.prettierrc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "semi": false, - "trailingComma": "es5", - "singleQuote": true, - "tabWidth": 2, - "useTabs": false -} diff --git a/.vscode/settings.json b/.vscode/settings.json index 305bb69ec..d1eb375f3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,34 @@ "workbench.colorCustomizations": { "activityBar.background": "#38027e" }, + "[css]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascript]": { + "editor.defaultFormatter": "dbaeumer.vscode-eslint" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "dbaeumer.vscode-eslint" + }, + "[typescript]": { + "editor.defaultFormatter": "dbaeumer.vscode-eslint" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "dbaeumer.vscode-eslint" + }, + "css.validate": false, + "eslint.codeActionsOnSave.mode": "problems", + "eslint.format.enable": true, + "eslint.lintTask.enable": true, + "eslint.onIgnoredFiles": "warn", "eslint.workingDirectories": [ - "./apps/dapp", - ], + { + "pattern": "apps/*", + "!cwd": false + }, + { + "pattern": "packages/*", + "!cwd": false + } + ] } diff --git a/apps/dapp/.eslintrc.js b/apps/dapp/.eslintrc.js index e0b422e40..e836a2393 100644 --- a/apps/dapp/.eslintrc.js +++ b/apps/dapp/.eslintrc.js @@ -1 +1,10 @@ -module.exports = require('config/eslint-preset') +// @ts-check + +/** @type {import("eslint").Linter.Config} */ +const eslintConfig = { + extends: [require.resolve('@dao-dao/config/eslint')], + ignorePatterns: ['.next', '.turbo', 'node_modules', 'out'], + root: true, +} + +module.exports = eslintConfig diff --git a/apps/dapp/.prettierignore b/apps/dapp/.prettierignore deleted file mode 100644 index a82ef8324..000000000 --- a/apps/dapp/.prettierignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -.next -build -dist diff --git a/apps/dapp/atoms/pinned.ts b/apps/dapp/atoms/pinned.ts index 3c22987b2..8ada32789 100644 --- a/apps/dapp/atoms/pinned.ts +++ b/apps/dapp/atoms/pinned.ts @@ -1,4 +1,5 @@ -import { atom, AtomEffect } from 'recoil' +import { atom } from 'recoil' + import { localStorageEffect } from 'atoms/localStorageEffect' // As a relic of when we were doing non-backwards compatible changes on the diff --git a/apps/dapp/atoms/proposals.ts b/apps/dapp/atoms/proposals.ts index a95ee8a5a..1b235cc77 100644 --- a/apps/dapp/atoms/proposals.ts +++ b/apps/dapp/atoms/proposals.ts @@ -1,5 +1,7 @@ import { atom, atomFamily } from 'recoil' + import { ContractProposalMap, ExtendedProposalResponse } from 'types/proposals' + import { localStorageEffect } from './localStorageEffect' // By depending on this atom, the selector for retrieving the list diff --git a/apps/dapp/atoms/status.ts b/apps/dapp/atoms/status.ts index 25dba3735..aeb393ac1 100644 --- a/apps/dapp/atoms/status.ts +++ b/apps/dapp/atoms/status.ts @@ -1,4 +1,5 @@ import { atom } from 'recoil' + import { localStorageEffect } from './localStorageEffect' export const loadingAtom = atom({ diff --git a/apps/dapp/components/BetaWarning.tsx b/apps/dapp/components/BetaWarning.tsx index b81e08c90..fa7eba027 100644 --- a/apps/dapp/components/BetaWarning.tsx +++ b/apps/dapp/components/BetaWarning.tsx @@ -6,9 +6,9 @@ import SvgMessage from 'components/icons/Message' export function BetaWarningModal({ onAccept }: { onAccept: Function }) { return ( -
-
-
+
+
+

Before you continue...

DAO DAO is in beta, and has not yet been audited. Do not keep @@ -17,10 +17,10 @@ export function BetaWarningModal({ onAccept }: { onAccept: Function }) {

Give us feedback! {' '} @@ -39,7 +39,7 @@ export function BetaWarningModal({ onAccept }: { onAccept: Function }) {

@@ -48,25 +48,25 @@ export function BetaWarningModal({ onAccept }: { onAccept: Function }) { export function BetaNotice({ onClose }: { onClose: Function }) { return ( -
+

DAO DAO is in
beta!

Share feedback
diff --git a/apps/dapp/components/Breadcrumbs.tsx b/apps/dapp/components/Breadcrumbs.tsx index 31dbb462c..e0792c63c 100644 --- a/apps/dapp/components/Breadcrumbs.tsx +++ b/apps/dapp/components/Breadcrumbs.tsx @@ -7,11 +7,11 @@ import { ArrowNarrowLeftIcon } from '@heroicons/react/outline' */ export function Breadcrumbs({ crumbs }: { crumbs: Array<[string, string]> }) { return ( -