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

Commit 8770fd8

Browse files
committed
Wire up file-mobile action in app
1 parent a5bebfc commit 8770fd8

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

src/action/index-mobile.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import GrpcAction from './grpc-mobile';
2929
import NavAction from './nav-mobile';
3030
import WalletAction from './wallet';
3131
import LogAction from './log';
32+
import FileAction from './file-mobile';
3233
import InfoAction from './info';
3334
import NotificationAction from './notification';
3435
import ChannelAction from './channel';
@@ -48,10 +49,11 @@ store.init(); // initialize computed values
4849
export const db = new AppStorage(store, AsyncStorage);
4950
export const grpc = new GrpcAction(store, NativeModules, NativeEventEmitter);
5051
export const ipc = new IpcAction(grpc);
51-
export const log = new LogAction(store, ipc, false, RNFS, Share);
52+
export const file = new FileAction(store, RNFS, Share);
53+
export const log = new LogAction(store, ipc, false);
5254
export const nav = new NavAction(store, NavigationActions, StackActions);
5355
export const notify = new NotificationAction(store, nav);
54-
export const wallet = new WalletAction(store, grpc, db, nav, notify, RNFS);
56+
export const wallet = new WalletAction(store, grpc, db, nav, notify, file);
5557
export const info = new InfoAction(store, grpc, nav, notify);
5658
export const transaction = new TransactionAction(store, grpc, nav, notify);
5759
export const channel = new ChannelAction(store, grpc, nav, notify);

src/view/cli.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import Text from '../component/text';
88
import { BackButton, ShareButton, Button } from '../component/button';
99
import { createStyles, maxWidth } from '../component/media-query';
1010
import { color, font, breakWidth } from '../component/style';
11-
import { shareLogs } from '../action/log';
1211

1312
//
1413
// CLI View
@@ -20,15 +19,15 @@ const styles = StyleSheet.create({
2019
},
2120
});
2221

23-
const CLIView = ({ store, nav }) => (
22+
const CLIView = ({ store, nav, file }) => (
2423
<SplitBackground color={color.blackDark} bottom={color.cliBackground}>
2524
<Header separator style={styles.header}>
2625
<BackButton onPress={() => nav.goSettings()} />
2726
<Title title="Logs" />
2827
{Platform.OS === 'web' ? (
2928
<Button onPress={() => {}} />
3029
) : (
31-
<ShareButton onPress={() => shareLogs()} />
30+
<ShareButton onPress={() => file.shareLogs()} />
3231
)}
3332
</Header>
3433
<LogOutput logs={store.logs} />
@@ -38,6 +37,7 @@ const CLIView = ({ store, nav }) => (
3837
CLIView.propTypes = {
3938
store: PropTypes.object.isRequired,
4039
nav: PropTypes.object.isRequired,
40+
file: PropTypes.object,
4141
};
4242

4343
//

src/view/main-mobile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import {
6161
info,
6262
auth,
6363
autopilot,
64+
file,
6465
} from '../action/index-mobile';
6566

6667
import store from '../store';
@@ -137,7 +138,7 @@ const SettingsFiat = () => (
137138
<SettingFiatView store={store} nav={nav} setting={setting} />
138139
);
139140

140-
const CLI = () => <CLIView store={store} nav={nav} />;
141+
const CLI = () => <CLIView store={store} nav={nav} file={file} />;
141142

142143
const Notifications = () => <NotificationView store={store} nav={nav} />;
143144

stories/screen-story.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import PaymentAction from '../src/action/payment';
1717
import ChannelAction from '../src/action/channel';
1818
import TransactionAction from '../src/action/transaction';
1919
import AuthAction from '../src/action/auth-mobile';
20+
import FileAction from '../src/action/file-mobile';
2021
import AtplAction from '../src/action/autopilot';
2122
import Welcome from '../src/view/welcome';
2223
import Transaction from '../src/view/transaction';
@@ -90,6 +91,7 @@ import RestoreSeedMobile from '../src/view/restore-seed-mobile';
9091

9192
const store = new Store();
9293
store.init();
94+
const file = sinon.createStubInstance(FileAction);
9395
const nav = sinon.createStubInstance(NavAction);
9496
const db = sinon.createStubInstance(AppStorage);
9597
const ipc = sinon.createStubInstance(IpcAction);
@@ -218,7 +220,7 @@ storiesOf('Screens', module)
218220
.add('Notifications (Mobile)', () => (
219221
<NotificationMobile store={store} nav={nav} />
220222
))
221-
.add('CLI', () => <CLI store={store} nav={nav} />)
223+
.add('CLI', () => <CLI store={store} nav={nav} file={file} />)
222224
.add('Transactions', () => (
223225
<Transaction store={store} transaction={transaction} nav={nav} />
224226
))

0 commit comments

Comments
 (0)