Browse Source

Fix lint, flow, and comm instanciation

master
meriadec 7 years ago
parent
commit
eadb3dc304
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 4
      src/components/ReceiveModal.js
  2. 4
      src/components/SendModal.js
  3. 2
      src/components/SideBar/Item.js
  4. 6
      src/components/base/Modal.js
  5. 2
      src/internals/usb/wallet.js
  6. 3
      src/reducers/modals.js

4
src/components/ReceiveModal.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
src/components/SendModal.js

@ -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>
}

2
src/components/SideBar/Item.js

@ -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,

6
src/components/base/Modal.js

@ -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 (

2
src/internals/usb/wallet.js

@ -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

3
src/reducers/modals.js

@ -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

Loading…
Cancel
Save