mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-04 04:13:49 +01:00
ADD: useExtendedNavigation Generics
This commit is contained in:
parent
294fa4e930
commit
6cc7fbf0ab
1 changed files with 6 additions and 4 deletions
|
@ -5,15 +5,13 @@ import { presentWalletExportReminder } from '../helpers/presentWalletExportRemin
|
|||
import { useBiometrics } from './useBiometrics';
|
||||
|
||||
// List of screens that require biometrics
|
||||
|
||||
const requiresBiometrics = ['WalletExportRoot', 'WalletXpubRoot', 'ViewEditMultisigCosignersRoot', 'ExportMultisigCoordinationSetupRoot'];
|
||||
|
||||
// List of screens that require wallet export to be saved
|
||||
|
||||
const requiresWalletExportIsSaved = ['ReceiveDetailsRoot', 'WalletAddresses'];
|
||||
|
||||
export const useExtendedNavigation = (): NavigationProp<ParamListBase> => {
|
||||
const originalNavigation = useNavigation<NavigationProp<ParamListBase>>();
|
||||
export const useExtendedNavigation = <T extends NavigationProp<ParamListBase>>(): T => {
|
||||
const originalNavigation = useNavigation<T>();
|
||||
const { wallets, saveToDisk } = useStorage();
|
||||
const { isBiometricUseEnabled, unlockWithBiometrics } = useBiometrics();
|
||||
|
||||
|
@ -95,3 +93,7 @@ export const useExtendedNavigation = (): NavigationProp<ParamListBase> => {
|
|||
navigate: enhancedNavigate,
|
||||
};
|
||||
};
|
||||
|
||||
// Usage example:
|
||||
// type NavigationProps = NativeStackNavigationProp<SendDetailsStackParamList, 'SendDetails'>;
|
||||
// const navigation = useExtendedNavigation<NavigationProps>();
|
||||
|
|
Loading…
Add table
Reference in a new issue