Skip to content

Commit da9cc7f

Browse files
authored
chore: merge from develop to preview (#4423)
2 parents 0c81927 + dfa3b6b commit da9cc7f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

mobile/src/features/Swap/useCases/ListOrders/ListOrders.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import {isLeft, parseNumberFromText, truncateString} from '@yoroi/common'
33
import {infoExtractName} from '@yoroi/portfolio'
44
import {atoms as a, useTheme} from '@yoroi/theme'
55
import {Api, Portfolio, Swap} from '@yoroi/types'
6-
import {useSelectedWallet} from '@yoroi/wallet-manager'
7-
import {useWalletManager} from '@yoroi/wallet-manager'
6+
import {useSelectedWallet, useWalletManager} from '@yoroi/wallet-manager'
87

98
import * as React from 'react'
109
import {ErrorBoundary} from 'react-error-boundary'

mobile/src/ui/ModalError/ModalError.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {View} from 'react-native'
1313
import {useStrings} from '~/kernel/i18n/useStrings'
1414
import {Button, ButtonType} from '~/ui/Button/Button'
1515
import {Icon} from '~/ui/Icon'
16+
import {useModal} from '~/ui/Modal/context/ModalContext'
1617
import {Space} from '~/ui/Space/Space'
1718
import {Text} from '~/ui/Text/Text'
1819

@@ -25,8 +26,17 @@ type Props = {
2526
export const ModalError = ({error, resetErrorBoundary, onCancel}: Props) => {
2627
const strings = useStrings()
2728
const {palette: p} = useTheme()
29+
const {closeModal} = useModal()
2830
const message = getErrorMessage(error, strings)
2931

32+
const handleCancel = React.useCallback(() => {
33+
if (onCancel) {
34+
onCancel()
35+
} else {
36+
closeModal()
37+
}
38+
}, [onCancel, closeModal])
39+
3040
return (
3141
<>
3242
<View style={[a.flex_grow, a.align_center, a.justify_center]}>
@@ -49,8 +59,9 @@ export const ModalError = ({error, resetErrorBoundary, onCancel}: Props) => {
4959
<Button
5060
size="S"
5161
type={ButtonType.Secondary}
52-
onPress={onCancel}
62+
onPress={handleCancel}
5363
title={strings.global.cancel}
64+
disabled={false}
5465
/>
5566

5667
<Space.Width.lg />

0 commit comments

Comments
 (0)