meriadec
7 years ago
No known key found for this signature in database
GPG Key ID: 1D2FC2305E2CB399
6 changed files with
15 additions and
6 deletions
-
src/components/ReceiveModal.js
-
src/components/SendModal.js
-
src/components/SideBar/Item.js
-
src/components/base/Modal.js
-
src/internals/usb/wallet.js
-
src/reducers/modals.js
|
|
@ -4,7 +4,9 @@ import React, { PureComponent } from 'react' |
|
|
|
|
|
|
|
import Modal from 'components/base/Modal' |
|
|
|
|
|
|
|
class ReceiveModal extends PureComponent { |
|
|
|
type Props = {} |
|
|
|
|
|
|
|
class ReceiveModal extends PureComponent<Props> { |
|
|
|
render() { |
|
|
|
return <Modal name="receive">receive modal</Modal> |
|
|
|
} |
|
|
|
|
|
@ -4,7 +4,9 @@ import React, { PureComponent } from 'react' |
|
|
|
|
|
|
|
import Modal from 'components/base/Modal' |
|
|
|
|
|
|
|
class SendModal extends PureComponent { |
|
|
|
type Props = {} |
|
|
|
|
|
|
|
class SendModal extends PureComponent<Props> { |
|
|
|
render() { |
|
|
|
return <Modal name="send">send modal</Modal> |
|
|
|
} |
|
|
|
|
|
@ -27,7 +27,7 @@ type Props = { |
|
|
|
openModal: Function, |
|
|
|
} |
|
|
|
|
|
|
|
const mapStateToProps = (state, { modal }) => ({ |
|
|
|
const mapStateToProps = (state, { modal }: any) => ({ |
|
|
|
// connect router here only to make components re-render
|
|
|
|
// see https://github.com/ReactTraining/react-router/issues/4671
|
|
|
|
router: state.router, |
|
|
|
|
|
@ -10,7 +10,7 @@ import styled from 'styled-components' |
|
|
|
import { closeModal, isModalOpened } from 'reducers/modals' |
|
|
|
|
|
|
|
type Props = { |
|
|
|
isOpened: boolean, |
|
|
|
isOpened?: boolean, |
|
|
|
onClose: Function, |
|
|
|
children: any, |
|
|
|
} |
|
|
@ -71,6 +71,10 @@ const Body = styled.div.attrs({ |
|
|
|
` |
|
|
|
|
|
|
|
class Modal extends PureComponent<Props> { |
|
|
|
static defaultProps = { |
|
|
|
isOpened: false, |
|
|
|
} |
|
|
|
|
|
|
|
render() { |
|
|
|
const { isOpened, onClose, children } = this.props |
|
|
|
return ( |
|
|
|
|
|
@ -5,7 +5,7 @@ import Btc from '@ledgerhq/hw-app-btc' |
|
|
|
|
|
|
|
async function getWalletInfos(path, wallet) { |
|
|
|
if (wallet === 'btc') { |
|
|
|
const comm = new CommNodeHid(path, true, 0, false) |
|
|
|
const comm = await CommNodeHid.open(path) |
|
|
|
const btc = new Btc(comm) |
|
|
|
const walletInfos = await btc.getWalletPublicKey(`44'/0'/0'/0`) |
|
|
|
return walletInfos |
|
|
|
|
|
@ -43,7 +43,8 @@ export const closeModal = createAction('MODAL_CLOSE', name => ({ name })) |
|
|
|
|
|
|
|
// Selectors
|
|
|
|
|
|
|
|
export const isModalOpened = (state, name) => state.modals[name] && state.modals[name].isOpened |
|
|
|
export const isModalOpened = (state: Object, name: string) => |
|
|
|
state.modals[name] && state.modals[name].isOpened |
|
|
|
|
|
|
|
// Exporting reducer
|
|
|
|
|
|
|
|