Skip to content

Commit

Permalink
Merge pull request #123 from software-mansion-labs/poc/split-flix-ban…
Browse files Browse the repository at this point in the history
…k-account-flow

Fix bank account flow and displaying the offline indicator
  • Loading branch information
adamgrzybowski authored Oct 29, 2024
2 parents 86fb765 + 92e47ac commit 8ddbd8e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/components/ScreenWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,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 @@ -131,6 +134,7 @@ function ScreenWrapper(
shouldShowOfflineIndicatorInWideScreen = false,
shouldUseCachedViewportHeight = false,
focusTrapSettings,
bottomContent,
}: ScreenWrapperProps,
ref: ForwardedRef<View>,
) {
Expand Down Expand Up @@ -305,6 +309,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 @@ -411,6 +411,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
<ScreenWrapper
includeSafeAreaPaddingBottom
testID={InitialSettingsPage.displayName}
bottomContent={<BottomTabBar selectedTab={SCREENS.SETTINGS.ROOT} />}
>
{headerContent}
<ScrollView
Expand All @@ -434,7 +435,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 @@ -372,6 +372,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 @@ -436,7 +437,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

0 comments on commit 8ddbd8e

Please sign in to comment.