Skip to content
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

Allow adding an observation from anywhere the NavBar is visible #462

Closed
Tracked by #464
kueda opened this issue Feb 10, 2023 · 5 comments
Closed
Tracked by #464

Allow adding an observation from anywhere the NavBar is visible #462

kueda opened this issue Feb 10, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@kueda
Copy link
Member

kueda commented Feb 10, 2023

Currently you get a navigation error any time you do this from outside My Observations. If the NavBar is visible, tapping all the buttons in the AddEvidenceModal should work.

This will probably be pretty disruptive since it will involve rethinking how we've organized our navigators (it's not clear to me why we have multiple in the first place).

@kueda kueda added the bug Something isn't working label Feb 10, 2023
@kueda kueda mentioned this issue Feb 11, 2023
16 tasks
@kueda kueda added this to the StandardCamera UI milestone Feb 11, 2023
@Chrischuck
Copy link
Contributor

I can take a look at this later today. Will probably get a proposal first in this issue thread before doing any real coding since, like you said, looks pretty involved.

@Chrischuck
Copy link
Contributor

Briefly looking, I think it's reasonable and a pretty common pattern to have two navigators (one drawer, one stack)

I think one possible solution might look like the following in a sub stack (mainStackNavigation, projectStackNavigation, etc.)

import SharedStackScreens from './SharedStackScreens'
    <Stack.Navigator screenOptions={showHeader}>
      <Stack.Screen
        name="StandardCamera"
        component={StandardCameraWithPermission}
        options={{ ...hideHeader, orientation: isTablet ? "all" : "portrait" }}
      />
    {SharedStackScreens}
    ...

I haven't written any code yet so I'm not sure if there will be any mismatched state issues...

@Chrischuck
Copy link
Contributor

Above did not work...Looks like the lowest barrier to entry is simply specifying which stack you want to navigate to. Like: navigation.navigate( "MainStack", { screen, ...params } ); Though I'm trying to find a clean way to do this

@Chrischuck
Copy link
Contributor

Looks like an issue many have had with react navigation. See here

implemented a solution like this one

It seems to work fairly well. Able to go from ProjectDetails to ObsEdit and back to the project you were viewing (if you discard the observation you are editing)

@albullington
Copy link
Collaborator

Closed via #507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants