diff --git a/app/containers/Passcode/Base/index.tsx b/app/containers/Passcode/Base/index.tsx index dd1d90e8..c6591770 100644 --- a/app/containers/Passcode/Base/index.tsx +++ b/app/containers/Passcode/Base/index.tsx @@ -20,7 +20,7 @@ interface IPasscodeBase { previousPasscode?: string; title: string; subtitle?: string; - showBiometry?: string; + showBiometry?: boolean; onEndProcess: Function; onError?: Function; onBiometryPress?(): void; diff --git a/app/containers/Passcode/PasscodeEnter.tsx b/app/containers/Passcode/PasscodeEnter.tsx index cc284b24..0a9b6b1f 100644 --- a/app/containers/Passcode/PasscodeEnter.tsx +++ b/app/containers/Passcode/PasscodeEnter.tsx @@ -15,7 +15,7 @@ import I18n from '../../i18n'; interface IPasscodePasscodeEnter { theme: string; - hasBiometry: string; + hasBiometry: boolean; finishProcess: Function; } diff --git a/app/views/ScreenLockedView.js b/app/views/ScreenLockedView.tsx similarity index 76% rename from app/views/ScreenLockedView.js rename to app/views/ScreenLockedView.tsx index 644e76ff..6e20152b 100644 --- a/app/views/ScreenLockedView.js +++ b/app/views/ScreenLockedView.tsx @@ -1,19 +1,25 @@ import React, { useEffect, useState } from 'react'; -import PropTypes from 'prop-types'; import Modal from 'react-native-modal'; import useDeepCompareEffect from 'use-deep-compare-effect'; import isEmpty from 'lodash/isEmpty'; import Orientation from 'react-native-orientation-locker'; -import { withTheme } from '../theme'; +import { useTheme } from '../theme'; import EventEmitter from '../utils/events'; import { LOCAL_AUTHENTICATE_EMITTER } from '../constants/localAuthentication'; import { isTablet } from '../utils/deviceInfo'; import { PasscodeEnter } from '../containers/Passcode'; -const ScreenLockedView = ({ theme }) => { +interface IData { + submit?: () => void; + hasBiometry?: boolean; +} + +const ScreenLockedView = (): JSX.Element => { const [visible, setVisible] = useState(false); - const [data, setData] = useState({}); + const [data, setData] = useState({}); + + const { theme } = useTheme(); useDeepCompareEffect(() => { if (!isEmpty(data)) { @@ -23,7 +29,7 @@ const ScreenLockedView = ({ theme }) => { } }, [data]); - const showScreenLock = args => { + const showScreenLock = (args: IData) => { setData(args); }; @@ -56,13 +62,9 @@ const ScreenLockedView = ({ theme }) => { style={{ margin: 0 }} animationIn='fadeIn' animationOut='fadeOut'> - + ); }; -ScreenLockedView.propTypes = { - theme: PropTypes.string -}; - -export default withTheme(ScreenLockedView); +export default ScreenLockedView;