Skip to content

Commit f2f4174

Browse files
committed
fix(suite-native): fw install alert layout shift
1 parent c117c18 commit f2f4174

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

suite-native/firmware/src/components/DoNotCloseAppBottomSheetTrigger.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,44 @@
1+
import { FadeInDown, FadeOutDown } from 'react-native-reanimated';
2+
13
import {
4+
AnimatedBox,
25
BottomSheetModal,
3-
Box,
46
Button,
57
InlineAlertBox,
68
Text,
79
VStack,
810
useBottomSheetModal,
911
} from '@suite-native/atoms';
1012
import { Translation } from '@suite-native/intl';
13+
import { prepareNativeStyle, useNativeStyles } from '@trezor/styles';
1114

1215
type DoNotCloseAppBottomSheetTriggerProps = {
1316
isTriggerDisplayed: boolean;
1417
};
1518

19+
const triggerStyle = prepareNativeStyle(utils => ({
20+
position: 'absolute',
21+
bottom: 0,
22+
width: '100%',
23+
alignItems: 'center',
24+
justifyContent: 'center',
25+
marginBottom: utils.spacings.sp32,
26+
}));
27+
1628
export const DoNotCloseAppBottomSheetTrigger = ({
1729
isTriggerDisplayed,
1830
}: DoNotCloseAppBottomSheetTriggerProps) => {
1931
const { bottomSheetRef, openModal, closeModal } = useBottomSheetModal();
32+
const { applyStyle } = useNativeStyles();
2033

2134
return (
2235
<>
2336
{isTriggerDisplayed && (
24-
<Box marginBottom="sp32" alignItems="center" justifyContent="center">
37+
<AnimatedBox
38+
entering={FadeInDown}
39+
exiting={FadeOutDown}
40+
style={applyStyle(triggerStyle)}
41+
>
2542
<InlineAlertBox
2643
variant="info"
2744
title={
@@ -32,7 +49,7 @@ export const DoNotCloseAppBottomSheetTrigger = ({
3249
}
3350
onButtonPress={openModal}
3451
/>
35-
</Box>
52+
</AnimatedBox>
3653
)}
3754
<BottomSheetModal ref={bottomSheetRef} paddingHorizontal="sp24">
3855
<VStack spacing="sp24" paddingBottom="sp24">

0 commit comments

Comments
 (0)