Skip to content

Commit aeb535b

Browse files
committed
fix: hide fee and invoice if keyboard is open
1 parent 1dd0ef7 commit aeb535b

File tree

1 file changed

+40
-28
lines changed

1 file changed

+40
-28
lines changed

src/screens/Wallets/LNURLPay/Confirm.tsx

+40-28
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import React, {
77
} from 'react';
88
import { useTranslation } from 'react-i18next';
99
import { StyleSheet, TouchableOpacity, View } from 'react-native';
10+
import { FadeIn, FadeOut } from 'react-native-reanimated';
1011

1112
import AmountToggle from '../../../components/AmountToggle';
1213
import Biometrics from '../../../components/Biometrics';
@@ -16,6 +17,7 @@ import LightningSyncing from '../../../components/LightningSyncing';
1617
import SafeAreaInset from '../../../components/SafeAreaInset';
1718
import SwipeToConfirm from '../../../components/SwipeToConfirm';
1819
import useColors from '../../../hooks/colors';
20+
import useKeyboard, { Keyboard } from '../../../hooks/keyboard';
1921
import { useAppDispatch, useAppSelector } from '../../../hooks/redux';
2022
import type { SendScreenProps } from '../../../navigation/types';
2123
import {
@@ -25,7 +27,7 @@ import {
2527
} from '../../../store/reselect/settings';
2628
import { addPendingPayment } from '../../../store/slices/lightning';
2729
import { EActivityType } from '../../../store/types/activity';
28-
import { BottomSheetTextInput } from '../../../styles/components';
30+
import { AnimatedView, BottomSheetTextInput } from '../../../styles/components';
2931
import { Checkmark, LightningHollow } from '../../../styles/icons';
3032
import { BodySSB, Caption13Up } from '../../../styles/text';
3133
import { FeeText } from '../../../utils/fees';
@@ -34,7 +36,6 @@ import {
3436
payLightningInvoice,
3537
} from '../../../utils/lightning';
3638
import { handleLnurlPay } from '../../../utils/lnurl';
37-
import { Keyboard } from '../../../hooks/keyboard';
3839

3940
const Section = memo(
4041
({
@@ -67,6 +68,7 @@ const LNURLConfirm = ({
6768
}: SendScreenProps<'LNURLConfirm'>): ReactElement => {
6869
const { t } = useTranslation('wallet');
6970
const { amount, pParams, url } = route.params;
71+
const { keyboardShown } = useKeyboard();
7072
const dispatch = useAppDispatch();
7173
const pin = useAppSelector(pinSelector);
7274
const pinForPayments = useAppSelector(pinForPaymentsSelector);
@@ -183,33 +185,43 @@ const LNURLConfirm = ({
183185
onPress={fixedAmount ? undefined : handleGoBack}
184186
/>
185187

186-
<View style={styles.sectionContainer}>
187-
<Section
188-
title={t('send_invoice')}
189-
value={
190-
<BodySSB numberOfLines={1} ellipsizeMode="middle">
191-
{url}
192-
</BodySSB>
193-
}
194-
/>
195-
</View>
188+
{!keyboardShown && (
189+
<AnimatedView
190+
style={styles.sectionContainer}
191+
entering={FadeIn}
192+
exiting={FadeOut}>
193+
<Section
194+
title={t('send_invoice')}
195+
value={
196+
<BodySSB numberOfLines={1} ellipsizeMode="middle">
197+
{url}
198+
</BodySSB>
199+
}
200+
/>
201+
</AnimatedView>
202+
)}
196203

197-
<View style={styles.sectionContainer}>
198-
<Section
199-
title={t('send_fee_and_speed')}
200-
value={
201-
<>
202-
<LightningHollow
203-
style={styles.icon}
204-
color="purple"
205-
height={16}
206-
width={16}
207-
/>
208-
<BodySSB>{FeeText.instant.title} (±$0.01)</BodySSB>
209-
</>
210-
}
211-
/>
212-
</View>
204+
{!keyboardShown && (
205+
<AnimatedView
206+
style={styles.sectionContainer}
207+
entering={FadeIn}
208+
exiting={FadeOut}>
209+
<Section
210+
title={t('send_fee_and_speed')}
211+
value={
212+
<>
213+
<LightningHollow
214+
style={styles.icon}
215+
color="purple"
216+
height={16}
217+
width={16}
218+
/>
219+
<BodySSB>{FeeText.instant.title} (±$0.01)</BodySSB>
220+
</>
221+
}
222+
/>
223+
</AnimatedView>
224+
)}
213225

214226
{pParams.commentAllowed > 0 && (
215227
<View style={styles.sectionContainer}>

0 commit comments

Comments
 (0)