From 21268e5536b76a2cd4016a6351eac6ac700226de Mon Sep 17 00:00:00 2001 From: Linkie Link Date: Wed, 8 Mar 2023 10:44:39 +0100 Subject: [PATCH] UI style updates (#106) * feat: updates on the button styles * env: updated yarn.lock * fix: added account actions * fix: updated the orbs logic * fix: fixed the blur presets * feat: updated the button logic * fix: wallet modal style adjustments * fix: updated close icon * fix: fixed the close button * fix: fix types * fix: fixed the build * tidy: component cleanup * feat: added new AccountDetails component * refactor: propper usage of tailwind * refactor: imports * feat: added pages for all scenarios * fix: fix the loading component * fix: remove loading from default trade * fix: fixed the build * fix: fixed losing the provider on hotplug * tidy: remove unused code * fix: added error messages * add borrow page structure * env: enhanced debugging by restructuring the ENV object * fix: fixed the build * fix: fixed the wording on missing env variables * feat: added button hover (#112) * feat: added button hover * fix: added bg transition to primary buttons * feat: pages refactored (#111) * feat: pages refactored * fix: added loader for AccountNavigation * fix: fixed the wallet store management * fix: get rid of the walletSlice and refactor * fix: added gap to the borrow page * fix: fixed some dependencies * fix: added initClients back * fix: fixed according to feedback --------- Co-authored-by: bwvdhelm <34470358+bobthebuidlr@users.noreply.github.com> --- .env.example | 2 + package.json | 2 +- src/app/borrow/loading.tsx | 3 - src/app/borrow/page.tsx | 8 +- src/app/council/page.tsx | 6 +- src/app/earn/page.tsx | 6 +- src/app/layout.tsx | 36 +- src/app/page.tsx | 6 +- src/app/portfolio/page.tsx | 6 +- src/app/trade/page.tsx | 6 +- .../accounts/[account]/borrow/page.tsx | 46 +- .../accounts/[account]/council/loading.tsx | 3 - .../accounts/[account]/council/page.tsx | 12 +- .../accounts/[account]/earn/loading.tsx | 3 - .../[wallet]/accounts/[account]/earn/page.tsx | 13 +- .../[wallet]/accounts/[account]/page.tsx | 6 +- .../accounts/[account]/portfolio/error.tsx | 5 - .../accounts/[account]/portfolio/page.tsx | 16 +- .../accounts/[account]/trade/loading.tsx | 3 - .../accounts/[account]/trade/page.tsx | 22 +- .../wallets/[wallet]/borrow/council/page.tsx | 3 - src/app/wallets/[wallet]/borrow/earn/page.tsx | 3 - src/app/wallets/[wallet]/borrow/page.tsx | 6 +- .../[wallet]/borrow/portfolio/page.tsx | 3 - .../wallets/[wallet]/borrow/trade/page.tsx | 3 - src/app/wallets/[wallet]/council/page.tsx | 6 +- src/app/wallets/[wallet]/earn/page.tsx | 6 +- src/app/wallets/[wallet]/layout.tsx | 22 +- src/app/wallets/[wallet]/portfolio/page.tsx | 6 +- src/app/wallets/[wallet]/trade/page.tsx | 6 +- src/components/Account/AccountDetails.tsx | 147 +- .../Account/AccountManageOverlay.tsx | 94 - src/components/Account/AccountNavigation.tsx | 229 +- src/components/Account/AccountStatus.tsx | 83 - src/components/Account/FundAccountModal.tsx | 4 +- src/components/Account/WithdrawModal.tsx | 14 +- src/components/AmountAndValue.tsx | 4 +- src/components/Background.tsx | 43 +- src/components/Borrow/BorrowTable.tsx | 33 +- src/components/Borrow/Borrowings.tsx | 69 + src/components/BorrowModal.tsx | 5 +- src/components/Button.tsx | 111 +- src/components/Card.tsx | 18 +- src/components/ContainerSecondary.tsx | 15 - src/components/Council/Overview.tsx | 30 + src/components/Earn/Overview.tsx | 32 + src/components/Gauge.tsx | 67 +- src/components/Icons/Account.svg | 3 + src/components/Icons/Add.svg | 8 +- src/components/Icons/ArrowDownLine.svg | 3 + src/components/Icons/ArrowUpLine.svg | 3 + src/components/Icons/Close.svg | 19 +- src/components/Icons/Heart.svg | 3 + src/components/Icons/index.ts | 4 + src/components/Loading.tsx | 8 +- src/components/Modal.tsx | 14 +- src/components/Modals.tsx | 3 +- .../Navigation/DesktopNavigation.tsx | 19 +- src/components/Navigation/NavLink.tsx | 6 +- src/components/Overlay/Overlay.tsx | 2 +- src/components/Overlay/OverlayAction.tsx | 31 - src/components/Portfolio/AccountOverview.tsx | 70 + src/components/RepayModal.tsx | 11 +- src/components/Slider.tsx | 3 +- src/components/Text.tsx | 1 - src/components/TextLink.tsx | 8 +- src/components/Toaster.tsx | 24 +- src/components/Tooltip.tsx | 2 +- src/components/Trade/OrderBook.tsx | 32 + src/components/Trade/Trade.tsx | 38 + src/components/Trade/TradingView.tsx | 24 + src/components/Wallet/ConnectButton.tsx | 18 +- src/components/Wallet/ConnectedButton.tsx | 74 +- src/components/Wallet/Wallet.tsx | 48 +- .../Wallet/WalletConnectProvider.tsx | 29 +- src/components/pages/borrow.tsx | 14 + src/components/pages/council.tsx | 9 + src/components/pages/earn.tsx | 9 + src/components/pages/portfolio.tsx | 9 + src/components/pages/trade.tsx | 17 + src/constants/env.ts | 60 +- src/hooks/queries/useAllBalances.tsx | 4 +- src/hooks/queries/useAllowedCoins.tsx | 4 +- .../queries/useCreditAccountPositions.tsx | 4 +- src/hooks/queries/useCreditAccounts.tsx | 4 +- src/hooks/queries/useRedbankBalances.tsx | 6 +- src/hooks/queries/useTokenPrices.tsx | 10 +- src/pages/api/accounts/[id]/debts.ts | 6 +- src/pages/api/accounts/[id]/deposits.ts | 6 +- src/pages/api/accounts/[id]/index.ts | 8 +- src/pages/api/markets/balances.ts | 8 +- src/pages/api/markets/borrow.ts | 12 +- src/pages/api/markets/debts.ts | 10 +- src/pages/api/markets/deposits.ts | 10 +- src/pages/api/markets/index.ts | 8 +- src/pages/api/markets/liquidity.ts | 8 +- src/pages/api/prices/index.ts | 8 +- src/pages/api/vaults/index.ts | 8 +- src/pages/api/wallets/[address]/accounts.ts | 8 +- src/pages/api/wallets/[address]/balances.ts | 6 +- src/store/index.ts | 4 +- src/store/slices/broadcast.ts | 29 +- src/store/slices/common.ts | 54 +- src/store/slices/wallet.ts | 79 - src/styles/globals.scss | 116 - src/types/interfaces/asset.d.ts | 4 +- src/types/interfaces/pageParams.d.ts | 4 + src/utils/api.ts | 13 +- tailwind.config.js | 126 +- yarn.lock | 2620 +++++++++-------- 110 files changed, 2602 insertions(+), 2483 deletions(-) delete mode 100644 src/app/borrow/loading.tsx delete mode 100644 src/app/wallets/[wallet]/accounts/[account]/council/loading.tsx delete mode 100644 src/app/wallets/[wallet]/accounts/[account]/earn/loading.tsx delete mode 100644 src/app/wallets/[wallet]/accounts/[account]/portfolio/error.tsx delete mode 100644 src/app/wallets/[wallet]/accounts/[account]/trade/loading.tsx delete mode 100644 src/app/wallets/[wallet]/borrow/council/page.tsx delete mode 100644 src/app/wallets/[wallet]/borrow/earn/page.tsx delete mode 100644 src/app/wallets/[wallet]/borrow/portfolio/page.tsx delete mode 100644 src/app/wallets/[wallet]/borrow/trade/page.tsx delete mode 100644 src/components/Account/AccountManageOverlay.tsx delete mode 100644 src/components/Account/AccountStatus.tsx create mode 100644 src/components/Borrow/Borrowings.tsx delete mode 100644 src/components/ContainerSecondary.tsx create mode 100644 src/components/Council/Overview.tsx create mode 100644 src/components/Earn/Overview.tsx create mode 100644 src/components/Icons/Account.svg create mode 100644 src/components/Icons/ArrowDownLine.svg create mode 100644 src/components/Icons/ArrowUpLine.svg create mode 100644 src/components/Icons/Heart.svg delete mode 100644 src/components/Overlay/OverlayAction.tsx create mode 100644 src/components/Portfolio/AccountOverview.tsx create mode 100644 src/components/Trade/OrderBook.tsx create mode 100644 src/components/Trade/Trade.tsx create mode 100644 src/components/Trade/TradingView.tsx create mode 100644 src/components/pages/borrow.tsx create mode 100644 src/components/pages/council.tsx create mode 100644 src/components/pages/earn.tsx create mode 100644 src/components/pages/portfolio.tsx create mode 100644 src/components/pages/trade.tsx delete mode 100644 src/store/slices/wallet.ts diff --git a/.env.example b/.env.example index 731dcdf6..bb6f2be5 100644 --- a/.env.example +++ b/.env.example @@ -9,5 +9,7 @@ NEXT_PUBLIC_ACCOUNT_NFT=osmo1l8c3g6zy7kjhuh8d2kqyvxkw0myn4puxv0tzcdf9nwxd386r9l7 NEXT_PUBLIC_ORACLE=osmo1dqz2u3c8rs5e7w5fnchsr2mpzzsxew69wtdy0aq4jsd76w7upmsstqe0s8 NEXT_PUBLIC_RED_BANK=osmo1g30recyv8pfy3qd4qn3dn7plc0rn5z68y5gn32j39e96tjhthzxsw3uvvu NEXT_PUBLIC_CREDIT_MANAGER=osmo12hgn4jec4tftahm7spf7c2aqsqrxzzk50hkq60e89atumyu0zvys7vzxdc +NEXT_PUBLIC_INCENTIVES=osmo1zxs8fry3m8j94pqg7h4muunyx86en27cl0xgk76fc839xg2qnn6qtpjs48 NEXT_PUBLIC_ZAPPER=osmo1ua8dwc9v8qjh7n3qf8kg6xvrwjm5yu9xxln7yjvgmrvfzaxvzsuqfcdnjq NEXT_PUBLIC_SWAPPER=osmo1uj6r9tu440wwp2mhtagh48yvmeyeaqt2xa7kdnlhyrqcuthlj4ss7ghg6n +NEXT_PUBLIC_API=http://localhost:3000/api \ No newline at end of file diff --git a/package.json b/package.json index 8ca8fdab..665c0b9a 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "recharts": "^2.2.0", "sass": "^1.58.3", "swr": "^2.0.3", - "tailwindcss-border-gradient-radius": "^3.0.1", + "tailwind-scrollbar-hide": "^1.1.7", "use-local-storage-state": "^18.1.1", "zustand": "^4.1.4" }, diff --git a/src/app/borrow/loading.tsx b/src/app/borrow/loading.tsx deleted file mode 100644 index 0597facd..00000000 --- a/src/app/borrow/loading.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function laoding() { - return '...isLoading' -} diff --git a/src/app/borrow/page.tsx b/src/app/borrow/page.tsx index 94d250b2..fe8775e7 100644 --- a/src/app/borrow/page.tsx +++ b/src/app/borrow/page.tsx @@ -1,7 +1,5 @@ -import { getBorrowData } from 'utils/api' +import BorrowPage from 'components/pages/borrow' -export default async function page() { - const borrowData = await getBorrowData() - - return `You are a guest` +export default async function page({ params }: PageProps) { + return } diff --git a/src/app/council/page.tsx b/src/app/council/page.tsx index 8c592614..a24798ba 100644 --- a/src/app/council/page.tsx +++ b/src/app/council/page.tsx @@ -1,3 +1,5 @@ -export default function page() { - return `You are a guest` +import CouncilPage from 'components/pages/council' + +export default async function page({ params }: PageProps) { + return } diff --git a/src/app/earn/page.tsx b/src/app/earn/page.tsx index 8c592614..35771cc7 100644 --- a/src/app/earn/page.tsx +++ b/src/app/earn/page.tsx @@ -1,3 +1,5 @@ -export default function page() { - return `You are a guest` +import EarnPage from 'components/pages/earn' + +export default async function page({ params }: PageProps) { + return } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 9bec7c3c..de4f3569 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,3 +1,6 @@ +import classNames from 'classnames' + +import AccountDetails from 'components/Account/AccountDetails' import Background from 'components/Background' import FetchPrices from 'components/FetchPrices' import { Modals } from 'components/Modals' @@ -9,22 +12,25 @@ import 'styles/globals.scss' export default function RootLayout({ children }: { children: React.ReactNode }) { return ( - + - -
In wallet: {walletAmount.toLocaleString()} {tokenSymbol}