Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDW-131] Connecting a hardware wallet #2016

Merged
merged 33 commits into from
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6057418
[DDW-131] - Connecting a hardware wallet
DeeJayElly May 19, 2020
6770c53
[DDW-131] - Connecting a hardware wallet - fixing lint/flow issues
DeeJayElly May 19, 2020
ea2fbf0
[DDW-131] - Connecting a hardware wallet - adding translations + scss…
DeeJayElly May 20, 2020
6d86016
[DDW-131] - Connecting a hardware wallet
DeeJayElly May 20, 2020
b1fcba9
[DDW-131] - Connecting a hardware wallet
DeeJayElly May 20, 2020
b27b73f
[DDW-131] - Connecting a hardware wallet
DeeJayElly May 20, 2020
af67e65
[DDW-131] - Connecting a hardware wallet
DeeJayElly May 20, 2020
e22e50a
[DDW-131] - Connecting a hardware wallet
DeeJayElly May 20, 2020
70ba9a0
[DDW-131] - Connecting a hardware wallet - adding storybook items
DeeJayElly May 21, 2020
9eb9cac
Merge branch 'develop' into feature/ddw-131-connecting-a-hardware-wallet
DeeJayElly May 21, 2020
8e60206
[DDW-131] - Connecting a hardware wallet - adding storybook items
DeeJayElly May 21, 2020
62dd6f3
[DDW-131] - Connecting a hardware wallet - fixing issues
DeeJayElly May 21, 2020
3b7682b
[DDW-131] - Connecting a hardware wallet - fixing issues
DeeJayElly May 21, 2020
513f7f9
[DDW-131] - Connecting a hardware wallet - fixing issues
DeeJayElly May 21, 2020
87e7bf8
[DDW-131] - Connecting a hardware wallet - fixing issues
DeeJayElly May 21, 2020
1fd2ed4
[DDW-131] - Connecting a hardware wallet - fixing issues
DeeJayElly May 21, 2020
cb658ca
[DDW-131] - Connecting a hardware wallet - fixing issues
DeeJayElly May 23, 2020
8b23d3d
[DDW-131] - Connecting a hardware wallet - fixing issues
DeeJayElly May 24, 2020
43d0cc7
[DDW-131] - Connecting a hardware wallet - fixing issues
DeeJayElly May 24, 2020
ac958a1
[DDW-131] - Connecting a hardware wallet - fixing issues
DeeJayElly May 24, 2020
5292c7f
[DDW-131] - Connecting a hardware wallet - fixing issues
DeeJayElly May 24, 2020
4f92d0e
[DDW-131] - Connecting a hardware wallet - fixing issues
DeeJayElly May 25, 2020
1538188
[DDW-131] - Connecting a hardware wallet - flow issues
DeeJayElly May 25, 2020
171e606
[DDW-131] - Connecting a hardware wallet - flow issues
DeeJayElly May 25, 2020
2d705b7
[DDW-131] - Connecting a hardware wallet - flow issues
DeeJayElly May 25, 2020
4eddf9c
[DDW-131] - Connecting a hardware wallet - flow issues
DeeJayElly May 25, 2020
d706b9d
[DDW-131] - Connecting a hardware wallet - flow issues
DeeJayElly May 26, 2020
502754f
[DDW-131] - Connecting a hardware wallet - flow issues
DeeJayElly May 26, 2020
84917c1
[DDW-131] - Connecting a hardware wallet - flow issues
DeeJayElly May 26, 2020
6850fe9
[DDW-131] - Connecting a hardware wallet - flow issues
DeeJayElly May 26, 2020
2d45eef
[DDW-131] - Connecting a hardware wallet - flow issues
DeeJayElly May 26, 2020
440b035
[DDW-131] - Connecting a hardware wallet - flow issues
DeeJayElly May 26, 2020
47cd1bc
Merge branch 'develop' into feature/ddw-131-connecting-a-hardware-wallet
nikolaglumac May 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ Changelog

## vNext

### Features

- Implemented Hardware wallets connection screens ([PR 2016](https://github.com/input-output-hk/daedalus/pull/2016))

### Fixes

- Eenabled the Recovery Phrase Verification feature of Shelley wallets on ITN ([PR 2008](https://github.com/input-output-hk/daedalus/pull/2008))
- Enabled the Recovery Phrase Verification feature of Shelley wallets on ITN ([PR 2008](https://github.com/input-output-hk/daedalus/pull/2008))
- Disabled button on forms when there is nothing to submit ([PR 1998](https://github.com/input-output-hk/daedalus/pull/1998), [PR 2010](https://github.com/input-output-hk/daedalus/pull/2010))
- Fixed system locale detection ([PR 2009](https://github.com/input-output-hk/daedalus/pull/2009))

Expand Down
7 changes: 7 additions & 0 deletions source/renderer/app/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import StakingInfoPage from './containers/staking/StakingInfoPage';
import StakingRewardsPage from './containers/staking/StakingRewardsPage';
import StakePoolsListPage from './containers/staking/StakePoolsListPage';
import StakingCountdownPage from './containers/staking/StakingCountdownPage';
import HardwareWallet from './containers/hardware-wallet/HardwareWallet';
import Wallet from './containers/wallet/Wallet';
import WalletAddPage from './containers/wallet/WalletAddPage';
import WalletSummaryPage from './containers/wallet/WalletSummaryPage';
Expand Down Expand Up @@ -54,6 +55,12 @@ export const Routes = (
<Route path={ROUTES.WALLETS.SETTINGS} component={WalletSettingsPage} />
<Route path={ROUTES.WALLETS.UTXO} component={WalletUtxoPage} />
</Route>
<Route path={ROUTES.HARDWARE_WALLETS.ROOT} component={HardwareWallet}>
<Route
path={ROUTES.HARDWARE_WALLETS.SUMMARY}
component={WalletSummaryPage}
/>
</Route>
<Route path={ROUTES.SETTINGS.ROOT} component={Settings}>
<IndexRedirect to={ROUTES.SETTINGS.GENERAL} />
<Route path={ROUTES.SETTINGS.GENERAL} component={GeneralSettingsPage} />
Expand Down
1 change: 1 addition & 0 deletions source/renderer/app/actions/sidebar-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ export default class SidebarActions {
showSubMenu?: boolean,
}> = new Action();
walletSelected: Action<{ walletId: string }> = new Action();
hardwareWalletSelected: Action<{ walletId: string }> = new Action();
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// @flow
import React, { Component } from 'react';
import type { Node } from 'react';
import { observer } from 'mobx-react';
import HardwareWalletNavigation from '../navigation/HardwareWalletNavigation';
import styles from './HardwareWalletWithNavigation.scss';
import ConnectHardwareWallet from '../settings/ConnectHardwareWallet';

type Props = {
children?: Node,
activeItem: string,
hasNotification?: boolean,
walletNotConnected: boolean,
isActiveScreen: Function,
onOpenExternalLink: Function,
onWalletNavItemClick: Function,
isLedger: boolean,
isTrezor: boolean,
isDeviceConnected: boolean,
fetchingDevice: boolean,
exportingExtendedPublicKey: boolean,
isExportingPublicKeyAborted: boolean,
};

@observer
export default class HardwareWalletWithNavigation extends Component<Props> {
render() {
const {
children,
activeItem,
hasNotification,
walletNotConnected,
isActiveScreen,
onWalletNavItemClick,
onOpenExternalLink,
isLedger,
isTrezor,
isDeviceConnected,
fetchingDevice,
exportingExtendedPublicKey,
isExportingPublicKeyAborted,
} = this.props;

return (
<div className={styles.component}>
{walletNotConnected ? (
<ConnectHardwareWallet
onOpenExternalLink={onOpenExternalLink}
isLedger={isLedger}
isTrezor={isTrezor}
nikolaglumac marked this conversation as resolved.
Show resolved Hide resolved
isDeviceConnected={isDeviceConnected}
fetchingDevice={fetchingDevice}
exportingExtendedPublicKey={exportingExtendedPublicKey}
isExportingPublicKeyAborted={isExportingPublicKeyAborted}
/>
) : (
<div className={styles.navigation}>
<HardwareWalletNavigation
isActiveNavItem={isActiveScreen}
onNavItemClick={onWalletNavItemClick}
activeItem={activeItem}
hasNotification={hasNotification}
/>
</div>
)}

<div className={styles.page}>{children}</div>
</div>
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.component {
display: flex;
flex: 1;
flex-direction: column;
overflow-y: overlay;
}

.navigation {
flex-shrink: 0;
height: 50px;
position: relative;
}

.page {
align-items: center;
display: flex;
height: calc(100% - 50px);
justify-content: center;
overflow: overlay;
position: relative;

> div {
width: 100%;
}
}

.settingsTabPage {
overflow: hidden;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// @flow
import React, { Component } from 'react';
import { observer } from 'mobx-react';
import { includes } from 'lodash';
import { defineMessages, intlShape } from 'react-intl';
import {
WALLET_NAV_IDS,
ITN_LEGACY_WALLET_EXCLUDED_NAV_ITEMS,
} from '../../../config/walletNavigationConfig';
import Navigation from '../../navigation/Navigation';
import summaryIcon from '../../../assets/images/wallet-nav/summary-ic.inline.svg';
import type {
NavButtonProps,
NavDropdownProps,
} from '../../navigation/Navigation';

const messages = defineMessages({
summary: {
id: 'wallet.navigation.summary',
defaultMessage: '!!!Summary',
description: 'Label for the "Summary" nav button in the wallet navigation.',
},
});

type Props = {
activeItem: string,
isActiveNavItem: Function,
onNavItemClick: Function,
};

@observer
export default class WalletNavigation extends Component<Props> {
static contextTypes = {
intl: intlShape.isRequired,
};

render() {
const { isActiveNavItem, onNavItemClick, activeItem } = this.props;
const { intl } = this.context;
const { isIncentivizedTestnet } = global;
const items: Array<NavButtonProps | NavDropdownProps> = [
{
id: WALLET_NAV_IDS.SUMMARY,
label: intl.formatMessage(messages.summary),
icon: summaryIcon,
},
].filter(
item =>
!(
isIncentivizedTestnet &&
includes(ITN_LEGACY_WALLET_EXCLUDED_NAV_ITEMS, item.id)
)
);
return (
<>
{activeItem ? (
<Navigation
activeItem={activeItem}
isActiveNavItem={isActiveNavItem}
onNavItemClick={onNavItemClick}
items={items}
/>
) : null}
</>
);
}
}
Loading