Browse Source

flow

master
meriadec 7 years ago
parent
commit
3cb3d742d4
No known key found for this signature in database GPG Key ID: C9A285535CC6EA7D
  1. 16
      src/actions/devices.js
  2. 4
      src/components/SideBar.js
  3. 4
      src/components/TopBar.js
  4. 2
      src/globals.js
  5. 2
      src/main/ledger.js
  6. 6
      src/types/common.js

16
src/actions/devices.js

@ -1,19 +1,23 @@
// @flow
// eslint-disable import/prefer-default-export // eslint-disable import/prefer-default-export
export const devicesUpdate = payload => dispatch => import type { Device } from 'types/common'
dispatch({
type devicesUpdateType = (Array<Device>) => { type: string, payload: Array<Device> }
export const devicesUpdate: devicesUpdateType = payload => ({
type: 'DEVICES_UPDATE', type: 'DEVICES_UPDATE',
payload, payload,
}) })
export const deviceAdd = payload => dispatch => type devicesAddType = Device => { type: string, payload: Device }
dispatch({ export const deviceAdd: devicesAddType = payload => ({
type: 'DEVICE_ADD', type: 'DEVICE_ADD',
payload, payload,
}) })
export const deviceRemove = payload => dispatch => type devicesRemoveType = Device => { type: string, payload: Device }
dispatch({ export const deviceRemove: devicesRemoveType = payload => ({
type: 'DEVICE_REMOVE', type: 'DEVICE_REMOVE',
payload, payload,
}) })

4
src/components/SideBar.js

@ -1,8 +1,10 @@
// @flow
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import Box from 'components/base/Box' import Box from 'components/base/Box'
class SideBar extends PureComponent { class SideBar extends PureComponent<{}> {
render() { render() {
return ( return (
<Box bg="night" py={3} noShrink style={{ width: 250 }}> <Box bg="night" py={3} noShrink style={{ width: 250 }}>

4
src/components/TopBar.js

@ -1,8 +1,10 @@
// @flow
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import Box from 'components/base/Box' import Box from 'components/base/Box'
class TopBar extends PureComponent { class TopBar extends PureComponent<{}> {
render() { render() {
return ( return (
<Box bg="white" noShrink style={{ height: 60 }}> <Box bg="white" noShrink style={{ height: 60 }}>

2
src/globals.js

@ -1,3 +1,5 @@
// @flow
const { NODE_ENV } = process.env const { NODE_ENV } = process.env
global.__ENV__ = NODE_ENV || 'development' global.__ENV__ = NODE_ENV || 'development'

2
src/main/ledger.js

@ -1,3 +1,5 @@
// @flow
import { ipcMain } from 'electron' import { ipcMain } from 'electron'
import { isLedgerDevice } from 'ledgerco/lib/utils' import { isLedgerDevice } from 'ledgerco/lib/utils'

6
src/types/common.js

@ -0,0 +1,6 @@
// @flow
export type Device = {
vendorId: string,
productId: string,
}
Loading…
Cancel
Save