-
Notifications
You must be signed in to change notification settings - Fork 295
/
WalletWithNavigation.tsx
79 lines (72 loc) · 2.13 KB
/
WalletWithNavigation.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// @flow
import React, { Component } from 'react';
import type { Node } from 'react';
import classnames from 'classnames';
import { observer } from 'mobx-react';
import WalletNavigation from '../navigation/WalletNavigation';
import styles from './WalletWithNavigation.scss';
import NotResponding from '../not-responding/NotResponding';
import SetWalletPassword from '../settings/SetWalletPassword';
type Props = {
children?: Node,
activeItem: string,
hasNotification?: boolean,
hasPassword: boolean,
isActiveScreen: Function,
isLegacy: boolean,
isNotResponding: boolean,
isHardwareWallet: boolean,
isSetWalletPasswordDialogOpen: boolean,
onOpenExternalLink: Function,
onRestartNode: Function,
onSetWalletPassword: Function,
onWalletNavItemClick: Function,
};
@observer
export default class WalletWithNavigation extends Component<Props> {
render() {
const {
children,
activeItem,
hasNotification,
hasPassword,
isActiveScreen,
isLegacy,
isNotResponding,
isHardwareWallet,
isSetWalletPasswordDialogOpen,
onOpenExternalLink,
onRestartNode,
onSetWalletPassword,
onWalletNavItemClick,
} = this.props;
const componentStyles = classnames([styles.component, styles[activeItem]]);
return (
<div className={componentStyles}>
<div className={styles.navigation}>
<WalletNavigation
isActiveNavItem={isActiveScreen}
isLegacy={isLegacy}
onNavItemClick={onWalletNavItemClick}
activeItem={activeItem}
hasNotification={hasNotification}
/>
</div>
<div className={styles.page}>{children}</div>
{!hasPassword && !isHardwareWallet && (
<SetWalletPassword
isSetWalletPasswordDialogOpen={isSetWalletPasswordDialogOpen}
onSetWalletPassword={onSetWalletPassword}
/>
)}
{isNotResponding && (
<NotResponding
walletName={activeItem}
onRestartNode={onRestartNode}
onOpenExternalLink={onOpenExternalLink}
/>
)}
</div>
);
}
}