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

Fix bank account flow and displaying the offline indicator #123

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/ScreenWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ type ScreenWrapperProps = {
/** Returns a function as a child to pass insets to or a node to render without insets */
children: ReactNode | React.FC<ScreenWrapperChildrenProps>;

/** Content to display under the offline indicator */
bottomContent?: ReactNode;

/** A unique ID to find the screen wrapper in tests */
testID: string;

Expand Down Expand Up @@ -132,6 +135,7 @@ function ScreenWrapper(
shouldShowOfflineIndicatorInWideScreen = false,
shouldUseCachedViewportHeight = false,
focusTrapSettings,
bottomContent,
}: ScreenWrapperProps,
ref: ForwardedRef<View>,
) {
Expand Down Expand Up @@ -306,6 +310,7 @@ function ScreenWrapper(
<ImportedStateIndicator />
</>
)}
{bottomContent}
</ScreenWrapperStatusContext.Provider>
</PickerAvoidingView>
</KeyboardAvoidingView>
Expand Down
2 changes: 1 addition & 1 deletion src/components/StateSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function StateSelector(
onPress={() => {
const activeRoute = Navigation.getActiveRoute();
didOpenStateSelector.current = true;
Navigation.navigate(stateSelectorRoute.getRoute(stateCode, activeRoute, label));
Navigation.goUp(stateSelectorRoute.getRoute(stateCode, activeRoute, label), {compareParams: false});
}}
wrapperStyle={wrapperStyle}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Search/SearchPageBottomTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function SearchPageBottomTab({queryJSON, policyID, searchName}: SearchPageBottom
<ScreenWrapper
testID={SearchPageBottomTab.displayName}
offlineIndicatorStyle={styles.mtAuto}
bottomContent={<BottomTabBar selectedTab={SCREENS.SEARCH.CENTRAL_PANE} />}
>
{!selectionMode?.isEnabled ? (
<>
Expand Down Expand Up @@ -121,7 +122,6 @@ function SearchPageBottomTab({queryJSON, policyID, searchName}: SearchPageBottom
onSearchListScroll={scrollHandler}
contentContainerStyle={!selectionMode?.isEnabled ? [styles.searchListContentContainerStyles] : undefined}
/>
<BottomTabBar selectedTab={SCREENS.SEARCH.CENTRAL_PANE} />
</ScreenWrapper>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/sidebar/SidebarScreen/BaseSidebarScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function BaseSidebarScreen() {
shouldEnableKeyboardAvoidingView={false}
style={[styles.sidebar, Browser.isMobile() ? styles.userSelectNone : {}]}
testID={BaseSidebarScreen.displayName}
bottomContent={<BottomTabBar selectedTab={SCREENS.HOME} />}
>
{({insets}) => (
<>
Expand All @@ -64,7 +65,6 @@ function BaseSidebarScreen() {
insets={insets}
/>
</View>
<BottomTabBar selectedTab={SCREENS.HOME} />
</>
)}
</ScreenWrapper>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/InitialSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
<ScreenWrapper
includeSafeAreaPaddingBottom
testID={InitialSettingsPage.displayName}
bottomContent={<BottomTabBar selectedTab={SCREENS.SETTINGS.ROOT} />}
>
{headerContent}
<ScrollView
Expand All @@ -431,7 +432,6 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
onCancel={() => toggleSignoutConfirmModal(false)}
/>
</ScrollView>
<BottomTabBar selectedTab={SCREENS.SETTINGS.ROOT} />
</ScreenWrapper>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/WorkspaceInitialPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, route}: Workspac
<ScreenWrapper
testID={WorkspaceInitialPage.displayName}
includeSafeAreaPaddingBottom
bottomContent={<BottomTabBar selectedTab={SCREENS.SETTINGS.ROOT} />}
>
<FullPageNotFoundView
onBackButtonPress={Navigation.dismissModal}
Expand Down Expand Up @@ -431,7 +432,6 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, route}: Workspac
cancelText={translate('common.cancel')}
danger
/>
<BottomTabBar selectedTab={SCREENS.SETTINGS.ROOT} />
</FullPageNotFoundView>
</ScreenWrapper>
);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/WorkspacesListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ function WorkspacesListPage() {
shouldEnableMaxHeight
testID={WorkspacesListPage.displayName}
shouldShowOfflineIndicatorInWideScreen
bottomContent={shouldUseNarrowLayout && <BottomTabBar selectedTab={SCREENS.SETTINGS.ROOT} />}
>
<HeaderWithBackButton
title={translate('common.workspaces')}
Expand Down Expand Up @@ -405,7 +406,6 @@ function WorkspacesListPage() {
/>
</View>
</ScrollView>
{shouldUseNarrowLayout && <BottomTabBar selectedTab={SCREENS.SETTINGS.ROOT} />}
</ScreenWrapper>
);
}
Expand All @@ -415,6 +415,7 @@ function WorkspacesListPage() {
shouldEnablePickerAvoiding={false}
shouldShowOfflineIndicatorInWideScreen
testID={WorkspacesListPage.displayName}
bottomContent={shouldUseNarrowLayout && <BottomTabBar selectedTab={SCREENS.SETTINGS.ROOT} />}
>
<View style={styles.flex1}>
<HeaderWithBackButton
Expand Down Expand Up @@ -444,7 +445,6 @@ function WorkspacesListPage() {
cancelText={translate('common.cancel')}
danger
/>
{shouldUseNarrowLayout && <BottomTabBar selectedTab={SCREENS.SETTINGS.ROOT} />}
</ScreenWrapper>
);
}
Expand Down
Loading