fix back button for create screen

This commit is contained in:
Bart Akeley 2020-04-05 12:41:20 -05:00
parent 472da5fb77
commit ea9cfef574

View file

@ -23,7 +23,7 @@ type Props = {
};
const Nav = (props: Props) => {
const { activeTab, setRoute, location } = props;
const { activeTab, setRoute, location, pushRoute } = props;
return (
<View style={uiTheme.listView}>
<View style={{ flex: 1 }}>
@ -60,7 +60,7 @@ const Nav = (props: Props) => {
key="add"
icon="add-circle"
label="Add"
onPress={setRoute(`/createFoodItem?backto=${location.pathname}`)}
onPress={pushRoute(`/createFoodItem?backto=${location.pathname}`)}
style={{
container: {
minWidth: 40,
@ -106,5 +106,8 @@ export default compose(
setRoute: (props: Props) => (route: string) => () => {
props.router.history.replace(route);
},
pushRoute: (props: Props) => (route: string) => () => {
props.router.history.push(route);
},
})
)(Nav);