Skip to content

Commit

Permalink
fix(app): loose bottom navigation bar (#546)
Browse files Browse the repository at this point in the history
* fix(app): loose bottom navigation bar

* chore: hop

* fix: add navigators where needed

Co-authored-by: Arnaud AMBROSELLI <arnaud.ambroselli@yahoo.fr>
  • Loading branch information
rap2hpoutre and Arnaud AMBROSELLI authored Apr 1, 2022
1 parent 6c0c40d commit 97c23cd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
13 changes: 11 additions & 2 deletions app/src/Navigators.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ const ActionsNavigator = () => {
<ActionsStack.Screen name="Action" component={Action} />
<ActionsStack.Screen name="NewActionForm" component={NewActionForm} />
<ActionsStack.Screen name="ActionComment" component={Comment} />

<ActionsStack.Screen name="Person" component={Person} />
<ActionsStack.Screen name="PersonsSearch" component={PersonsSearch} />
<ActionsStack.Screen name="PersonsOutOfActiveListReason" component={PersonsOutOfActiveListReason} />
<ActionsStack.Screen name="PersonPlace" component={Place} />
<ActionsStack.Screen name="NewPersonPlaceForm" component={NewPlaceForm} />
<ActionsStack.Screen name="PersonComment" component={Comment} />
</ActionsStack.Navigator>
);
};
Expand All @@ -66,6 +73,10 @@ const PersonsNavigator = () => {
<PersonsStack.Screen name="PersonPlace" component={Place} />
<PersonsStack.Screen name="NewPersonPlaceForm" component={NewPlaceForm} />
<PersonsStack.Screen name="PersonComment" component={Comment} />

<PersonsStack.Screen name="Action" component={Action} />
<PersonsStack.Screen name="NewActionForm" component={NewActionForm} />
<PersonsStack.Screen name="ActionComment" component={Comment} />
</PersonsStack.Navigator>
);
};
Expand Down Expand Up @@ -210,8 +221,6 @@ const App = () => {
<AppStack.Navigator headerMode="none" initialRouteName="LoginStack" screenOptions={{ gestureEnabled: false }}>
<AppStack.Screen name="LoginStack" component={LoginNavigator} />
<AppStack.Screen name="Home" component={TabNavigator} />
<AppStack.Screen name="Persons" component={PersonsNavigator} />
<AppStack.Screen name="Actions" component={ActionsNavigator} />
</AppStack.Navigator>
<Loader />
<EnvironmentIndicator />
Expand Down
6 changes: 1 addition & 5 deletions app/src/scenes/Actions/Action.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,7 @@ const Action = ({ navigation, route }) => {
]);
};

const onSearchPerson = () =>
navigation.push('Persons', {
screen: 'PersonsSearch',
params: { fromRoute: 'Action' },
});
const onSearchPerson = () => navigation.push('PersonsSearch', { fromRoute: 'Action' });

const handleBeforeRemove = (e) => {
if (backRequestHandledRef.current === true) return;
Expand Down
5 changes: 1 addition & 4 deletions app/src/scenes/Actions/ActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ const ActionsList = () => {
const onPseudoPress = useCallback(
(person) => {
Sentry.setContext('person', { _id: person._id });
navigation.push('Persons', {
screen: 'Person',
params: { ...person, fromRoute: 'ActionsList' },
});
navigation.push('Person', { ...person, fromRoute: 'ActionsList' });
},
[navigation]
);
Expand Down
6 changes: 1 addition & 5 deletions app/src/scenes/Actions/NewActionForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ const NewActionForm = ({ route, navigation }) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [navigation, route?.params?.person]);

const onSearchPerson = () =>
navigation.push('Persons', {
screen: 'PersonsSearch',
params: { fromRoute: 'NewActionForm' },
});
const onSearchPerson = () => navigation.push('PersonsSearch', { fromRoute: 'NewActionForm' });

const onCreateAction = async () => {
setPosting(true);
Expand Down
10 changes: 2 additions & 8 deletions app/src/scenes/Persons/PersonSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ const PersonSummary = ({
};

const onAddActionRequest = () => {
navigation.push('Actions', {
screen: 'NewActionForm',
params: { person: personDB?._id, fromRoute: 'Person' },
});
navigation.push('NewActionForm', { fromRoute: 'Person', person: personDB?._id });
};

const scrollViewRef = useRef(null);
Expand Down Expand Up @@ -141,10 +138,7 @@ const PersonSummary = ({
const onActionPress = useCallback(
(action) => {
Sentry.setContext('action', { _id: action._id });
navigation.push('Actions', {
screen: 'Action',
params: { _id: action._id, fromRoute: 'Person' },
});
navigation.push('Action', { _id: action._id, fromRoute: 'Person' });
},
[navigation]
);
Expand Down

0 comments on commit 97c23cd

Please sign in to comment.