Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/containers/TwoFactor/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { AccessibilityInfo, Text, View } from 'react-native';
import { AccessibilityInfo, Text, View, useWindowDimensions } from 'react-native';
import isEmpty from 'lodash/isEmpty';
import { sha256 } from 'js-sha256';
import Modal from 'react-native-modal';
Expand Down Expand Up @@ -66,6 +66,7 @@ const TwoFactor = React.memo(() => {
code: yup.string().required(I18n.t('Code_required'))
});
const { colors } = useTheme();
const { height: deviceHeight, width: deviceWidth } = useWindowDimensions();
const { isMasterDetail } = useAppSelector(state => ({
isMasterDetail: state.app.isMasterDetail as boolean
}));
Expand Down Expand Up @@ -152,6 +153,9 @@ const TwoFactor = React.memo(() => {
const color = colors.fontTitlesLabels;
return (
<Modal
deviceHeight={deviceHeight}
deviceWidth={deviceWidth}
style={styles.modal}
customBackdrop={<View aria-hidden style={[styles.overlay, { backgroundColor: colors.overlayBackground }]} />}
avoidKeyboard
useNativeDriver
Expand Down
5 changes: 5 additions & 0 deletions app/containers/TwoFactor/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
padding: 16
},
content: {
Expand Down Expand Up @@ -51,5 +52,9 @@ export default StyleSheet.create({
},
containerInput: {
marginBottom: 0
},
modal: {
margin: 0,
justifyContent: 'center'
}
});