mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
update MenuOption type so nav and onPress are mutually exclusive
This commit is contained in:
@@ -29,16 +29,26 @@ function isDefaultMode( ) {
|
||||
return useStore.getState( ).layout.isDefaultMode === true;
|
||||
}
|
||||
|
||||
export interface MenuOption {
|
||||
interface BaseMenuOption {
|
||||
label: string;
|
||||
navigation?: string;
|
||||
icon: string;
|
||||
color?: string;
|
||||
onPress?: ( ) => void;
|
||||
testID?: string;
|
||||
isLogout?: boolean;
|
||||
}
|
||||
|
||||
interface MenuOptionWithNavigation extends BaseMenuOption {
|
||||
navigation: string;
|
||||
onPress?: never;
|
||||
}
|
||||
|
||||
interface MenuOptionWithOnPress extends BaseMenuOption {
|
||||
onPress: ( ) => void;
|
||||
navigation?: never;
|
||||
}
|
||||
|
||||
export type MenuOption = MenuOptionWithNavigation | MenuOptionWithOnPress;
|
||||
|
||||
const feedbackLogger = log.extend( "feedback" );
|
||||
|
||||
function showOfflineAlert( t: ( _: string ) => string ) {
|
||||
|
||||
Reference in New Issue
Block a user