@nocode-factory/sanity-kit 2.32.0 → 2.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/tools/presentation/PagesNavigator.tsx +5 -3
- package/src/version.ts +1 -1
package/package.json
CHANGED
|
@@ -33,14 +33,16 @@ function PagesNavigator() {
|
|
|
33
33
|
const shownLocale = localeOfPreview(params?.preview, i18n)
|
|
34
34
|
const [locale, setLocale] = useState<string | null>(null)
|
|
35
35
|
const [search, setSearch] = useState('')
|
|
36
|
-
|
|
36
|
+
// Langue choisie, sinon celle de la page affichée, sinon la langue principale :
|
|
37
|
+
// le menu montre toujours la langue réellement filtrée.
|
|
38
|
+
const activeLocale = locale ?? shownLocale ?? i18n?.defaultLocale ?? ''
|
|
37
39
|
const current = pathOf(params?.preview)
|
|
38
40
|
|
|
39
41
|
const visible = useMemo(() => {
|
|
40
42
|
const q = search.trim().toLowerCase()
|
|
41
43
|
return rows
|
|
42
44
|
.filter((r) => r.path !== null)
|
|
43
|
-
.filter((r) => !i18n || !activeLocale || r.locale === activeLocale)
|
|
45
|
+
.filter((r) => !i18n || !activeLocale || !r.locale || r.locale === activeLocale)
|
|
44
46
|
.filter((r) => !q || r.title.toLowerCase().includes(q) || (r.path ?? '').toLowerCase().includes(q))
|
|
45
47
|
.sort((a, b) => (a.path ?? '').localeCompare(b.path ?? ''))
|
|
46
48
|
}, [rows, search, activeLocale, i18n])
|
|
@@ -63,7 +65,7 @@ function PagesNavigator() {
|
|
|
63
65
|
/>
|
|
64
66
|
</Box>
|
|
65
67
|
{i18n && i18n.locales.length > 1 && (
|
|
66
|
-
<Select fontSize={1} padding={2} value={activeLocale} onChange={(e) => setLocale(e.currentTarget.value)} style={{width:
|
|
68
|
+
<Select fontSize={1} padding={2} value={activeLocale} onChange={(e) => setLocale(e.currentTarget.value)} style={{width: 88}}>
|
|
67
69
|
{i18n.locales.map((code) => (
|
|
68
70
|
<option key={code} value={code}>
|
|
69
71
|
{code.toUpperCase()}
|
package/src/version.ts
CHANGED