From e08deb62080e17fe652fa83f60dc81a02c455c41 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Thu, 16 May 2019 11:44:04 +0200 Subject: [PATCH] Fix linting (#787) --- src/components/App/AppLoader.js | 9 ++++++++- src/components/LoadingScreen/LoadingScreen.js | 2 +- .../LocalIdentityModal/LocalIdentityModal.js | 11 ++++++++--- src/hooks.js | 9 ++++++++- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/components/App/AppLoader.js b/src/components/App/AppLoader.js index a9313d187..a4ab8eafd 100644 --- a/src/components/App/AppLoader.js +++ b/src/components/App/AppLoader.js @@ -68,7 +68,14 @@ function useLoadingStatus({ const progress = stepIndex / (loadingSteps.steps.length - 1) setStatus({ label, progress }) - }, [appLoading, appsLoading, daoLoading, loadingSteps, currentAppName]) + }, [ + appLoading, + appsLoading, + daoLoading, + loadingSteps, + currentAppName, + instanceId, + ]) return { label, progress } } diff --git a/src/components/LoadingScreen/LoadingScreen.js b/src/components/LoadingScreen/LoadingScreen.js index d0a4b428a..e46c8c9ea 100644 --- a/src/components/LoadingScreen/LoadingScreen.js +++ b/src/components/LoadingScreen/LoadingScreen.js @@ -22,7 +22,7 @@ const LoadingScreen = React.memo(function LoadingScreen({ setVisible(true) } return () => clearTimeout(timer) - }, [progress]) + }, [progress, visible]) return ( { @@ -30,6 +31,10 @@ const LocalIdentityModal = React.memo( LocalIdentityModal.propTypes = { opened: PropTypes.bool.isRequired, + address: EthereumAddressType, + label: PropTypes.string, + onCancel: PropTypes.func.isRequired, + onSave: PropTypes.func.isRequired, } const Modal = ({ address, label, onCancel, onSave }) => { @@ -104,10 +109,10 @@ const Modal = ({ address, label, onCancel, onSave }) => { } Modal.propTypes = { - address: PropTypes.string, + address: EthereumAddressType, label: PropTypes.string, - onCancel: PropTypes.func, - onSave: PropTypes.func, + onCancel: PropTypes.func.isRequired, + onSave: PropTypes.func.isRequired, } const Error = styled.div` diff --git a/src/hooks.js b/src/hooks.js index 3cc239040..d98331bb8 100644 --- a/src/hooks.js +++ b/src/hooks.js @@ -1,4 +1,11 @@ -import { useCallback, useEffect, useMemo, useReducer, useState, useRef } from 'react' +import { + useCallback, + useEffect, + useMemo, + useReducer, + useState, + useRef, +} from 'react' import keycodes from './keycodes' import { log, removeStartingSlash } from './utils' import { atou } from './string-utils'