Skip to content
Merged
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
21 changes: 11 additions & 10 deletions src/pages/settings/Security/TwoFactorAuth/CodesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import Clipboard from '../../../../libs/Clipboard';
import themeColors from '../../../../styles/themes/default';
import localFileDownload from '../../../../libs/localFileDownload';
import * as TwoFactorAuthActions from '../../../../libs/actions/TwoFactorAuthActions';
import * as StyleUtils from '../../../../styles/StyleUtils';

const propTypes = {
...withLocalizePropTypes,
Expand Down Expand Up @@ -67,7 +68,7 @@ function CodesPage(props) {
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_SECURITY)}
/>
<FullPageOfflineBlockingView>
<ScrollView contentContainerStyle={styles.flex1}>
<ScrollView>
<Section
title={props.translate('twoFactorAuth.keepCodesSafe')}
icon={Illustrations.ShieldYellow}
Expand Down Expand Up @@ -95,7 +96,7 @@ function CodesPage(props) {
</Text>
))}
</View>
<View style={styles.twoFactorAuthCodesButtonsContainer}>
<View style={[styles.twoFactorAuthCodesButtonsContainer, StyleUtils.getWrappingStyle(props.isExtraSmallScreenWidth)]}>
<PressableWithDelayToggle
text={props.translate('twoFactorAuth.copyCodes')}
icon={Expensicons.Copy}
Expand Down Expand Up @@ -123,15 +124,15 @@ function CodesPage(props) {
)}
</View>
</Section>
<FixedFooter style={[styles.twoFactorAuthFooter]}>
<Button
success
text={props.translate('common.next')}
onPress={() => Navigation.navigate(ROUTES.SETTINGS_2FA_VERIFY)}
isDisabled={isNextButtonDisabled}
/>
</FixedFooter>
</ScrollView>
<FixedFooter style={[styles.mtAuto, styles.pt2]}>
<Button
Comment thread
thiagobrez marked this conversation as resolved.
success
text={props.translate('common.next')}
onPress={() => Navigation.navigate(ROUTES.SETTINGS_2FA_VERIFY)}
isDisabled={isNextButtonDisabled}
/>
</FixedFooter>
</FullPageOfflineBlockingView>
</ScreenWrapper>
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/Security/TwoFactorAuth/VerifyPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function VerifyPage(props) {
<TwoFactorAuthForm />
</View>
</ScrollView>
<FixedFooter style={[styles.twoFactorAuthFooter]}>
<FixedFooter style={[styles.mtAuto, styles.pt2]}>
<Button
success
text={props.translate('common.next')}
Expand Down
12 changes: 12 additions & 0 deletions src/styles/StyleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,17 @@ function getOuterModalStyle(windowHeight, viewportOffsetTop) {
return Browser.isMobile() ? {maxHeight: windowHeight, marginTop: viewportOffsetTop} : {};
}

/**
* Returns style object for flexWrap depending on the screen size
* @param {Boolean} isExtraSmallScreenWidth
* @return {Object}
*/
function getWrappingStyle(isExtraSmallScreenWidth) {
return {
flexWrap: isExtraSmallScreenWidth ? 'wrap' : 'nowrap',
};
}
Comment thread
thiagobrez marked this conversation as resolved.

export {
getAvatarSize,
getAvatarStyle,
Expand Down Expand Up @@ -1250,4 +1261,5 @@ export {
getMentionTextColor,
getHeightOfMagicCodeInput,
getOuterModalStyle,
getWrappingStyle,
};
4 changes: 0 additions & 4 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2228,10 +2228,6 @@ const styles = {
minWidth: 100,
},

twoFactorAuthFooter: {
marginTop: 'auto',
},

anonymousRoomFooter: {
flexDirection: 'row',
alignItems: 'center',
Expand Down
4 changes: 4 additions & 0 deletions src/styles/utilities/spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ export default {
marginTop: 44,
},

mtAuto: {
marginTop: 'auto',
},

mb0: {
marginBottom: 0,
},
Expand Down