-
Notifications
You must be signed in to change notification settings - Fork 0
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
Poc/bottom tab cleanups #142
Conversation
import NAVIGATORS from '@src/NAVIGATORS'; | ||
import {isFullScreenName} from './isNavigatorName'; | ||
|
||
// This function adds the policyID param to the url. | ||
const customGetPathFromState: typeof getPathFromState = (state, options) => { |
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.
Doesn't it break anything? I mean not stripping the policyID
@@ -1,6 +1,10 @@ | |||
import type {NavigationState, PartialState} from '@react-navigation/native'; | |||
import SCREENS from '@src/SCREENS'; | |||
|
|||
/** | |||
* When we open the application via deeplink to a specific onboarding screen, we want the previous onboarding screens to be able to go back to them. | |||
* Therefore, the paths of the previous screens are added here. |
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.
Probably routes not paths
|
||
/** | ||
* returns policyID value if one exists in navigation state | ||
* | ||
* PolicyID in this app can be stored in two ways: | ||
* - on most screens but NOT Search as `policyID` param (on bottom tab screens) | ||
* - on NAVIGATORS.REPORTS_SPLIT_NAVIGATOR as `policyID` param |
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.
Hmm what about the WorkspaceSplitNavigator?
|
||
type State = NavigationState | NavigationState<RootStackParamList> | PartialState<NavigationState>; | ||
type ReportParam = 'reportID' | 'reportActionID'; | ||
|
||
function getTopmostReportParam(state: State, reportParam: ReportParam): string | undefined { |
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.
Hm actually can't we get the whole params instead of a specific one? Sounds like unecessary additional logic.
then we could do getTopmostReportParam(state).reportID
or getTopmostReportParam(state)?.reportActionID
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.
Or maybe getTopmostReportRoute that return whole route with proper type assertion
const SPLIT_NAVIGATORS = [NAVIGATORS.WORKSPACE_SPLIT_NAVIGATOR, NAVIGATORS.REPORTS_SPLIT_NAVIGATOR, NAVIGATORS.SETTINGS_SPLIT_NAVIGATOR]; | ||
const FULL_SCREENS = [...SPLIT_NAVIGATORS, SCREENS.SEARCH.CENTRAL_PANE]; | ||
const SIDEBARS = [SCREENS.HOME, SCREENS.SETTINGS.ROOT, SCREENS.WORKSPACE.INITIAL]; | ||
const ONBOARDING_SCREENS = [ | ||
SCREENS.ONBOARDING.PERSONAL_DETAILS, | ||
SCREENS.ONBOARDING.PURPOSE, | ||
SCREENS.ONBOARDING_MODAL.ONBOARDING, |
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.
I am wondering if we could process RELATIONS to get these informations
// This file is used to define the relationship between the sidebar and the right hand pane (RHP) screen. | ||
// These screens don't care about the split navigator's central screen and are in relation directly to the sidebar. |
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.
We coud think about better comment here and use /**
/** This file is used to define the relationship between the sidebar and the right hand pane (RHP) screen with.
That means they going back from RHP will take the user directly to the sidebar. On wide layout the default central screen will be used to fill the space */
Maybe something like that?
@@ -47,7 +47,7 @@ function WorkspaceJoinUserPage({route, policy}: WorkspaceJoinUserPageProps) { | |||
Navigation.isNavigationReady().then(() => { | |||
// @TODO: Check if this method works the same as on the main branch | |||
// NOTE: It probably doesn't need any params. When this method is called, shouldPopAllStateOnUP is always false | |||
Navigation.goBack(undefined, true); | |||
Navigation.goBack(undefined, {shouldPopToTop: true}); |
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.
Not pretty but I guess it's necessary 🤷
b7218fa
to
21f7bf6
Compare
Explanation of Change
Fixed Issues
$
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop