From f671e21da017bfb2d985ac56c606436178cb5393 Mon Sep 17 00:00:00 2001 From: Yurixander <101931215+yurixander@users.noreply.github.com> Date: Sun, 5 Jan 2025 20:48:43 -0500 Subject: [PATCH] refactor(tangle-dapp): Update restaking page organization (#2711) --- apps/tangle-cloud/app/blueprints/page.tsx | 13 +- apps/tangle-cloud/app/providers.tsx | 2 +- apps/tangle-dapp/src/app/app.tsx | 54 +---- apps/tangle-dapp/src/app/providers.tsx | 7 +- .../components/LiquidStaking/LstListItem.tsx | 62 +++++ .../stakeAndUnstake/LsSelectLstModal.tsx | 215 ------------------ .../stakeAndUnstake/LsStakeCard.tsx | 35 ++- .../stakeAndUnstake/LsTokenChip.tsx | 4 +- .../stakeAndUnstake/LsUnstakeCard.tsx | 36 ++- .../stakeAndUnstake/SelectedPoolIndicator.tsx | 7 +- .../tangle-dapp/src/components/ListStatus.tsx | 40 ---- .../src/components/Lists/AssetList.tsx | 2 +- .../src/components/Lists/LogoListItem.tsx | 75 ++++++ .../src/components/Lists/OperatorList.tsx | 139 ----------- .../src/components/Lists/OperatorListItem.tsx | 40 ++++ .../ValidatorSelectionTable.tsx | 2 +- .../src/components/tables/Vaults/index.tsx | 2 +- apps/tangle-dapp/src/constants/index.ts | 8 + .../src/containers/AssetsAndBalancesTable.tsx | 27 ++- .../NominationsPayoutsContainer.tsx | 4 - apps/tangle-dapp/src/pages/account.tsx | 2 +- .../src/pages/blueprints/index.tsx | 10 +- .../components/BridgeConfirmationModal.tsx | 2 +- apps/tangle-dapp/src/pages/notFound.tsx | 28 +++ .../src/pages/restake/ActionButtonBase.tsx | 23 -- .../src/pages/restake/AnimatedTable.tsx | 5 +- .../src/pages/restake/AssetList.tsx | 35 --- .../src/pages/restake/AssetPlaceholder.tsx | 18 +- .../src/pages/restake/ModalContent.tsx | 36 --- .../src/pages/restake/RestakeTabs.tsx | 31 ++- .../src/pages/restake/SelectorPlaceholder.tsx | 22 -- .../src/pages/restake/SupportedChainModal.tsx | 3 +- .../src/pages/restake/deposit/DepositForm.tsx | 157 +++++++------ .../restake/deposit/SourceChainInput.tsx | 7 +- .../src/pages/restake/deposit/index.tsx | 12 - apps/tangle-dapp/src/pages/restake/layout.tsx | 13 -- ...{TableTabs.tsx => RestakeOverviewTabs.tsx} | 50 +++- .../src/pages/restake/overview/index.tsx | 114 ++-------- .../src/pages/restake/providers.tsx | 6 - .../src/pages/restake/stake/StakeInput.tsx | 75 +++--- .../src/pages/restake/stake/index.tsx | 177 +++++++------- .../restake/unstake/SelectOperatorModal.tsx | 101 ++++++++ .../pages/restake/unstake/UnstakeModal.tsx | 144 ------------ .../restake/unstake/UnstakeRequestTable.tsx | 14 +- .../src/pages/restake/unstake/index.tsx | 126 +++++----- .../src/pages/restake/withdraw/TxInfo.tsx | 3 +- .../pages/restake/withdraw/WithdrawModal.tsx | 142 ++++-------- .../src/pages/restake/withdraw/index.tsx | 128 +++++------ apps/tangle-dapp/src/types/index.ts | 6 +- .../src/utils/createSearchFilterFn.ts | 26 +++ apps/tangle-dapp/src/utils/isEnumValue.ts | 21 ++ apps/tangle-dapp/src/utils/searchBy.ts | 22 ++ apps/tangle-dapp/tailwind.config.js | 2 +- .../chains/evm/customChains/tangleLocalEvm.ts | 2 +- .../evm/customChains/tangleTestnetEVM.ts | 2 +- libs/dapp-config/src/chains/evm/index.tsx | 3 +- .../src/chains/substrate/index.tsx | 4 +- libs/icons/src/TokenIcon.tsx | 6 +- libs/icons/src/utils.ts | 23 +- .../ConnectWalletButton/WalletDropdown.tsx | 1 - .../src/components/ListModal.tsx | 179 +++++++++++++++ .../NetworkSelectorDropdown/index.tsx | 2 +- .../src/components/SkeletonRows.tsx | 0 .../components/blueprints/RestakeBanner.tsx | 56 +++++ .../src/components/blueprints/TopBanner.tsx | 37 --- .../RestakeContext/RestakeContextProvider.tsx | 1 - libs/tangle-shared-ui/src/types/restake.ts | 4 +- .../src/components/Card/Card.tsx | 7 +- .../src/components/ListCard/TokenListCard.tsx | 188 --------------- .../src/components/ListCard/index.ts | 1 - .../src/components/ListCard/types.ts | 67 +----- .../src/components/ListStatus.tsx | 48 ++++ .../src/components/SideBar/SideBar.tsx | 6 +- .../TokenSelector/TokenSelector.tsx | 67 +++--- .../TransactionInputCard.tsx | 3 +- .../src/components/buttons/ButtonSpinner.tsx | 2 +- .../components/buttons/ChainOrTokenButton.tsx | 2 +- .../src/components/buttons/utils.ts | 2 +- .../src/components/index.ts | 1 + .../src/constants/tangleDocs.ts | 5 +- .../containers/DepositCard/DepositCard.tsx | 44 ++-- .../GovernanceContractDetailCard/types.ts | 2 +- .../containers/TransferCard/TransferCard.tsx | 21 +- .../containers/WebbUIErrorBoudary/index.ts | 1 - .../WebbUIErrorBoundary.tsx} | 10 +- .../containers/WebbUIErrorBoundary/index.ts | 1 + .../types.ts | 4 +- .../containers/WithdrawCard/WithdrawCard.tsx | 30 +-- .../src/containers/index.ts | 2 +- libs/webb-ui-components/src/hooks/index.ts | 2 +- .../src/hooks/useCopyable.ts | 29 +-- .../src/hooks/useDarkMode.ts | 3 - .../{useCheckMobile.ts => useIsMobile.ts} | 14 +- .../webb-ui-components/src/provider/index.tsx | 8 +- libs/webb-ui-components/src/provider/types.ts | 8 +- 95 files changed, 1439 insertions(+), 1794 deletions(-) create mode 100644 apps/tangle-dapp/src/components/LiquidStaking/LstListItem.tsx delete mode 100644 apps/tangle-dapp/src/components/LiquidStaking/stakeAndUnstake/LsSelectLstModal.tsx delete mode 100644 apps/tangle-dapp/src/components/ListStatus.tsx create mode 100644 apps/tangle-dapp/src/components/Lists/LogoListItem.tsx delete mode 100644 apps/tangle-dapp/src/components/Lists/OperatorList.tsx create mode 100644 apps/tangle-dapp/src/components/Lists/OperatorListItem.tsx create mode 100644 apps/tangle-dapp/src/pages/notFound.tsx delete mode 100644 apps/tangle-dapp/src/pages/restake/AssetList.tsx delete mode 100644 apps/tangle-dapp/src/pages/restake/ModalContent.tsx delete mode 100644 apps/tangle-dapp/src/pages/restake/SelectorPlaceholder.tsx delete mode 100644 apps/tangle-dapp/src/pages/restake/deposit/index.tsx delete mode 100644 apps/tangle-dapp/src/pages/restake/layout.tsx rename apps/tangle-dapp/src/pages/restake/overview/{TableTabs.tsx => RestakeOverviewTabs.tsx} (77%) delete mode 100644 apps/tangle-dapp/src/pages/restake/providers.tsx create mode 100644 apps/tangle-dapp/src/pages/restake/unstake/SelectOperatorModal.tsx delete mode 100644 apps/tangle-dapp/src/pages/restake/unstake/UnstakeModal.tsx create mode 100644 apps/tangle-dapp/src/utils/createSearchFilterFn.ts create mode 100644 apps/tangle-dapp/src/utils/isEnumValue.ts create mode 100644 apps/tangle-dapp/src/utils/searchBy.ts create mode 100644 libs/tangle-shared-ui/src/components/ListModal.tsx rename {apps/tangle-dapp => libs/tangle-shared-ui}/src/components/SkeletonRows.tsx (100%) create mode 100644 libs/tangle-shared-ui/src/components/blueprints/RestakeBanner.tsx delete mode 100644 libs/tangle-shared-ui/src/components/blueprints/TopBanner.tsx delete mode 100644 libs/webb-ui-components/src/components/ListCard/TokenListCard.tsx create mode 100644 libs/webb-ui-components/src/components/ListStatus.tsx delete mode 100644 libs/webb-ui-components/src/containers/WebbUIErrorBoudary/index.ts rename libs/webb-ui-components/src/containers/{WebbUIErrorBoudary/WebbUIErrorBoudary.tsx => WebbUIErrorBoundary/WebbUIErrorBoundary.tsx} (79%) create mode 100644 libs/webb-ui-components/src/containers/WebbUIErrorBoundary/index.ts rename libs/webb-ui-components/src/containers/{WebbUIErrorBoudary => WebbUIErrorBoundary}/types.ts (74%) rename libs/webb-ui-components/src/hooks/{useCheckMobile.ts => useIsMobile.ts} (68%) diff --git a/apps/tangle-cloud/app/blueprints/page.tsx b/apps/tangle-cloud/app/blueprints/page.tsx index a9706bf990..092096b52b 100644 --- a/apps/tangle-cloud/app/blueprints/page.tsx +++ b/apps/tangle-cloud/app/blueprints/page.tsx @@ -1,12 +1,19 @@ -import TopBanner from '@webb-tools/tangle-shared-ui/components/blueprints/TopBanner'; +import RestakeBanner from '@webb-tools/tangle-shared-ui/components/blueprints/RestakeBanner'; import BlueprintListing from './BlueprintListing'; +import { BLUEPRINT_DOCS_LINK } from '@webb-tools/webb-ui-components/constants/tangleDocs'; +import { FC } from 'react'; export const dynamic = 'force-static'; -const Page = () => { +const Page: FC = () => { return (