mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-23 07:15:35 +01:00
Merge pull request #4525 from BlueWallet/ismodal
REF: Use builtin nav state for modal detection
This commit is contained in:
commit
3d9701d786
3 changed files with 7 additions and 6 deletions
|
@ -213,7 +213,6 @@ export const TransactionListItem = React.memo(({ item, itemPriceUnit = BitcoinUn
|
|||
navigate('LNDViewInvoice', {
|
||||
invoice: item,
|
||||
walletID: lightningWallet[0].getID(),
|
||||
isModal: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -228,7 +228,6 @@ const LNDCreateInvoice = () => {
|
|||
navigate('LNDViewInvoice', {
|
||||
invoice: invoiceRequest,
|
||||
walletID: wallet.current.getID(),
|
||||
isModal: true,
|
||||
});
|
||||
} catch (Err) {
|
||||
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
|
||||
|
@ -531,7 +530,7 @@ const styles = StyleSheet.create({
|
|||
});
|
||||
|
||||
export default LNDCreateInvoice;
|
||||
|
||||
LNDCreateInvoice.routeName = 'LNDCreateInvoice';
|
||||
LNDCreateInvoice.navigationOptions = navigationStyle(
|
||||
{
|
||||
closeButton: true,
|
||||
|
|
|
@ -4,7 +4,7 @@ import Share from 'react-native-share';
|
|||
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
|
||||
import { Icon } from 'react-native-elements';
|
||||
import QRCodeComponent from '../../components/QRCodeComponent';
|
||||
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
|
||||
import { useNavigation, useNavigationState, useRoute, useTheme } from '@react-navigation/native';
|
||||
import {
|
||||
BlueLoading,
|
||||
BlueText,
|
||||
|
@ -19,9 +19,10 @@ import loc from '../../loc';
|
|||
import { BlueStorageContext } from '../../blue_modules/storage-context';
|
||||
import { BitcoinUnit } from '../../models/bitcoinUnits';
|
||||
import { SuccessView } from '../send/success';
|
||||
import LNDCreateInvoice from './lndCreateInvoice';
|
||||
|
||||
const LNDViewInvoice = () => {
|
||||
const { invoice, walletID, isModal } = useRoute().params;
|
||||
const { invoice, walletID } = useRoute().params;
|
||||
const { wallets, setSelectedWallet, fetchAndSaveWalletTransactions } = useContext(BlueStorageContext);
|
||||
const wallet = wallets.find(w => w.getID() === walletID);
|
||||
const { colors, closeImage } = useTheme();
|
||||
|
@ -31,6 +32,8 @@ const LNDViewInvoice = () => {
|
|||
const [invoiceStatusChanged, setInvoiceStatusChanged] = useState(false);
|
||||
const [qrCodeSize, setQRCodeSize] = useState(90);
|
||||
const fetchInvoiceInterval = useRef();
|
||||
const isModal = useNavigationState(state => state.routeNames[0] === LNDCreateInvoice.routeName);
|
||||
|
||||
const stylesHook = StyleSheet.create({
|
||||
root: {
|
||||
backgroundColor: colors.background,
|
||||
|
@ -59,7 +62,7 @@ const LNDViewInvoice = () => {
|
|||
|
||||
useEffect(() => {
|
||||
setOptions(
|
||||
isModal === true
|
||||
isModal
|
||||
? {
|
||||
headerStyle: {
|
||||
borderBottomWidth: 0,
|
||||
|
|
Loading…
Add table
Reference in a new issue