This repository was archived by the owner on Feb 23, 2021. It is now read-only.
File tree 11 files changed +36
-16
lines changed
11 files changed +36
-16
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ class NavAction {
96
96
this . _reset ( 'Main' , 'LoaderSyncing' ) ;
97
97
}
98
98
99
- goWait ( ) {
99
+ goWait ( { copy = 'Loading network...' } ) {
100
+ this . _store . waitScreenCopy = copy ;
100
101
this . _navigate ( 'Wait' ) ;
101
102
}
102
103
Original file line number Diff line number Diff line change @@ -69,7 +69,8 @@ class NavAction {
69
69
this . _store . route = 'LoaderSyncing' ;
70
70
}
71
71
72
- goWait ( ) {
72
+ goWait ( { copy = 'Loading network...' } ) {
73
+ this . _store . waitScreenCopy = copy ;
73
74
this . _store . route = 'Wait' ;
74
75
}
75
76
Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ class PaymentAction {
265
265
msg : 'Sending transaction timed out!' ,
266
266
} ) ;
267
267
} , PAYMENT_TIMEOUT ) ;
268
- this . _nav . goWait ( ) ;
268
+ this . _nav . goWait ( { copy : 'Sending payment...' } ) ;
269
269
try {
270
270
await this . _sendPayment ( ) ;
271
271
this . _nav . goPayBitcoinDone ( ) ;
@@ -302,7 +302,7 @@ class PaymentAction {
302
302
this . _nav . goPaymentFailed ( ) ;
303
303
} , PAYMENT_TIMEOUT ) ;
304
304
try {
305
- this . _nav . goWait ( ) ;
305
+ this . _nav . goWait ( { copy : 'Sending payment...' } ) ;
306
306
const invoice = this . _store . payment . address ;
307
307
const stream = this . _grpc . sendStreamCommand ( 'sendPayment' ) ;
308
308
await new Promise ( ( resolve , reject ) => {
Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ class WalletAction {
247
247
this . initResetPassword ( ) ;
248
248
return this . _notification . display ( { msg : errorMsg } ) ;
249
249
}
250
- this . _nav . goWait ( ) ;
250
+ this . _nav . goWait ( { copy : 'Updating password...' } ) ;
251
251
await this . resetPassword ( {
252
252
currentPassword : password ,
253
253
newPassword : newPassword ,
@@ -396,7 +396,7 @@ class WalletAction {
396
396
*/
397
397
async unlockWallet ( { walletPassword } ) {
398
398
try {
399
- this . _nav . goWait ( ) ;
399
+ this . _nav . goWait ( { } ) ;
400
400
await this . _grpc . sendUnlockerCommand ( 'UnlockWallet' , {
401
401
walletPassword : toBuffer ( walletPassword ) ,
402
402
recoveryWindow : this . _store . settings . restoring ? 250 : 0 ,
@@ -465,7 +465,7 @@ class WalletAction {
465
465
if ( this . _store . walletAddress ) {
466
466
this . _nav . goNewAddress ( ) ;
467
467
} else {
468
- this . _nav . goWait ( ) ;
468
+ this . _nav . goWait ( { } ) ;
469
469
when ( ( ) => this . _store . walletAddress , ( ) => this . _nav . goNewAddress ( ) ) ;
470
470
}
471
471
}
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ export class Store {
89
89
notifications : [ ] ,
90
90
unseenNtfnCount : 0 ,
91
91
logs : '' ,
92
+ waitScreenCopy : 'Loading network...' ,
92
93
93
94
// Persistent data
94
95
settings : {
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ const ResetPasswordSaved = () => <ResetPinSavedView nav={nav} />;
111
111
112
112
const LoaderSyncing = ( ) => < LoaderSyncingView store = { store } /> ;
113
113
114
- const Wait = ( ) => < WaitView /> ;
114
+ const Wait = ( ) => < WaitView store = { store } /> ;
115
115
116
116
const Home = ( ) => (
117
117
< HomeView
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ class MainView extends Component {
99
99
< NewAddress store = { store } invoice = { invoice } info = { info } />
100
100
) }
101
101
{ route === 'LoaderSyncing' && < LoaderSyncing store = { store } /> }
102
- { route === 'Wait' && < Wait /> }
102
+ { route === 'Wait' && < Wait store = { store } /> }
103
103
{ route === 'Home' && (
104
104
< Home
105
105
store = { store }
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { StyleSheet , ActivityIndicator } from 'react-native' ;
3
+ import PropTypes from 'prop-types' ;
3
4
import Background from '../component/background' ;
4
5
import MainContent from '../component/main-content' ;
5
6
import Text from '../component/text' ;
@@ -19,17 +20,21 @@ const styles = StyleSheet.create({
19
20
} ,
20
21
} ) ;
21
22
22
- const WaitView = ( ) => (
23
+ const WaitView = ( { store } ) => (
23
24
< Background color = { color . blackDark } >
24
25
< MainContent style = { styles . content } >
25
26
< ActivityIndicator
26
27
size = "large"
27
28
color = { color . lightPurple }
28
29
style = { styles . spinner }
29
30
/>
30
- < Text style = { styles . copy } > Loading network... </ Text >
31
+ < Text style = { styles . copy } > { store . waitScreenCopy } </ Text >
31
32
</ MainContent >
32
33
</ Background >
33
34
) ;
34
35
36
+ WaitView . propTypes = {
37
+ store : PropTypes . object . isRequired ,
38
+ } ;
39
+
35
40
export default WaitView ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { StyleSheet } from 'react-native' ;
3
+ import PropTypes from 'prop-types' ;
3
4
import Background from '../component/background' ;
4
5
import MainContent from '../component/main-content' ;
5
6
import { color } from '../component/style' ;
@@ -11,12 +12,16 @@ const styles = StyleSheet.create({
11
12
} ,
12
13
} ) ;
13
14
14
- const WaitView = ( ) => (
15
+ const WaitView = ( { store } ) => (
15
16
< Background color = { color . blackDark } >
16
17
< MainContent style = { styles . content } >
17
- < ContinuousLoadNetworkSpinner msg = "Loading network..." />
18
+ < ContinuousLoadNetworkSpinner msg = { store . waitScreenCopy } />
18
19
</ MainContent >
19
20
</ Background >
20
21
) ;
21
22
23
+ WaitView . propTypes = {
24
+ store : PropTypes . object . isRequired ,
25
+ } ;
26
+
22
27
export default WaitView ;
Original file line number Diff line number Diff line change @@ -192,8 +192,8 @@ storiesOf('Screens', module)
192
192
. add ( 'Loader - Syncing Chain (Mobile)' , ( ) => (
193
193
< LoaderSyncingMobile store = { store } />
194
194
) )
195
- . add ( 'Wait' , ( ) => < Wait /> )
196
- . add ( 'Wait (Mobile)' , ( ) => < WaitMobile /> )
195
+ . add ( 'Wait' , ( ) => < Wait store = { store } /> )
196
+ . add ( 'Wait (Mobile)' , ( ) => < WaitMobile store = { store } /> )
197
197
. add ( 'Home' , ( ) => (
198
198
< Home
199
199
store = { store }
Original file line number Diff line number Diff line change @@ -97,9 +97,16 @@ describe('Action Nav Unit Tests', () => {
97
97
98
98
describe ( 'goWait()' , ( ) => {
99
99
it ( 'should set correct route' , ( ) => {
100
- nav . goWait ( ) ;
100
+ nav . goWait ( { } ) ;
101
101
expect ( store . route , 'to equal' , 'Wait' ) ;
102
102
} ) ;
103
+
104
+ it ( 'should set correct copy' , ( ) => {
105
+ const testCopy = 'foobar' ;
106
+ nav . goWait ( { copy : testCopy } ) ;
107
+ expect ( store . route , 'to equal' , 'Wait' ) ;
108
+ expect ( store . waitScreenCopy , 'to equal' , testCopy ) ;
109
+ } ) ;
103
110
} ) ;
104
111
105
112
describe ( 'goHome()' , ( ) => {
You can’t perform that action at this time.
0 commit comments