Skip to content

Commit

Permalink
[fix] Adapted navigation to revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
stackchain committed Jan 17, 2022
1 parent 6d87a75 commit dc3982f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/Send/ConfirmScreen/ConfirmScreen.tsx
Expand Up @@ -31,7 +31,7 @@ import {
Text,
ValidatedTextInput,
} from '../../../legacy/components/UiKit'
import {CONFIG} from '../../../legacy/config/config'
import {CONFIG, UI_V2} from '../../../legacy/config/config'
import {WrongPassword} from '../../../legacy/crypto/errors'
import {ISignRequest} from '../../../legacy/crypto/ISignRequest'
import KeyStore from '../../../legacy/crypto/KeyStore'
Expand Down Expand Up @@ -181,10 +181,12 @@ export const ConfirmScreen = () => {
CommonActions.reset({
key: null,
index: 0,
routes: [{name: SEND_ROUTES.MAIN}],
routes: [{name: UI_V2 ? 'history' : SEND_ROUTES.MAIN}],
} as any),
)
navigation.navigate(WALLET_ROUTES.TX_HISTORY)
if (!UI_V2) {
navigation.navigate(WALLET_ROUTES.TX_HISTORY)
}
})
}

Expand All @@ -203,7 +205,7 @@ export const ConfirmScreen = () => {
navigation.navigate(SEND_ROUTES.BIOMETRICS_SIGNING, {
keyId: walletManager._id,
onSuccess: async (decryptedKey) => {
navigation.navigate(SEND_ROUTES.CONFIRM)
navigation.navigate(UI_V2 ? 'send-confirm' : SEND_ROUTES.CONFIRM)

await submitTx(signRequest, decryptedKey)
},
Expand Down
3 changes: 2 additions & 1 deletion src/Send/ScannerButton.tsx
Expand Up @@ -6,6 +6,7 @@ import {StyleSheet} from 'react-native'
import iconQR from '../../legacy/assets/img/qr_code.png'
import {pastedFormatter} from '../../legacy/components/Send/amountUtils'
import {Button} from '../../legacy/components/UiKit'
import {UI_V2} from '../../legacy/config/config'
import {SEND_ROUTES} from '../../legacy/RoutesList'

export const ScannerButton = () => {
Expand Down Expand Up @@ -37,7 +38,7 @@ export const ScannerButton = () => {
setAddress(stringQR, route)
setAmount('', route)
}
navigation.navigate(SEND_ROUTES.MAIN)
navigation.navigate(UI_V2 ? 'send' : SEND_ROUTES.MAIN)
},
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/Send/SendScreen/SendScreen.tsx
Expand Up @@ -24,7 +24,7 @@ import {
Text,
TextInput,
} from '../../../legacy/components/UiKit'
import {CONFIG} from '../../../legacy/config/config'
import {CONFIG, UI_V2} from '../../../legacy/config/config'
import {getCardanoNetworkConfigById, isHaskellShelleyNetwork} from '../../../legacy/config/networks'
import {AssetOverflowError, InsufficientFunds} from '../../../legacy/crypto/errors'
import {MultiToken} from '../../../legacy/crypto/MultiToken'
Expand Down Expand Up @@ -200,7 +200,7 @@ export const SendScreen = ({selectedTokenIdentifier, sendAll, onSendAll}: Props)

setShowSendAllWarning(false)

navigation.navigate(SEND_ROUTES.CONFIRM, {
navigation.navigate(UI_V2 ? 'send-confirm' : SEND_ROUTES.CONFIRM, {
availableAmount: tokenBalance.getDefault(),
address,
defaultAssetAmount,
Expand Down
2 changes: 1 addition & 1 deletion src/TxHistory/TxHistoryNavigator.tsx
Expand Up @@ -114,7 +114,7 @@ export const TxHistoryNavigator = () => {
<Stack.Screen name="address-reader-qr" component={AddressReaderQR} options={{title: strings.qrScannerTitle}} />

<Stack.Screen //
name="send-ada-confirm"
name="send-confirm"
component={ConfirmScreen}
options={{title: strings.confirmTitle}}
/>
Expand Down

0 comments on commit dc3982f

Please sign in to comment.