From 3bcb4a881e3bb58e741de8bb8a0a661dede0d8ae Mon Sep 17 00:00:00 2001 From: Yaroslav Grishajev Date: Mon, 25 Nov 2024 10:13:48 +0100 Subject: [PATCH] fix(billing): ensure checkout pricing is displayed correctly --- .../get-started/GetStartedStepper.tsx | 2 +- .../src/components/home/YourAccount.tsx | 2 +- .../TopUpAmountPicker.tsx | 80 +++++++++++-------- .../components/wallet/ManagedWalletPopup.tsx | 2 +- .../src/queries/useProvidersQuery.ts | 16 ---- 5 files changed, 50 insertions(+), 52 deletions(-) diff --git a/apps/deploy-web/src/components/get-started/GetStartedStepper.tsx b/apps/deploy-web/src/components/get-started/GetStartedStepper.tsx index e264fc36a..97a8f9899 100644 --- a/apps/deploy-web/src/components/get-started/GetStartedStepper.tsx +++ b/apps/deploy-web/src/components/get-started/GetStartedStepper.tsx @@ -104,7 +104,7 @@ export const GetStartedStepper: React.FunctionComponent = () => {
{isManagedWallet && ( - + = ({ isLoadingBalances, )} {isManagedWallet && ( - + = ({ children, popoverClassName, fullWidth }) => { +export const TopUpAmountPicker: FCWithChildren = ({ children, popoverClassName, className, mdMode }) => { const user = useUser(); + const [isOpened, setIsOpened] = React.useState(false); const { data = [] } = useStripePricesQuery({ enabled: !!user?.userId }); + const muiTheme = useMuiTheme(); + const isSmallScreen = useMediaQuery(muiTheme.breakpoints.down("md")); + const isOnClick = mdMode === "click" || isSmallScreen; - return data.length > 1 ? ( - - - {children} - - -
- {data.map(price => { - return ( - - {price.isCustom ? "Custom" : "$"} - {price.unitAmount} - - ); - })} -
-
- ) : ( - <>{children} + return ( +
+ {data.length > 1 ? ( + <> +
+ {children} + {isOnClick && ( + + )} +
+
+ {data.map(price => { + return ( + + {price.isCustom ? "Custom" : "$"} + {price.unitAmount} + + ); + })} +
+ + ) : ( + <>{children} + )} +
); }; diff --git a/apps/deploy-web/src/components/wallet/ManagedWalletPopup.tsx b/apps/deploy-web/src/components/wallet/ManagedWalletPopup.tsx index 8cd24fcac..71fc6d259 100644 --- a/apps/deploy-web/src/components/wallet/ManagedWalletPopup.tsx +++ b/apps/deploy-web/src/components/wallet/ManagedWalletPopup.tsx @@ -71,7 +71,7 @@ export const ManagedWalletPopup: React.FC = ({ walletBa )}
- +