bloom-frontend
bloom-frontend copied to clipboard
Migrate move app and document files to root layout, migrate meet the team page and create test of the page
Migrated _document.tsx and _app.tsx to app router with a root layout Migrated Meet The Team page to app router in order to test the root layout and added test
Issue link / number: #1040 sub issue of #702
What changes did you make? Migrated _document.tsx and _app.tsx configuration which implies to:
- Create Root Layout
- Add New Relic app router configuration
- Move font imports to global css
- Add GoogleTagManager and Rollbar scripts
- Move primary main colour to a constant so it can be used in a server component
- Add OpenGraph metadata, unable to use new metadata app router object as it has a non standard key attribute that doesn't seems to be used anywhere in the codebase, we could create the OG from the metadata object if we can remove it
- Add Material UI app router configuration
- Add i18n (next-intl) app router configuration and make it compatible with pages router, forced to do some hacks to get it working due to the way pages router i18n is setup/implemented. All hacks have been implemented in the middleware file which will be remove after the migration. This hacks brings some temporal UX impact like forward and back buttons doesn't work in app router pages when navigating for the same URL but with different locale and all url needs to have language/locale prepended, included the former default one 'en', everything will be reverted to normal and the i18n setup much easier once all the pages migration is completed, should be quick to migrate the pages.
- Create storeProvider so it can be used in server components but its creation differ from the pages route approach, checked the content of the store and doesn't seem to be working, at least in dev mode, as I logged in with a superadmin and isSuperAdmin value was false but I was able to access to the dashboard/admin page
- Create AppLayout to hold all the client components of the layout
- Make StoryBlock client components so they can be used in app router
- Add metadata to root layout
- Add app router not found page that redirects to pages' one
Why did you make the changes? In order to be able to migrate the product from pages router to app router and benefits of all the new features available in the app router
Did you run tests? Yes