-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update header with new UI #312
Conversation
const handleDetailsPress = React.useCallback(() => { | ||
navigation.navigate('ObservationDetails', {question: 1}); | ||
}, [navigation]); | ||
// const handleDetailsPress = React.useCallback(() => { | ||
// navigation.navigate('ObservationDetails', {question: 1}); | ||
// }, [navigation]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be added really soon, so just commented out for linting purposes
editDeviceInfoMutation.mutate, | ||
editDeviceInfoMutation.isPending, | ||
editDeviceInfoMutation, | ||
nameHasChanges, | ||
errorModal.openSheet, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was not playing well with the linter, so i just added the entire object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you extract the field first and use that, it should work e.g.
const {openSheet} = useBottomSheetModal({openOnMount: false});
i think adding the whole object is not desirable (in theory) because the effect will run if when one of its fields changes (e.g. isOpen
). maybe it's not a big issue in practice though 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of non-blocking comments but otherwise lgtm
}, | ||
{ | ||
onPress: closeSheet, | ||
text: formatMessage(m.discardCancel), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Seeing the cancel action copy of Continue editing
seems a little off when you're on the category chooser screen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im going to leave this because we are planning on updating all the copy at a later time, so that can be dealt with then
editDeviceInfoMutation.mutate, | ||
editDeviceInfoMutation.isPending, | ||
editDeviceInfoMutation, | ||
nameHasChanges, | ||
errorModal.openSheet, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you extract the field first and use that, it should work e.g.
const {openSheet} = useBottomSheetModal({openOnMount: false});
i think adding the whole object is not desirable (in theory) because the effect will run if when one of its fields changes (e.g. isOpen
). maybe it's not a big issue in practice though 🤷
Updated the header in creating/editting an observation to include new save button. Also replaces the native toast with a modal for confirming whether user wants to discard changes when trying to leave the edit screen.