Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Pages to App Router (navapbc#7)
Fixes #6 1. Move all pages to [`[locale]`](https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#getting-started) folder 2. Add [`generateMetata()`](https://nextjs.org/docs/app/api-reference/functions/generate-metadata#generatemetadata-function) function and [next-intl `getTranslations()`](https://next-intl-docs.vercel.app/docs/environments/metadata-route-handlers#metadata-api) implementation * @rylew1 commented we could remove this from each page. To do that we could use [prop arguments](https://nextjs.org/docs/app/api-reference/functions/generate-metadata#with-segment-props) and update the based on the param. There is also more we can do with the metadata to properly add [app links and twitter cards](https://nextjs.org/docs/app/api-reference/functions/generate-metadata#applinks). TODO: create ticket 4. Replace i18n's `useTranslation` with next-intl's `useTranslations` 5. Remove hard-coded strings that were present b/c we were still b/w i18next and next-intl * [Move process page to app](navapbc@32ba4ee) * [Move research page to app](navapbc@5b5ad1a) * [Move health page to app](navapbc@a3e6255) * [Move feature flag page to app](navapbc@395baed) * [Move search page to app router](navapbc@1e261e3) * [Move newsletter pages to app router](navapbc@b509ef8) * [Move home page to app router](navapbc@de1be98) * [Move home page to app router](navapbc@74077ae) * [Move 404 page to app router](navapbc@ccbc956) 1. [Delete hello api](navapbc@5bad6ea) * This was left from the project creation 2. [Add USWDS icon component](navapbc@0120c7b) * as noted in a slack discussion, when trying to access [one of the icons](https://github.com/trussworks/react-uswds/blob/main/src/components/Icon/Icons.ts) using `<Icon.Search/>` next errors: `You cannot dot into a client module from a server component. You can only pass the imported name through`. I'm not sure why it thinks the Icon component is a client module. [Dan A. suggests](vercel/next.js#51593 (comment)) trussworks should re-export as named exports. I tried importing the SVGs directly from the trussworks library but [svgr requires a custom webpack config](https://react-svgr.com/docs/next/) which is a road I didn't want to go down and [react svg](https://www.npmjs.com/package/react-svg) through an error in the app router 😥 . * I implemented @sawyerh 's [suggestion](navapbc@0120c7b#diff-dadb35bd2f3f61f2c179f033cd0a2874fc343974236f2fb8613664703c751429), which did not work initially b/c next reported the USWDS icon was corrupt, which was fixed by adding a `viewBox` to the svg element 😮💨 . * [Remove unused WtGIContent](navapbc@75490f7) * [Move layout and update for app router](navapbc@af112fd) * [Update global components for the app router](navapbc@40119e6) * [Move i18n strings for app router](navapbc@eb3c07c) * [Adds next-intl config and removes i18n](navapbc@c546571) * [Update tests for app router](navapbc@3b9b193) * [Removes i18next and next-i18n packages](navapbc@9d2e08a) * [Update storybook settings for app router](navapbc@39f115d)
- Loading branch information