Skip to content

Commit

Permalink
WT-1933 Bridge form & available balances (#1214)
Browse files Browse the repository at this point in the history
Co-authored-by: Mikhala <[email protected]>
Co-authored-by: Mikhala <[email protected]>
  • Loading branch information
3 people authored Nov 30, 2023
1 parent 0b403f7 commit 8bb064f
Show file tree
Hide file tree
Showing 10 changed files with 284 additions and 193 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
Body,
BottomSheet, Box,
BottomSheet,
Box,
} from '@biom3/react';
import { CoinSelectorOption, CoinSelectorOptionProps } from './CoinSelectorOption';
import { selectOptionsContainerStyles } from './CoinSelectorStyles';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function TextInputForm({
onFocus={handleOnFocus}
disabled={disabled}
hideClearValueButton
sx={{ minWidth: 'base.spacing.x46' }}
sx={{ minWidth: '100%' }}
>
{maxButtonClick && (
<TextInput.Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function CryptoFiatProvider({ environment, children }: CryptoFiatProvider
}, []);

useEffect(() => {
if (!cryptoFiat || tokenSymbols.length === 0 || !fiatSymbol) return;
if (!cryptoFiat || !fiatSymbol) return;

(async () => {
const conversions = await getCryptoToFiatConversion(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@ import { ViewType } from './ViewType';

export enum XBridgeWidgetViews {
BRIDGE_WALLET_SELECTION = 'BRIDGE_WALLET_SELECTION',
BRIDGE_FORM = 'BRIDGE_FORM',
BRIDGE_REVIEW = 'BRIDGE_REVIEW',
}

export type XBridgeWidgetView =
| XBridgeCrossWalletSelection;
| XBridgeCrossWalletSelection
| XBridgeForm
| XBridgeReview;

interface XBridgeCrossWalletSelection extends ViewType {
type: XBridgeWidgetViews.BRIDGE_WALLET_SELECTION,
data?: {}
}

interface XBridgeForm extends ViewType {
type: XBridgeWidgetViews.BRIDGE_FORM,
data?: {}
}

interface XBridgeReview extends ViewType {
type: XBridgeWidgetViews.BRIDGE_REVIEW,
data?: {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ export const text = {
header: {
title: 'Move coins',
},
xBridgeContent: {
title: 'How much would you like to move?',
},
xBridgeFees: {
title: 'Gas Fee',
fiatPricePrefix: '~ USD',
},
content: {
title: 'What would you like to move from Ethereum to Immutable zkEVM?',
fiatPricePrefix: 'Approx USD',
Expand All @@ -213,7 +220,7 @@ export const text = {
inputPlaceholder: '0',
selectorTitle: 'What would you like to move?',
},
buttonText: 'Move',
buttonText: 'Review',
},
fees: {
title: 'Fees subtotal',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ import {
initialViewState,
viewReducer,
} from '../../context/view-context/ViewContext';
import { XBridgeContext, xBridgeReducer, initialXBridgeState } from './context/XBridgeContext';
import {
XBridgeContext,
xBridgeReducer,
initialXBridgeState,
} from './context/XBridgeContext';
import { widgetTheme } from '../../lib/theme';
import { BridgeWalletSelection } from './views/BridgeWalletSelection';
import { Bridge } from './views/Bridge';

export type BridgeWidgetInputs = BridgeWidgetParams & {
config: StrongCheckoutWidgetsConfig,
Expand Down Expand Up @@ -57,6 +62,9 @@ export function XBridgeWidget({
{viewState.view.type === XBridgeWidgetViews.BRIDGE_WALLET_SELECTION && (
<BridgeWalletSelection />
)}
{viewState.view.type === XBridgeWidgetViews.BRIDGE_FORM && (
<Bridge />
)}
</CryptoFiatProvider>
</XBridgeContext.Provider>
</ViewContext.Provider>
Expand Down
Loading

0 comments on commit 8bb064f

Please sign in to comment.