bugfix: confirm belonging screen bottom padding (#1348)

* fix confirm belonging screen bottom padding

* simplify
This commit is contained in:
Justin Hernandez
2025-11-04 12:56:49 -08:00
committed by GitHub
parent a2c42722bc
commit 337d376a05
2 changed files with 19 additions and 7 deletions

View File

@@ -25,8 +25,8 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.4.0)
aws-partitions (1.1178.0)
aws-sdk-core (3.235.0)
aws-partitions (1.1179.0)
aws-sdk-core (3.236.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
@@ -34,7 +34,7 @@ GEM
bigdecimal
jmespath (~> 1, >= 1.6.1)
logger
aws-sdk-kms (1.115.0)
aws-sdk-kms (1.116.0)
aws-sdk-core (~> 3, >= 3.234.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.202.0)
@@ -245,7 +245,7 @@ GEM
nokogiri (1.18.10)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
optparse (0.6.0)
optparse (0.8.0)
os (1.1.4)
plist (3.7.2)
public_suffix (4.0.7)

View File

@@ -2,8 +2,8 @@
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
import { useCallback, useEffect } from 'react';
import { StyleSheet } from 'react-native';
import { useCallback, useEffect, useMemo } from 'react';
import { Dimensions, StyleSheet } from 'react-native';
import type { DocumentCategory } from '@selfxyz/common/utils/types';
@@ -38,6 +38,18 @@ export const ConfirmIdentificationScreen = ({ onBeforeConfirm }: { onBeforeConfi
await onConfirm(selfClient);
}, [onBeforeConfirm, selfClient]);
// Calculate total bottom padding: base padding + fallback for smaller screens
const paddingBottom = useMemo(() => {
const basePadding = 20;
// Estimate for smaller screens to account for safe areas
const windowHeight = Dimensions.get('window').height;
const isSmallScreen = windowHeight < 900;
const fallbackPadding = isSmallScreen ? 50 : 0;
return basePadding + fallbackPadding;
}, []);
return (
<ExpandableBottomLayout.Layout backgroundColor={black}>
<ExpandableBottomLayout.TopSection backgroundColor={black}>
@@ -50,7 +62,7 @@ export const ConfirmIdentificationScreen = ({ onBeforeConfirm }: { onBeforeConfi
renderMode="HARDWARE"
/>
</ExpandableBottomLayout.TopSection>
<ExpandableBottomLayout.BottomSection gap={20} paddingBottom={20} backgroundColor={white}>
<ExpandableBottomLayout.BottomSection gap={20} paddingBottom={paddingBottom} backgroundColor={white}>
<Title style={{ textAlign: 'center' }}>Confirm your identity</Title>
<Description style={{ textAlign: 'center', paddingBottom: 20 }}>{getPreRegistrationDescription()}</Description>
<PrimaryButton trackEvent={PassportEvents.OWNERSHIP_CONFIRMED} onPress={onPress}>