-
-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split out navigation apis in examples
- Loading branch information
Showing
29 changed files
with
47 additions
and
39 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
examples/example-app-router-migration/src/app/[locale]/page.tsx
This file contains 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 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,5 @@ | ||
import {createNavigation} from 'next-intl/navigation'; | ||
import {routing} from './routing'; | ||
|
||
export const {Link, redirect, usePathname, useRouter} = | ||
createNavigation(routing); |
This file contains 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 |
---|---|---|
@@ -1,10 +1,6 @@ | ||
import {createNavigation} from 'next-intl/navigation'; | ||
import {defineRouting} from 'next-intl/routing'; | ||
|
||
export const routing = defineRouting({ | ||
locales: ['en', 'de'], | ||
defaultLocale: 'en' | ||
}); | ||
|
||
export const {Link, redirect, usePathname, useRouter} = | ||
createNavigation(routing); |
This file contains 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 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 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
5 changes: 5 additions & 0 deletions
5
examples/example-app-router-mixed-routing/src/i18n/navigation.public.ts
This file contains 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,5 @@ | ||
import {createNavigation} from 'next-intl/navigation'; | ||
import {routing} from './routing.public'; | ||
|
||
// Should only be used on public routes in the `[locale]` segment | ||
export const {Link, usePathname} = createNavigation(routing); |
4 changes: 0 additions & 4 deletions
4
examples/example-app-router-mixed-routing/src/i18n/routing.public.ts
This file contains 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 |
---|---|---|
@@ -1,11 +1,7 @@ | ||
import {createNavigation} from 'next-intl/navigation'; | ||
import {defineRouting} from 'next-intl/routing'; | ||
import {defaultLocale, locales} from '../config'; | ||
|
||
export const routing = defineRouting({ | ||
locales, | ||
defaultLocale | ||
}); | ||
|
||
// Should only be used on public routes in the `[locale]` segment | ||
export const {Link, usePathname} = createNavigation(routing); |
2 changes: 1 addition & 1 deletion
2
examples/example-app-router-next-auth/src/components/LocaleSwitcher.tsx
This file contains 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 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,5 @@ | ||
import {createNavigation} from 'next-intl/navigation'; | ||
import {routing} from './routing'; | ||
|
||
export const {Link, redirect, usePathname, useRouter} = | ||
createNavigation(routing); |
This file contains 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 |
---|---|---|
@@ -1,11 +1,7 @@ | ||
import {createNavigation} from 'next-intl/navigation'; | ||
import {defineRouting} from 'next-intl/routing'; | ||
|
||
export const routing = defineRouting({ | ||
locales: ['en', 'de'], | ||
defaultLocale: 'en', | ||
localePrefix: 'as-needed' | ||
}); | ||
|
||
export const {Link, redirect, usePathname, useRouter} = | ||
createNavigation(routing); |
2 changes: 1 addition & 1 deletion
2
examples/example-app-router-playground/src/app/[locale]/client/ClientContent.tsx
This file contains 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
2 changes: 1 addition & 1 deletion
2
examples/example-app-router-playground/src/app/[locale]/client/redirect/page.tsx
This file contains 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
2 changes: 1 addition & 1 deletion
2
examples/example-app-router-playground/src/app/[locale]/nested/UnlocalizedPathname.tsx
This file contains 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
3 changes: 2 additions & 1 deletion
3
examples/example-app-router-playground/src/app/[locale]/news/[articleId]/page.tsx
This file contains 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 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
2 changes: 1 addition & 1 deletion
2
examples/example-app-router-playground/src/app/[locale]/redirect/page.tsx
This file contains 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
2 changes: 1 addition & 1 deletion
2
examples/example-app-router-playground/src/components/ClientLink.tsx
This file contains 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
2 changes: 1 addition & 1 deletion
2
examples/example-app-router-playground/src/components/ClientRouterWithoutProvider.tsx
This file contains 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
2 changes: 1 addition & 1 deletion
2
examples/example-app-router-playground/src/components/DropdownMenu.tsx
This file contains 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
2 changes: 1 addition & 1 deletion
2
examples/example-app-router-playground/src/components/LocaleSwitcher.tsx
This file contains 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 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
5 changes: 5 additions & 0 deletions
5
examples/example-app-router-playground/src/i18n/navigation.ts
This file contains 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,5 @@ | ||
import {createNavigation} from 'next-intl/navigation'; | ||
import {routing} from './routing'; | ||
|
||
export const {Link, getPathname, redirect, usePathname, useRouter} = | ||
createNavigation(routing); |
This file contains 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 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 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 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 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,5 @@ | ||
import {createNavigation} from 'next-intl/navigation'; | ||
import {routing} from './routing'; | ||
|
||
export const {Link, getPathname, redirect, usePathname, useRouter} = | ||
createNavigation(routing); |
This file contains 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