diff --git a/app/containers/Passcode/Base/Button.tsx b/app/containers/Passcode/Base/Button.tsx index b768fb50c..28e9a7234 100644 --- a/app/containers/Passcode/Base/Button.tsx +++ b/app/containers/Passcode/Base/Button.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Text } from 'react-native'; +import { Text, StyleProp, ViewStyle } from 'react-native'; import styles from './styles'; import { themes } from '../../../lib/constants'; @@ -12,16 +12,17 @@ interface IPasscodeButton { icon?: TIconsName; disabled?: boolean; onPress?: Function; + style?: StyleProp; } -const Button = React.memo(({ text, disabled, onPress, icon }: IPasscodeButton) => { +const Button = React.memo(({ style, text, disabled, onPress, icon }: IPasscodeButton) => { const { theme } = useTheme(); const press = () => onPress && onPress(text); return ( ( ({ type, onEndProcess, previousPasscode, title, subtitle, onError, showBiometry, onBiometryPress }, ref) => { + useLayoutEffect(() => { + if (!isTablet) { + Orientation.lockToPortrait(); + } + + return () => { + if (!isTablet) { + Orientation.unlockAllOrientations(); + } + }; + }, []); + const { theme } = useTheme(); + const { height } = useDimensions(); + + // 206 is the height of the header calculating the margins, icon size height, title font size and subtitle height. + // 56 is a fixed number to decrease the height of button numbers. + const dinamicHeight = (height - 206 - 56) / 4; + const heightButtonRow = { height: dinamicHeight > 102 ? 102 : dinamicHeight }; const rootRef = useRef(null); const dotsRef = useRef(null); @@ -103,40 +124,40 @@ const Base = forwardRef( - + {range(1, 4).map(i => ( - -