From ede4e6583858e8db292a233c3c9d3e9e47817b99 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 7 Nov 2024 18:28:13 +1000 Subject: [PATCH 1/2] chore: Add class name WIP --- .../components/Button/RefreshingButton.tsx | 1 + .../transfer/components/FromSection/index.tsx | 10 +++++++++- .../transfer/components/NetWorkSection/index.tsx | 11 +++++++++-- .../transfer/components/SelectButton/index.tsx | 2 ++ .../transfer/components/ToSection/index.tsx | 10 +++++++++- .../RouteInfo/AllowedSendAmount.tsx | 1 + .../RouteInfo/EstimatedArrivalTime.tsx | 5 +++-- .../TransferOverview/RouteInfo/FeeBreakdown.tsx | 7 ++++++- .../TransferOverview/RouteInfo/FeesInfo.tsx | 3 +++ .../RouteInfo/OtherRouteError.tsx | 1 + .../RouteInfo/RouteName/BestRouteTag.tsx | 1 + .../RouteInfo/RouteName/index.tsx | 2 ++ .../TransferOverview/RouteInfo/RouteSkeleton.tsx | 1 + .../TransferOverview/RouteInfo/RouteTitle.tsx | 10 +++++++++- .../TransferOverview/RouteInfo/RouteWrapper.tsx | 1 + .../RouteInfo/TokenInfoTooltip.tsx | 2 +- .../components/TransferOverview/index.tsx | 16 +++++++++++++--- .../TransferOverview/modal/RoutesModal.tsx | 11 +++++++++-- .../src/modules/transfer/index.tsx | 2 ++ 19 files changed, 83 insertions(+), 14 deletions(-) diff --git a/packages/canonical-bridge-widget/src/modules/transfer/components/Button/RefreshingButton.tsx b/packages/canonical-bridge-widget/src/modules/transfer/components/Button/RefreshingButton.tsx index cae4f583..81adfeb7 100644 --- a/packages/canonical-bridge-widget/src/modules/transfer/components/Button/RefreshingButton.tsx +++ b/packages/canonical-bridge-widget/src/modules/transfer/components/Button/RefreshingButton.tsx @@ -66,6 +66,7 @@ export const RefreshingButton = (props: BoxProps) => { return transferActionInfo ? ( + { const theme = useTheme(); return ( - + - + { { {' '} state.transfer.toChain); return ( - + - + {formatMessage({ id: 'route.time.title' })} {waitingTime ? ( - + ~{formatEstimatedTime(waitingTime)} ) : ( diff --git a/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/RouteInfo/FeeBreakdown.tsx b/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/RouteInfo/FeeBreakdown.tsx index c961bde0..2fee40aa 100644 --- a/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/RouteInfo/FeeBreakdown.tsx +++ b/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/RouteInfo/FeeBreakdown.tsx @@ -4,7 +4,12 @@ export const FeeBreakdown = ({ title, value }: { title: string; value: string }) const theme = useTheme(); // TODO: Use colorMode return ( - + {title} diff --git a/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/RouteInfo/FeesInfo.tsx b/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/RouteInfo/FeesInfo.tsx index 1145390b..836fc034 100644 --- a/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/RouteInfo/FeesInfo.tsx +++ b/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/RouteInfo/FeesInfo.tsx @@ -18,6 +18,7 @@ export const FeesInfo = ({ summary, breakdown, bridgeType, isError }: FeesInfoPr const { formatMessage } = useIntl(); return ( { const routeError = useAppSelector((state) => state.transfer.routeError); return routeError && routeError[bridgeType] ? ( { const { formatMessage } = useIntl(); return ( { return ( + isNativeToken(tokenAddress), [tokenAddress]); return ( - + {children} diff --git a/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/index.tsx b/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/index.tsx index 1ecca835..3066706f 100644 --- a/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/index.tsx +++ b/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/index.tsx @@ -117,6 +117,7 @@ export function TransferOverview({ routeContentBottom }: { routeContentBottom?: > ) : ( - + {options?.map((bridge: ReactNode) => bridge)} )} @@ -172,7 +174,13 @@ export function TransferOverview({ routeContentBottom }: { routeContentBottom?: transition={'width 0.15s'} > {cBridgeSupport && } - + {!routeContentBottom ? ( content ) : ( @@ -182,7 +190,9 @@ export function TransferOverview({ routeContentBottom }: { routeContentBottom?: )} - {routeContentBottom ? routeContentBottom : null} + + {routeContentBottom ? routeContentBottom : null} + ); diff --git a/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/modal/RoutesModal.tsx b/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/modal/RoutesModal.tsx index c30b730c..30a9f574 100644 --- a/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/modal/RoutesModal.tsx +++ b/packages/canonical-bridge-widget/src/modules/transfer/components/TransferOverview/modal/RoutesModal.tsx @@ -16,8 +16,9 @@ export function RoutesModal(props: RoutesModalProps) { return ( - + - + {children} diff --git a/packages/canonical-bridge-widget/src/modules/transfer/index.tsx b/packages/canonical-bridge-widget/src/modules/transfer/index.tsx index a3513f21..d4853c83 100644 --- a/packages/canonical-bridge-widget/src/modules/transfer/index.tsx +++ b/packages/canonical-bridge-widget/src/modules/transfer/index.tsx @@ -32,6 +32,7 @@ export function TransferWidget() { return ( Date: Mon, 11 Nov 2024 12:32:37 +1000 Subject: [PATCH 2/2] chore: Add more class name --- .../core/components/ConfirmCheckbox/index.tsx | 69 ------------------- .../src/core/components/CopyAddress/index.tsx | 8 ++- .../src/core/components/InfoTooltip/index.tsx | 1 + .../src/core/components/StateModal/index.tsx | 12 +++- .../src/core/components/VirtualList/index.tsx | 5 +- .../components/icons/ConfirmCheckIcon.tsx | 7 +- .../src/core/locales/en.ts | 1 - .../SelectModal/ChooseTokenModal.tsx | 9 ++- .../SelectModal/DestinationNetworkModal.tsx | 4 +- .../SelectModal/SourceNetworkModal.tsx | 4 +- .../SelectModal/components/BaseModal.tsx | 10 ++- .../SelectModal/components/ListItem.tsx | 1 + .../SelectModal/components/NoResultFound.tsx | 19 ++++- .../SelectModal/components/SearchInput.tsx | 1 + .../components/Button/ExchangeChain.tsx | 1 + .../components/Button/SwitchNetworkButton.tsx | 1 + .../components/Button/SwitchWalletButton.tsx | 1 + .../components/Button/TransferButton.tsx | 2 +- .../components/Button/WalletConnectButton.tsx | 1 + .../components/ExternalTokenAddress/index.tsx | 43 ------------ .../Modal/TransactionApproveModal/index.tsx | 2 + .../TransactionConfirmingModal/index.tsx | 1 + .../Modal/TransactionFailedModal/index.tsx | 1 + .../Modal/TransactionSubmittedModal/index.tsx | 2 + .../components/ReceiveInfo/ReceiveLoading.tsx | 6 +- .../transfer/components/ReceiveInfo/index.tsx | 15 +++- .../SelectButton/TokenSelectButton.tsx | 1 + .../SendInput/InputValidationMessage.tsx | 1 + .../transfer/components/SendInput/MaxLink.tsx | 2 +- .../transfer/components/SendInput/index.tsx | 3 +- .../transfer/components/ToAccount/index.tsx | 22 +++++- .../components/TransferButtonGroup/index.tsx | 6 +- .../TransferOverview/NoRouteFound.tsx | 13 +++- .../components/TransferOverview/index.tsx | 1 + .../src/modules/transfer/index.tsx | 4 +- .../src/modules/wallet/WalletProvider.tsx | 1 + .../wallet/components/ConnectButton/index.tsx | 7 +- .../components/Dropdown/DropdownButton.tsx | 1 + .../components/Dropdown/DropdownItem.tsx | 1 + .../components/Dropdown/DropdownList.tsx | 1 + .../wallet/components/NetworkStatus/index.tsx | 3 +- .../wallet/components/ProfileMenu/index.tsx | 4 +- .../components/SwitchingTipsModal/index.tsx | 1 + 43 files changed, 152 insertions(+), 147 deletions(-) delete mode 100644 packages/canonical-bridge-widget/src/core/components/ConfirmCheckbox/index.tsx delete mode 100644 packages/canonical-bridge-widget/src/modules/transfer/components/ExternalTokenAddress/index.tsx diff --git a/packages/canonical-bridge-widget/src/core/components/ConfirmCheckbox/index.tsx b/packages/canonical-bridge-widget/src/core/components/ConfirmCheckbox/index.tsx deleted file mode 100644 index 5e2ed4f9..00000000 --- a/packages/canonical-bridge-widget/src/core/components/ConfirmCheckbox/index.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import { Checkbox, CheckboxProps, theme, useColorMode } from '@bnb-chain/space'; - -export const ConfirmCheckbox: React.FC = (props: CheckboxProps) => { - const { colorMode } = useColorMode(); - - const { isChecked } = props; - - return ( - - ); -}; diff --git a/packages/canonical-bridge-widget/src/core/components/CopyAddress/index.tsx b/packages/canonical-bridge-widget/src/core/components/CopyAddress/index.tsx index 9bc3adee..4d30a6ff 100644 --- a/packages/canonical-bridge-widget/src/core/components/CopyAddress/index.tsx +++ b/packages/canonical-bridge-widget/src/core/components/CopyAddress/index.tsx @@ -27,7 +27,13 @@ export const CopyAddress = ({ return null; } return ( - + { return ( { bodyProps?: ModalBodyProps; mainButtonIsDisabled?: boolean; closeButtonIsDisabled?: boolean; + className?: string; } export function StateModal(props: StateModalProps) { @@ -58,6 +59,7 @@ export function StateModal(props: StateModalProps) { mainButtonIsDisabled = false, closeButtonIsDisabled = false, onClose, + className, mainButtonProps, bodyProps, footerProps, @@ -76,8 +78,9 @@ export function StateModal(props: StateModalProps) { - + - {icon} + {icon} {description && ( {mainButtonText && (