diff --git a/src/components/CounterValue/stories.js b/src/components/CounterValue/stories.js
index ef479cbf..8a5bce2b 100644
--- a/src/components/CounterValue/stories.js
+++ b/src/components/CounterValue/stories.js
@@ -12,5 +12,6 @@ const stories = storiesOf('Components', module)
const currency = getCryptoCurrencyById('bitcoin')
stories.add('CounterValue', () => (
+ // $FlowFixMe
))
diff --git a/src/components/SettingsPage/sections/Tools.js b/src/components/SettingsPage/sections/Tools.js
index a860a370..71d2a89e 100644
--- a/src/components/SettingsPage/sections/Tools.js
+++ b/src/components/SettingsPage/sections/Tools.js
@@ -20,7 +20,7 @@ class TabProfile extends PureComponent<*, *> {
this.setState({ qrcodeMobileExportModal: false })
}
- renderQRCodeModal = ({ onClose }: *) => (
+ renderQRCodeModal = ({ onClose }: any) => (
{'QRCode Mobile Export'}
diff --git a/src/components/base/Button/index.js b/src/components/base/Button/index.js
index b66fc1f1..dc7f2515 100644
--- a/src/components/base/Button/index.js
+++ b/src/components/base/Button/index.js
@@ -11,7 +11,9 @@ import { focusedShadowStyle } from 'components/base/Box/Tabbable'
import Spinner from 'components/base/Spinner'
-const buttonStyles = {
+type Style = any // FIXME
+
+const buttonStyles: { [_: string]: Style } = {
default: {
default: noop,
active: noop,
diff --git a/src/components/base/Modal/index.js b/src/components/base/Modal/index.js
index d005b33e..5d95bdff 100644
--- a/src/components/base/Modal/index.js
+++ b/src/components/base/Modal/index.js
@@ -28,11 +28,26 @@ const springConfig = {
stiffness: 320,
}
-const mapStateToProps: Function = (
- state,
- { name, isOpened, onBeforeOpen }: { name: string, isOpened?: boolean, onBeforeOpen: Function },
-): * => {
- const data = getModalData(state, name)
+type OwnProps = {
+ name?: string, // eslint-disable-line
+ isOpened?: boolean,
+ onBeforeOpen?: ({ data: * }) => *, // eslint-disable-line
+ onClose?: () => void,
+ onHide?: () => void,
+ preventBackdropClick?: boolean,
+ render: Function,
+ refocusWhenChange?: string,
+}
+
+type Props = OwnProps & {
+ isOpened?: boolean,
+ data?: any,
+} & {
+ onClose?: () => void,
+}
+
+const mapStateToProps = (state, { name, isOpened, onBeforeOpen }: OwnProps): * => {
+ const data = getModalData(state, name || '')
const modalOpened = isOpened || (name && isModalOpened(state, name))
if (onBeforeOpen && modalOpened) {
@@ -40,12 +55,12 @@ const mapStateToProps: Function = (
}
return {
- isOpened: modalOpened,
+ isOpened: !!modalOpened,
data,
}
}
-const mapDispatchToProps: Function = (dispatch, { name, onClose = noop }): * => ({
+const mapDispatchToProps = (dispatch: *, { name, onClose = noop }: OwnProps): * => ({
onClose: name
? () => {
dispatch(closeModal(name))
@@ -104,21 +119,9 @@ class Pure extends Component {
}
}
-type Props = {
- data?: any,
- isOpened: boolean,
- onClose?: Function,
- onHide?: Function,
- preventBackdropClick: boolean,
- render: Function,
- refocusWhenChange?: string,
-}
-
export class Modal extends Component {
static defaultProps = {
- data: undefined,
isOpened: false,
- onClose: noop,
onHide: noop,
preventBackdropClick: false,
}
diff --git a/src/logger.js b/src/logger.js
index 0dd9df43..02d290fe 100644
--- a/src/logger.js
+++ b/src/logger.js
@@ -79,9 +79,10 @@ export default {
},
// tracks keyboard events
- onTabKey: activeElement => {
+ onTabKey: (activeElement: ?HTMLElement) => {
+ if (!activeElement) return
const { classList, tagName } = activeElement
- const displayEl = `${tagName.toLowerCase()}${classList.length ? ` ${classList[0]}` : ''}`
+ const displayEl = `${tagName.toLowerCase()}${classList.length ? ` ${classList.item(0)}` : ''}`
const msg = `⇓ - active element ${displayEl}`
if (logTabkey) {
console.log(msg)