Changeset View
Changeset View
Standalone View
Standalone View
native/roles/change-roles-header-left-button.react.js
Show All 25 Lines | const onCancel = React.useCallback(() => { | ||||
if (selectedRole === memberRole) { | if (selectedRole === memberRole) { | ||||
onPress(); | onPress(); | ||||
return; | return; | ||||
} | } | ||||
Alert.alert( | Alert.alert( | ||||
'Discard changes?', | 'Discard changes?', | ||||
'You have unsaved changes which will be discarded if you navigate away', | 'You have unsaved changes which will be discarded if you navigate away.', | ||||
[ | [ | ||||
{ text: 'Leave', onPress }, | { text: 'Leave', onPress }, | ||||
{ text: 'Stay', style: 'cancel' }, | { text: 'Stay', style: 'cancel' }, | ||||
], | ], | ||||
); | ); | ||||
}, [memberRole, props, selectedRole]); | }, [memberRole, props, selectedRole]); | ||||
const { panelForegroundSecondaryLabel } = useColors(); | const { panelForegroundSecondaryLabel } = useColors(); | ||||
Show All 16 Lines |