From 8ce952c31c39d10dd676f526d2fde4167899b600 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Thu, 3 Apr 2025 17:33:42 +0530 Subject: [PATCH 1/3] chore: ui-library-migration --- web/package.json | 3 +- web/src/app.tsx | 4 +- .../ConnectWallet/AccountDisplay.tsx | 5 +- web/src/components/ConnectWallet/index.tsx | 8 +- web/src/components/EnsureAuth.tsx | 7 +- web/src/components/LightButton.tsx | 5 +- .../OpenModalRaiseDisputeButton.tsx | 2 +- web/src/components/PreviewCard/Header.tsx | 9 +- .../components/PreviewCard/Terms/Header.tsx | 3 +- web/src/components/StyledTags/index.tsx | 58 + .../TransactionCard/StatusBanner.tsx | 5 +- web/src/components/TransactionCard/index.tsx | 3 +- web/src/components/TransactionInfo/Field.tsx | 5 +- web/src/components/TransactionInfo/index.tsx | 20 +- .../TransactionsDisplay/Filters.tsx | 11 +- .../components/TransactionsDisplay/Search.tsx | 55 +- .../components/TransactionsDisplay/Stats.tsx | 7 +- .../components/TransactionsDisplay/index.tsx | 5 +- web/src/consts/community-elements.tsx | 3 +- web/src/context/StyledComponentsProvider.tsx | 19 +- web/src/layout/Header/navbar/DappList.tsx | 3 +- web/src/layout/Header/navbar/Debug.tsx | 9 +- web/src/layout/Header/navbar/Explore.tsx | 5 +- web/src/layout/Header/navbar/Menu/Help.tsx | 9 +- .../Header/navbar/Menu/Settings/General.tsx | 5 +- .../EmailVerificationInfo.tsx | 9 +- .../FormContactDetails/FormContact.tsx | 12 +- .../FormContactDetails/index.tsx | 2 +- .../Header/navbar/Menu/Settings/index.tsx | 41 +- web/src/layout/Header/navbar/Product.tsx | 10 +- web/src/layout/Header/navbar/index.tsx | 7 +- web/src/pages/AttachmentDisplay/Header.tsx | 5 +- web/src/pages/AttachmentDisplay/index.tsx | 3 +- .../Modal/PaymentReleased/CloseButton.tsx | 2 +- .../Modal/PaymentReleased/Description.tsx | 5 +- .../Modal/PaymentReleased/Header.tsx | 3 +- .../ProposeSettlementModal/AmountField.tsx | 7 +- .../ProposeSettlementModal/Buttons/index.tsx | 2 +- .../ProposeSettlementModal/Description.tsx | 3 +- .../Modal/ProposeSettlementModal/Header.tsx | 3 +- .../AmountClaimed/AmountField.tsx | 4 +- .../AmountClaimed/Header.tsx | 3 +- .../Modal/RaiseDisputeModal/Buttons/index.tsx | 2 +- .../Modal/RaiseDisputeModal/Description.tsx | 3 +- .../Modal/RaiseDisputeModal/FeeRequired.tsx | 5 +- .../Modal/RaiseDisputeModal/Header.tsx | 3 +- .../TransactionDetails/Header.tsx | 3 +- .../AcceptSettlementButton.tsx | 10 +- .../ExecuteTransactionButton.tsx | 13 +- .../ProposeSettlementButton.tsx | 12 +- .../PreviewCardButtons/RaiseDisputeButton.tsx | 4 +- .../PreviewCardButtons/TimeOutButton.tsx | 22 +- .../Buttons/ClaimFullPaymentButton.tsx | 13 +- .../OpenModalProposeSettlementButton.tsx | 2 +- .../Buttons/ReleasePaymentButton.tsx | 10 +- .../WasItFulfilled/Header.tsx | 3 +- .../TransactionDetails/index.tsx | 3 +- .../MyTransactions/TransactionsFetcher.tsx | 3 +- .../EscrowDetails/Title/TextField.tsx | 8 +- .../TypeOfEscrow/EscrowOptions/CryptoSwap.tsx | 3 +- .../EscrowOptions/GeneralEscrow.tsx | 3 +- web/src/pages/NewTransaction/Header.tsx | 3 +- .../DepositPaymentButton.tsx | 4 +- .../NavigationButtons/NextButton.tsx | 4 +- .../NavigationButtons/PreviousButton.tsx | 2 +- .../pages/NewTransaction/Preview/Header.tsx | 3 +- .../NewTransaction/Terms/Deadline/index.tsx | 8 +- .../Terms/Deliverable/index.tsx | 15 +- .../Terms/Notifications/EmailField.tsx | 13 +- .../Terms/Payment/DestinationAddress.tsx | 9 +- .../TokenAndAmount/AmountField.tsx | 13 +- .../TokenAndAmount/MaxBalance.tsx | 7 +- .../TokenSelector/TokenItem/Balance.tsx | 3 +- .../TokenSelector/TokenListModal.tsx | 7 +- .../Terms/Payment/ToDivider.tsx | 3 +- .../TokenAndAmount/AmountField.tsx | 8 +- .../TokenTransaction/TokenAndAmount/Token.tsx | 10 +- web/src/pages/NewTransaction/index.tsx | 3 +- .../Settings/EmailConfirmation/index.tsx | 5 +- web/src/styles/global-style.ts | 66 - web/src/styles/themes.ts | 67 +- yarn.lock | 2975 ++++++++++++++++- 82 files changed, 3255 insertions(+), 487 deletions(-) create mode 100644 web/src/components/StyledTags/index.tsx diff --git a/web/package.json b/web/package.json index 78bc5ce..f48fbaf 100644 --- a/web/package.json +++ b/web/package.json @@ -66,8 +66,9 @@ }, "dependencies": { "@cyntler/react-doc-viewer": "^1.16.3", + "@internationalized/date": "^3.7.0", "@kleros/kleros-app": "^2.0.2", - "@kleros/ui-components-library": "^2.19.0", + "@kleros/ui-components-library": "3.0.0-rc1", "@reown/appkit": "^1.6.6", "@reown/appkit-adapter-wagmi": "^1.6.6", "@sentry/react": "^7.93.0", diff --git a/web/src/app.tsx b/web/src/app.tsx index 301a884..8055193 100644 --- a/web/src/app.tsx +++ b/web/src/app.tsx @@ -3,6 +3,7 @@ import { Navigate, Route } from "react-router-dom"; import { SentryRoutes } from "./utils/sentry"; import "react-loading-skeleton/dist/skeleton.css"; import "react-toastify/dist/ReactToastify.css"; +import "@kleros/ui-components-library/dist/ui-components-library.css"; import Web3Provider from "context/Web3Provider"; import IsListProvider from "context/IsListProvider"; import QueryClientProvider from "context/QueryClientProvider"; @@ -15,6 +16,7 @@ import { NewTransactionProvider } from "./context/NewTransactionContext"; import AttachmentDisplay from "./pages/AttachmentDisplay"; import AtlasProvider from "./context/AtlasProvider"; import Settings from "./pages/Settings"; +import { StyledH1 } from "./components/StyledTags"; const App: React.FC = () => { return ( @@ -32,7 +34,7 @@ const App: React.FC = () => { } /> } /> } /> - 404 not found} /> + 404 not found} /> diff --git a/web/src/components/ConnectWallet/AccountDisplay.tsx b/web/src/components/ConnectWallet/AccountDisplay.tsx index bc44baf..bf1d95c 100644 --- a/web/src/components/ConnectWallet/AccountDisplay.tsx +++ b/web/src/components/ConnectWallet/AccountDisplay.tsx @@ -10,6 +10,7 @@ import { getChain } from "consts/chains"; import { shortenAddress } from "utils/shortenAddress"; import { landscapeStyle } from "styles/landscapeStyle"; +import { StyledLabel } from "../StyledTags"; const Container = styled.div` display: flex; @@ -153,13 +154,13 @@ export const AddressOrName: React.FC = ({ address: propAddress } chainId: 1, }); - return ; + return {data ?? (isAddress(address!) ? shortenAddress(address) : address)}; }; export const ChainDisplay: React.FC = () => { const chainId = useChainId(); const chain = getChain(chainId); - return ; + return {chain?.name}; }; const AccountDisplay: React.FC = () => { diff --git a/web/src/components/ConnectWallet/index.tsx b/web/src/components/ConnectWallet/index.tsx index 4102e14..eddf305 100644 --- a/web/src/components/ConnectWallet/index.tsx +++ b/web/src/components/ConnectWallet/index.tsx @@ -22,9 +22,9 @@ export const SwitchChainButton: React.FC<{ className?: string }> = ({ className