Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 9b06958

Browse files
authored
Merge pull request #764 from lightninglabs/set-password-mobile
Set password mobile
2 parents 6f0bfde + 8709755 commit 9b06958

23 files changed

+3409
-68
lines changed

mobile/component/font-loader.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ class FontLoader extends React.Component {
3131
'Poppins Bold': require('../../src/asset/font/Poppins-Bold.ttf'),
3232
'Poppins ExtraBold': require('../../src/asset/font/Poppins-ExtraBold.ttf'),
3333
'Poppins Black': require('../../src/asset/font/Poppins-Black.ttf'),
34+
'SF Pro Display Regular': require('../../src/asset/font/SF-Pro-Display-Regular.ttf'),
35+
'SF Pro Text Regular': require('../../src/asset/font/SF-Pro-Text-Regular.ttf'),
36+
'SF Pro Text Medium': require('../../src/asset/font/SF-Pro-Text-Medium.ttf'),
37+
'SF Pro Text SemiBold': require('../../src/asset/font/SF-Pro-Text-SemiBold.ttf'),
38+
'SF Pro Text Bold': require('../../src/asset/font/SF-Pro-Text-Bold.ttf'),
3439
'WorkSans Thin': require('../../src/asset/font/WorkSans-Thin.ttf'),
3540
'WorkSans ExtraLight': require('../../src/asset/font/WorkSans-ExtraLight.ttf'),
3641
'WorkSans Light': require('../../src/asset/font/WorkSans-Light.ttf'),

mobile/main.js

Lines changed: 76 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ import { Clipboard } from 'react-native';
33
import { createStackNavigator } from 'react-navigation';
44
import FontLoader from './component/font-loader';
55

6-
import Home from '../src/view/home';
7-
import Setting from '../src/view/setting';
8-
import SettingUnit from '../src/view/setting-unit';
9-
import SettingFiat from '../src/view/setting-fiat';
10-
import CLI from '../src/view/cli';
11-
import Payment from '../src/view/payment';
12-
import Invoice from '../src/view/invoice';
13-
import InvoiceQR from '../src/view/invoice-qr';
14-
import Deposit from '../src/view/deposit';
6+
import SetPasswordView from '../src/view/set-password-mobile';
7+
import SetPasswordConfirmView from '../src/view/set-password-confirm-mobile';
8+
import SeedSuccessView from '../src/view/seed-success';
9+
import NewAddressView from '../src/view/new-address';
10+
11+
import HomeView from '../src/view/home';
12+
import SettingView from '../src/view/setting';
13+
import SettingUnitView from '../src/view/setting-unit';
14+
import SettingFiatView from '../src/view/setting-fiat';
15+
import CLIView from '../src/view/cli';
16+
import PaymentView from '../src/view/payment';
17+
import InvoiceView from '../src/view/invoice';
18+
import InvoiceQRView from '../src/view/invoice-qr';
19+
import DepositView from '../src/view/deposit';
1520

1621
import sinon from 'sinon';
1722
import { Store } from '../src/store';
@@ -40,7 +45,6 @@ const wallet = new WalletAction(store, grpc, db, nav, notify);
4045
const setting = new SettingAction(store, wallet, db, ipc);
4146
sinon.stub(wallet, 'update');
4247
sinon.stub(wallet, 'checkSeed');
43-
sinon.stub(wallet, 'checkNewPassword');
4448
sinon.stub(wallet, 'checkPassword');
4549
sinon.stub(wallet, 'getExchangeRate');
4650
const transaction = new TransactionAction(store, grpc, nav, notify);
@@ -56,8 +60,26 @@ sinon.stub(channel, 'update');
5660
sinon.stub(channel, 'connectAndOpen');
5761
sinon.stub(channel, 'closeSelectedChannel');
5862

59-
const HomeScreen = () => (
60-
<Home
63+
const SetPassword = () => (
64+
<SetPasswordView store={store} wallet={wallet} nav={nav} />
65+
);
66+
67+
const SetPasswordConfirm = () => (
68+
<SetPasswordConfirmView store={store} wallet={wallet} nav={nav} />
69+
);
70+
71+
const SeedSuccess = () => <SeedSuccessView wallet={wallet} />;
72+
73+
const NewAddress = () => (
74+
<NewAddressView
75+
store={store}
76+
invoice={invoice}
77+
info={{ initLoaderSyncing: () => nav.goHome() }}
78+
/>
79+
);
80+
81+
const Home = () => (
82+
<HomeView
6183
store={store}
6284
wallet={wallet}
6385
channel={channel}
@@ -68,39 +90,47 @@ const HomeScreen = () => (
6890
/>
6991
);
7092

71-
const SettingScreen = () => <Setting store={store} nav={nav} wallet={wallet} />;
93+
const Settings = () => <SettingView store={store} nav={nav} wallet={wallet} />;
7294

73-
const SettingUnitScreen = () => (
74-
<SettingUnit store={store} nav={nav} setting={setting} />
95+
const SettingsUnit = () => (
96+
<SettingUnitView store={store} nav={nav} setting={setting} />
7597
);
7698

77-
const SettingFiatScreen = () => (
78-
<SettingFiat store={store} nav={nav} setting={setting} />
99+
const SettingsFiat = () => (
100+
<SettingFiatView store={store} nav={nav} setting={setting} />
79101
);
80102

81-
const CLIScreen = () => <CLI store={store} nav={nav} />;
103+
const CLI = () => <CLIView store={store} nav={nav} />;
82104

83-
const DepositScreen = () => (
84-
<Deposit store={store} invoice={invoice} nav={nav} />
85-
);
105+
const Deposit = () => <DepositView store={store} invoice={invoice} nav={nav} />;
86106

87-
const InvoiceScreen = () => (
88-
<Invoice store={store} invoice={invoice} nav={nav} />
89-
);
107+
const Invoice = () => <InvoiceView store={store} invoice={invoice} nav={nav} />;
90108

91-
const InvoiceQRScreen = () => (
92-
<InvoiceQR store={store} invoice={invoice} nav={nav} />
109+
const InvoiceQR = () => (
110+
<InvoiceQRView store={store} invoice={invoice} nav={nav} />
93111
);
94112

95-
const PayScreen = () => <Payment store={store} payment={payment} nav={nav} />;
113+
const Pay = () => <PaymentView store={store} payment={payment} nav={nav} />;
114+
115+
const SetupStack = createStackNavigator(
116+
{
117+
SetPassword,
118+
SetPasswordConfirm,
119+
SeedSuccess,
120+
NewAddress,
121+
},
122+
{
123+
headerMode: 'none',
124+
}
125+
);
96126

97127
const MainStack = createStackNavigator(
98128
{
99-
Home: HomeScreen,
100-
Settings: SettingScreen,
101-
SettingsUnit: SettingUnitScreen,
102-
SettingsFiat: SettingFiatScreen,
103-
CLI: CLIScreen,
129+
Home,
130+
Settings,
131+
SettingsUnit,
132+
SettingsFiat,
133+
CLI,
104134
},
105135
{
106136
headerMode: 'none',
@@ -109,8 +139,17 @@ const MainStack = createStackNavigator(
109139

110140
const InvoiceStack = createStackNavigator(
111141
{
112-
Invoice: InvoiceScreen,
113-
InvoiceQR: InvoiceQRScreen,
142+
Invoice,
143+
InvoiceQR,
144+
},
145+
{
146+
headerMode: 'none',
147+
}
148+
);
149+
150+
const PayStack = createStackNavigator(
151+
{
152+
Pay,
114153
},
115154
{
116155
headerMode: 'none',
@@ -119,10 +158,11 @@ const InvoiceStack = createStackNavigator(
119158

120159
const RootStack = createStackNavigator(
121160
{
161+
Setup: SetupStack,
122162
Main: MainStack,
123-
Deposit: DepositScreen,
124-
Pay: PayScreen,
125163
Invoice: InvoiceStack,
164+
Pay: PayStack,
165+
Deposit,
126166
},
127167
{
128168
mode: 'modal',

0 commit comments

Comments
 (0)