Skip to content

Commit

Permalink
chore: remove old navigation code [part 1] (#11245)
Browse files Browse the repository at this point in the history
* chore: remove old navigation code [part 1]

* fix: tests - round 1

* fix: tests - round 2

* fix: tests - round 3

* fix: header on settings screen

* fix: remove non used modules

* fix: remove typo Ø
  • Loading branch information
MounirDhahri authored Dec 4, 2024
1 parent b69c526 commit 6c297bb
Show file tree
Hide file tree
Showing 85 changed files with 645 additions and 2,899 deletions.
12 changes: 1 addition & 11 deletions docs/best_practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,7 @@ For adding a screen that corresponds to a page on artsy.net add a new route and

See our documentation on adding a route for more details: [Adding a new route](https://github.com/artsy/eigen/blob/main/docs/adding_a_new_route.md) and to [create a new screen](https://github.com/artsy/eigen/blob/main/docs/adding_a_new_screen.md).

### iOS Navigation

- For native iOS code we use the **ARScreenPresenterModule**. Once the new app shell is finished (expected March 2022), we will be using `react-navigation`.

For the most part you don't have to worry about this.
[For Artsy Engineers] If you want to learn more about our navigation infra, take a look at this [recording](https://drive.google.com/drive/u/0/folders/1wUAUHt86WLQMy7Fx3MU7k4bj4y1ngaCk)

## Analytics and tracking

Expand Down Expand Up @@ -326,9 +322,3 @@ The following parts of the iOS app are handled in native code:
- Analytics for Native UI.
- View In Room (Augmented Reality)
- City Guide Drawer Handling

The following parts of the iOS app are handled in native code, but will be managed by React Native once the new app shell is finished (expected March 2022):

- ARScreenPresenterModule to navigate between view controllers.
- The top-level tab bar, and each tab's navigation controller.
- Deep-link and notification handling.
24 changes: 1 addition & 23 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import { codePushOptions } from "app/system/codepush"
import { DevMenuWrapper } from "app/system/devTools/DevMenu/DevMenuWrapper"
import { useRageShakeDevMenu } from "app/system/devTools/useRageShakeDevMenu"
import { setupSentry } from "app/system/errorReporting/setupSentry"
import { ModalStack } from "app/system/navigation/ModalStack"
import { usePurgeCacheOnAppUpdate } from "app/system/relay/usePurgeCacheOnAppUpdate"
import { useDevToggle } from "app/utils/hooks/useDevToggle"
import { useFeatureFlag } from "app/utils/hooks/useFeatureFlag"
import { addTrackingProvider } from "app/utils/track"
import {
SEGMENT_TRACKING_PROVIDER,
Expand All @@ -28,11 +25,8 @@ import Config from "react-native-config"
import { Settings } from "react-native-fbsdk-next"
import "react-native-get-random-values"
import { useWebViewCookies } from "./Components/ArtsyWebView"
import { FPSCounter } from "./Components/FPSCounter"
import { Providers } from "./Providers"
import { BottomTabsNavigator } from "./Scenes/BottomTabs/BottomTabsNavigator"
import { ForceUpdate } from "./Scenes/ForceUpdate/ForceUpdate"
import { Onboarding } from "./Scenes/Onboarding/Onboarding"
import { DynamicIslandStagingIndicator } from "./utils/DynamicIslandStagingIndicator"
import { createAllChannels, savePendingToken } from "./utils/PushNotification"
import { useInitializeQueryPrefetching } from "./utils/queryPrefetching"
Expand Down Expand Up @@ -85,14 +79,10 @@ const Main = () => {
)

const isLoggedIn = GlobalStore.useAppState((state) => !!state.auth.userAccessToken)
const onboardingState = GlobalStore.useAppState((state) => state.auth.onboardingState)
const forceUpdateMessage = GlobalStore.useAppState(
(state) => state.artsyPrefs.echo.forceUpdateMessage
)

const fpsCounter = useDevToggle("DTFPSCounter")
const useNewNavigation = useFeatureFlag("AREnableNewNavigation")

useStripeConfig()
useSiftConfig()
useWebViewCookies()
Expand Down Expand Up @@ -126,19 +116,7 @@ const Main = () => {
return <ForceUpdate forceUpdateMessage={forceUpdateMessage} />
}

if (useNewNavigation) {
return <Navigation />
}
if (!isLoggedIn || onboardingState === "incomplete") {
return <Onboarding />
}

return (
<ModalStack>
<BottomTabsNavigator />
{!!fpsCounter && <FPSCounter />}
</ModalStack>
)
return <Navigation />
}

const InnerApp = () => {
Expand Down
Loading

0 comments on commit 6c297bb

Please sign in to comment.