@@ -10,7 +10,6 @@ import {
10
10
TouchableOpacity ,
11
11
TouchableOpacityProps ,
12
12
useWindowDimensions ,
13
- useWindowDimensions ,
14
13
View ,
15
14
ViewProps ,
16
15
} from 'react-native'
@@ -40,7 +39,6 @@ import {useSelectedWallet} from '../../../../WalletManager/common/hooks/useSelec
40
39
import { CollateralInfoModal } from './CollateralInfoModal'
41
40
import { createCollateralEntry } from './helpers'
42
41
import { InitialCollateralInfoModal } from './InitialCollateralInfoModal'
43
- import { InitialCollateralInfoModal } from './InitialCollateralInfoModal'
44
42
import { useNavigateTo } from './navigation'
45
43
import { useStrings } from './strings'
46
44
@@ -51,19 +49,15 @@ export const ManageCollateralScreen = () => {
51
49
meta : { addressMode} ,
52
50
} = useSelectedWallet ( )
53
51
const screenHeight = useWindowDimensions ( ) . height
54
- const screenHeight = useWindowDimensions ( ) . height
55
52
const { amount, collateralId, utxo} = useCollateralInfo ( wallet )
56
53
const hasCollateral = collateralId !== '' && utxo !== undefined
57
54
const didSpend = collateralId !== '' && utxo === undefined
58
55
const navigateTo = useNavigateTo ( )
59
56
const { openModal} = useModal ( )
60
- const { openModal} = useModal ( )
61
57
const strings = useStrings ( )
62
58
const balances = useBalances ( wallet )
63
59
const { navigateToTxReview} = useWalletNavigation ( )
64
60
const { unsignedTxChanged, onSuccessChanged, onErrorChanged, operationsChanged} = useReviewTx ( )
65
- const { navigateToTxReview} = useWalletNavigation ( )
66
- const { unsignedTxChanged, onSuccessChanged, onErrorChanged, operationsChanged} = useReviewTx ( )
67
61
const lockedAmount = asQuantity ( wallet . primaryBreakdown . lockedAsStorageCost . toString ( ) )
68
62
69
63
const params = useUnsafeParams < SettingsStackRoutes [ 'manage-collateral' ] > ( )
@@ -94,16 +88,6 @@ export const ManageCollateralScreen = () => {
94
88
navigateTo . failedTx ( )
95
89
}
96
90
97
- const onSuccess = ( signedTx : YoroiSignedTx ) => {
98
- navigateTo . submittedTx ( )
99
- const collateralId = `${ signedTx . signedTx . id } :0`
100
- setCollateralId ( collateralId )
101
- }
102
-
103
- const onError = ( ) => {
104
- navigateTo . failedTx ( )
105
- }
106
-
107
91
const createCollateralTransaction = ( ) => {
108
92
LayoutAnimation . configureNext ( LayoutAnimation . Presets . easeInEaseOut )
109
93
@@ -158,14 +142,6 @@ export const ManageCollateralScreen = () => {
158
142
)
159
143
}
160
144
161
- const handleCollateralInfoModal = ( ) => {
162
- openModal (
163
- strings . initialCollateralInfoModalTitle ,
164
- < InitialCollateralInfoModal onConfirm = { handleGenerateCollateral } /> ,
165
- Math . min ( screenHeight * 0.9 , 650 ) ,
166
- )
167
- }
168
-
169
145
const shouldShowPrimaryButton = ! hasCollateral || didSpend
170
146
const shouldShowBackButton = ! shouldShowPrimaryButton && ! ! params ?. backButton
171
147
@@ -212,7 +188,6 @@ export const ManageCollateralScreen = () => {
212
188
< Button
213
189
title = { strings . generateCollateral }
214
190
onPress = { handleCollateralInfoModal }
215
- onPress = { handleCollateralInfoModal }
216
191
shelleyTheme
217
192
disabled = { isLoading }
218
193
/>
@@ -291,30 +266,7 @@ const Operation = () => {
291
266
)
292
267
}
293
268
294
- const Operation = ( ) => {
295
- const { styles, colors} = useStyles ( )
296
- const strings = useStrings ( )
297
- const { openModal} = useModal ( )
298
-
299
- const handleOnPressInfo = ( ) => {
300
- openModal ( strings . collateralInfoModalTitle , < CollateralInfoModal /> , 500 )
301
- }
302
-
303
- return (
304
- < View style = { styles . operation } >
305
- < Text style = { styles . operationText } > { strings . collateralInfoModalLabel } </ Text >
306
-
307
- < Space width = "xs" />
308
-
309
- < TouchableOpacity onPress = { handleOnPressInfo } >
310
- < Info size = { 24 } color = { colors . iconColor } />
311
- </ TouchableOpacity >
312
- </ View >
313
- )
314
- }
315
-
316
269
const useStyles = ( ) => {
317
- const { color, atoms} = useTheme ( )
318
270
const { color, atoms} = useTheme ( )
319
271
const styles = StyleSheet . create ( {
320
272
safeAreaView : {
@@ -345,19 +297,10 @@ const useStyles = () => {
345
297
...atoms . body_2_md_regular ,
346
298
color : color . text_gray_medium ,
347
299
} ,
348
- operation : {
349
- ...atoms . flex_row ,
350
- ...atoms . align_center ,
351
- } ,
352
- operationText : {
353
- ...atoms . body_2_md_regular ,
354
- color : color . text_gray_medium ,
355
- } ,
356
300
} )
357
301
358
302
const colors = {
359
303
iconColor : color . gray_900 ,
360
- iconColor : color . gray_900 ,
361
304
}
362
305
363
306
return { styles, colors} as const
0 commit comments