-
Notifications
You must be signed in to change notification settings - Fork 16
feat(CHIM-620): migrate navigation and routing to IonReactHashRouter #4693
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
902b357
refactor(CHIM-620): migrate react navigation from browserrouter to ha…
manishjoshii 326a437
fix(router): update stateful navigation calls for IonReactHashRouter
manishjoshii 3e86032
refactor: app init, GrowthBook hook & popup nav
manishjoshii e333369
test: fix broken tests from HashRouter migration
manishjoshii 5ffb919
fix(router): preserve legacy web deep links under hash routing
manishjoshii 61ba41f
configure router basename from constants
manishjoshii 79fdbc9
test: update test failing file profilemenu.test.tsx
manishjoshii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import React from 'react'; | ||
| import { IonRouterOutlet } from '@ionic/react'; | ||
| import { HardwareBackButtonHandler } from '../common/backButtonRegistry'; | ||
| import TermsGate from '../components/termsandconditons/TermsGate'; | ||
| import { useNavigationHandler } from '../helper/navigation/NavigationHandler'; | ||
| import { useGenericPopup } from '../hooks/useGenericPopup'; | ||
| import { useOpsConsoleBodyClass } from '../hooks/useOpsConsoleBodyClass'; | ||
| import { useRouteAudioCleanup } from '../hooks/useRouteAudioCleanup'; | ||
| import { useUsageLimitModal } from '../hooks/useUsageLimitModal'; | ||
| import { useAppSelector } from '../redux/hooks'; | ||
| import AppRoutes from './AppRoutes'; | ||
| import AppOverlays from './AppOverlays'; | ||
|
|
||
| const AppRouteEffects = () => { | ||
| useNavigationHandler(); | ||
| useOpsConsoleBodyClass(); | ||
| useRouteAudioCleanup(); | ||
| return null; | ||
| }; | ||
|
|
||
| const AppContent: React.FC = () => { | ||
| const isGlobalLoading = useAppSelector((state) => state.auth.globalLoading); | ||
| const popup = useGenericPopup(); | ||
| const usageLimit = useUsageLimitModal(); | ||
|
|
||
| return ( | ||
| <> | ||
| <AppRouteEffects /> | ||
| <TermsGate /> | ||
| <HardwareBackButtonHandler | ||
| popupDataRef={popup.popupDataRef} | ||
| setPopupData={popup.setPopupData} | ||
| popupManager={popup.popupManager} | ||
| showModalRef={usageLimit.showModalRef} | ||
| setShowModal={usageLimit.setShowModal} | ||
| /> | ||
| <IonRouterOutlet> | ||
| <AppRoutes /> | ||
| </IonRouterOutlet> | ||
| <AppOverlays | ||
| isGlobalLoading={isGlobalLoading} | ||
| popupData={popup.popupData} | ||
| onPopupClose={popup.closePopup} | ||
| onPopupAction={popup.actOnPopup} | ||
| showBreakModal={usageLimit.showModal} | ||
| onContinueFromBreak={usageLimit.continueAfterBreak} | ||
| showBreakToast={usageLimit.showToast} | ||
| onDismissBreakToast={() => usageLimit.setShowToast(false)} | ||
| /> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default AppContent; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The newly added
AppContentcomponent usesReact.FCbut does not importReact. This will cause a TypeScript compilation error (Cannot find name 'React'). Please importReactat the top of the file.