From cd5ec3ee3ba8776d50185cdbaebbd03797e60de8 Mon Sep 17 00:00:00 2001 From: Bob van der Helm <34470358+bobthebuidlr@users.noreply.github.com> Date: Tue, 2 May 2023 15:55:32 +0800 Subject: [PATCH] Mp 2540 farm overview (#172) * tidy: refactor text * tidy: refactor text * fix display of vaults table * feat: added unstyled select * tidy: useToggle * tidy: useToggle * add vaults to types * MP-2344: first unstyled version of Select * fix: fixed the build * MP-2344: progress on the Select * MP-2344: almost finished the Select * implement basic vault modal (no logic) * :bento: max + displaycur for token input * Convert to BN for TokenInputs * env: update wallet-connector * fix: fixed build errors and relative imports * fix: updated TokenInput * tidy: format * fix: BN instead of new BigNumber --------- Co-authored-by: Linkie Link --- package.json | 14 +- src/app/layout.tsx | 6 +- src/components/Accordion.tsx | 2 +- src/components/Account/AccountDetails.tsx | 2 +- src/components/Account/AccountList.tsx | 17 +- src/components/Account/AccountMenuContent.tsx | 37 +++- src/components/Account/AccountStats.tsx | 2 +- src/components/Account/AccountSummary.tsx | 2 +- src/components/Account/CreateAccount.tsx | 2 +- src/components/Account/FundAccount.tsx | 44 ++-- src/components/Account/RiskChart.tsx | 4 +- src/components/Borrow/BorrowTable.tsx | 2 +- src/components/BorrowCapacity.tsx | 6 +- src/components/BorrowModal.tsx | 19 +- src/components/Card.tsx | 2 +- src/components/CircularProgress.tsx | 2 +- src/components/Council/Overview.tsx | 2 +- src/components/DisplayCurrency.tsx | 11 +- .../Earn/{ => vault}/AvailableVaults.tsx | 7 +- .../Earn/{ => vault}/FeaturedVaults.tsx | 12 +- src/components/Earn/{ => vault}/VaultCard.tsx | 33 +-- src/components/Earn/vault/VaultExpanded.tsx | 53 +++++ src/components/Earn/{ => vault}/VaultLogo.tsx | 0 src/components/Earn/vault/VaultModal.tsx | 114 ++++++++++ src/components/Earn/{ => vault}/VaultRow.tsx | 3 +- .../Earn/{ => vault}/VaultTable.tsx | 16 +- src/components/Footer.tsx | 15 ++ src/components/LabelValuePair.tsx | 2 +- src/components/Modals.tsx | 2 + src/components/NumberInput.tsx | 101 +++++---- src/components/Overlay/Overlay.tsx | 14 +- src/components/Portfolio/AccountOverview.tsx | 2 +- src/components/Select/Option.tsx | 75 +++++++ src/components/Select/Select.tsx | 82 +++++++ src/components/Settings.tsx | 17 +- src/components/Slider.tsx | 5 +- src/components/Switch.tsx | 4 +- src/components/SwitchWithLabel.tsx | 4 +- src/components/Text.tsx | 20 +- src/components/TitleAndSubCell.tsx | 2 +- src/components/Toaster.tsx | 4 +- src/components/TokenInput.tsx | 124 +++++++++-- src/components/TokenInputWithSlider.tsx | 59 +++-- src/components/Trade/OrderBook.tsx | 2 +- src/components/Trade/Trade.tsx | 2 +- src/components/Trade/TradingView.tsx | 2 +- src/components/Wallet/ConnectedButton.tsx | 20 +- src/components/pages/farm.tsx | 8 +- src/hooks/useToggle.tsx | 14 ++ src/pages/api/accounts/[id]/vaults.ts | 21 ++ src/pages/api/markets/borrow.ts | 4 +- src/store/slices/common.ts | 3 +- src/store/slices/modal.ts | 4 + src/types/interfaces/account.d.ts | 1 + src/types/interfaces/option.d.ts | 1 + src/types/interfaces/responses.d.ts | 1 + src/types/interfaces/vaults.d.ts | 13 ++ src/utils/accounts.ts | 14 +- src/utils/formatters.ts | 17 +- src/utils/helpers.ts | 5 + src/utils/resolvers.ts | 1 + yarn.lock | 201 +++++++++--------- 62 files changed, 922 insertions(+), 358 deletions(-) rename src/components/Earn/{ => vault}/AvailableVaults.tsx (88%) rename src/components/Earn/{ => vault}/FeaturedVaults.tsx (73%) rename src/components/Earn/{ => vault}/VaultCard.tsx (75%) create mode 100644 src/components/Earn/vault/VaultExpanded.tsx rename src/components/Earn/{ => vault}/VaultLogo.tsx (100%) create mode 100644 src/components/Earn/vault/VaultModal.tsx rename src/components/Earn/{ => vault}/VaultRow.tsx (86%) rename src/components/Earn/{ => vault}/VaultTable.tsx (93%) create mode 100644 src/components/Footer.tsx create mode 100644 src/components/Select/Option.tsx create mode 100644 src/components/Select/Select.tsx create mode 100644 src/hooks/useToggle.tsx create mode 100644 src/pages/api/accounts/[id]/vaults.ts create mode 100644 src/types/interfaces/option.d.ts create mode 100644 src/utils/helpers.ts diff --git a/package.json b/package.json index b5157f7c..f7c866f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mars-v2-frontend", - "version": "0.1.0", + "version": "2.0.0", "private": true, "scripts": { "build": "next build", @@ -13,13 +13,13 @@ "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.30.1", "@cosmjs/stargate": "^0.30.1", - "@marsprotocol/wallet-connector": "^1.5.3", - "@sentry/nextjs": "^7.47.0", + "@marsprotocol/wallet-connector": "^1.5.4", + "@sentry/nextjs": "^7.48.0", "@tanstack/react-table": "^8.8.5", "@tippyjs/react": "^4.2.6", "bignumber.js": "^9.1.1", "classnames": "^2.3.2", - "graphql-request": "^5.2.0", + "graphql-request": "^6.0.0", "moment": "^2.29.4", "next": "^13.3.0", "react": "^18.2.0", @@ -30,14 +30,14 @@ "react-toastify": "^9.1.2", "react-use-clipboard": "^1.0.9", "recharts": "^2.5.0", - "swr": "^2.1.2", + "swr": "^2.1.3", "tailwind-scrollbar-hide": "^1.1.7", "zustand": "^4.3.7" }, "devDependencies": { "@svgr/webpack": "^7.0.0", "@types/node": "^18.15.11", - "@types/react": "18.0.33", + "@types/react": "18.0.35", "@types/react-dom": "18.0.11", "autoprefixer": "^10.4.14", "eslint": "8.38.0", @@ -45,7 +45,7 @@ "eslint-plugin-import": "^2.27.5", "postcss": "^8.4.21", "prettier": "^2.8.7", - "prettier-plugin-tailwindcss": "^0.2.6", + "prettier-plugin-tailwindcss": "^0.2.7", "tailwindcss": "^3.3.1", "typescript": "5.0.4" }, diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 97d031e5..ffeda540 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -4,6 +4,7 @@ import { headers } from 'next/headers' import AccountDetails from 'components/Account/AccountDetails' import Background from 'components/Background' import FetchPrices from 'components/FetchPrices' +import Footer from 'components/Footer' import DesktopHeader from 'components/Header/DesktopHeader' import { Modals } from 'components/Modals' import Toaster from 'components/Toaster' @@ -23,13 +24,14 @@ export default function RootLayout(props: { children: React.ReactNode }) {
{props.children}
+