@payloadcms/ui
Advanced tools
Comparing version 3.15.2-canary.36e50dd to 3.15.2-canary.ee31a64
@@ -5,2 +5,3 @@ import type { Locale } from 'payload'; | ||
children?: React.ReactNode; | ||
locale?: Locale['code']; | ||
}>; | ||
@@ -7,0 +8,0 @@ /** |
@@ -12,3 +12,4 @@ 'use client'; | ||
export const LocaleProvider = ({ | ||
children | ||
children, | ||
locale: localeFromProps | ||
}) => { | ||
@@ -28,5 +29,5 @@ const { | ||
} = usePreferences(); | ||
const searchParams = useSearchParams(); | ||
const localeFromParams = searchParams.get('locale'); | ||
const [localeCode, setLocaleCode] = useState(defaultLocale); | ||
const localeFromParams = useSearchParams().get('locale'); | ||
// `localeFromProps` originates from the root layout, which does not have access to search params | ||
const [localeCode, setLocaleCode] = useState(localeFromProps || localeFromParams); | ||
const locale = React.useMemo(() => { | ||
@@ -33,0 +34,0 @@ if (!localization) { |
import type { I18nClient, Language } from '@payloadcms/translations'; | ||
import type { ClientConfig, LanguageOptions, SanitizedPermissions, ServerFunctionClient, User } from 'payload'; | ||
import type { ClientConfig, LanguageOptions, Locale, SanitizedPermissions, ServerFunctionClient, User } from 'payload'; | ||
import React from 'react'; | ||
@@ -13,2 +13,3 @@ import type { Theme } from '../Theme/index.js'; | ||
readonly languageOptions: LanguageOptions; | ||
readonly locale?: Locale['code']; | ||
readonly permissions: SanitizedPermissions; | ||
@@ -15,0 +16,0 @@ readonly serverFunction: ServerFunctionClient; |
@@ -33,2 +33,3 @@ 'use client'; | ||
languageOptions, | ||
locale, | ||
permissions, | ||
@@ -77,2 +78,3 @@ serverFunction, | ||
children: /*#__PURE__*/_jsx(LocaleProvider, { | ||
locale: locale, | ||
children: /*#__PURE__*/_jsx(StepNavProvider, { | ||
@@ -79,0 +81,0 @@ children: /*#__PURE__*/_jsx(LoadingOverlayProvider, { |
{ | ||
"name": "@payloadcms/ui", | ||
"version": "3.15.2-canary.36e50dd", | ||
"version": "3.15.2-canary.ee31a64", | ||
"homepage": "https://payloadcms.com", | ||
@@ -135,3 +135,3 @@ "repository": { | ||
"uuid": "10.0.0", | ||
"@payloadcms/translations": "3.15.2-canary.36e50dd" | ||
"@payloadcms/translations": "3.15.2-canary.ee31a64" | ||
}, | ||
@@ -153,4 +153,4 @@ "devDependencies": { | ||
"eslint-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124", | ||
"payload": "3.15.2-canary.36e50dd", | ||
"@payloadcms/eslint-config": "3.9.0" | ||
"@payloadcms/eslint-config": "3.9.0", | ||
"payload": "3.15.2-canary.ee31a64" | ||
}, | ||
@@ -161,3 +161,3 @@ "peerDependencies": { | ||
"react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020", | ||
"payload": "3.15.2-canary.36e50dd" | ||
"payload": "3.15.2-canary.ee31a64" | ||
}, | ||
@@ -164,0 +164,0 @@ "engines": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
9479390
46369
+ Added@payloadcms/translations@3.15.2-canary.ee31a64(transitive)
+ Addedpayload@3.15.2-canary.ee31a64(transitive)
- Removed@payloadcms/translations@3.15.2-canary.36e50dd(transitive)
- Removedpayload@3.15.2-canary.36e50dd(transitive)