mirror of
https://gitlab.com/wheres-the-tp/ui-mobile.git
synced 2026-01-25 04:24:56 -06:00
fix back button for create screen
This commit is contained in:
parent
472da5fb77
commit
ea9cfef574
1 changed files with 5 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue