Skip to content

Commit

Permalink
pass amount and address to top up view
Browse files Browse the repository at this point in the history
  • Loading branch information
jhesgodi committed Mar 11, 2024
1 parent c1e93b1 commit 823f86f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/checkout/widgets-lib/src/widgets/sale/SaleWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ export default function SaleWidget(props: SaleWidgetProps) {
showSwapOption={config.isSwapEnabled}
showBridgeOption={config.isBridgeEnabled}
onCloseButtonClick={() => sendSaleWidgetCloseEvent(eventTarget)}
amount={viewState.view.data?.amount}
tokenAddress={viewState.view.data?.tokenAddress}
/>
)}
</CryptoFiatProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { SmartCheckoutErrorTypes } from '../types';
export function InsufficientCoinsBanner() {
const { t } = useTranslation();
const { viewDispatch } = useContext(ViewContext);
const { smartCheckoutError } = useSaleContext();
const { smartCheckoutError, fromTokenAddress: tokenAddress, amount } = useSaleContext();

if (
smartCheckoutError?.data?.error?.message
Expand All @@ -28,6 +28,7 @@ export function InsufficientCoinsBanner() {
type: ViewActions.UPDATE_VIEW,
view: {
type: SharedViews.TOP_UP_VIEW,
data: { tokenAddress, amount },
},
},
});
Expand Down

0 comments on commit 823f86f

Please sign in to comment.