@fonderie/react-admin-screens 1.6.0 → 1.6.2

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.js CHANGED
@@ -2766,6 +2766,7 @@ function AdminShell({
2766
2766
  locale,
2767
2767
  ...editing.type ? { type: editing.type } : {},
2768
2768
  ...editing.locales ? { locales: editing.locales } : {},
2769
+ ...editing.defaultLocale ? { defaultLocale: editing.defaultLocale } : {},
2769
2770
  onCreated: (c) => setEditing({ kind: "template", type: c.type, locale: c.locale, system: false })
2770
2771
  }
2771
2772
  )
@@ -2783,7 +2784,18 @@ function AdminShell({
2783
2784
  system: editing.system,
2784
2785
  onSaved: () => setEditing(null),
2785
2786
  onDeleted: () => setEditing(null),
2786
- onAddLocale: (type) => setEditing({ kind: "template-new", type }),
2787
+ onAddLocale: (type, c) => setEditing({
2788
+ kind: "template-new",
2789
+ type,
2790
+ locales: c.locales,
2791
+ ...c.defaultLocale ? { defaultLocale: c.defaultLocale } : {}
2792
+ }),
2793
+ onSelectLocale: (tpl) => setEditing({
2794
+ kind: "template",
2795
+ type: tpl.type,
2796
+ locale: tpl.locale,
2797
+ system: tpl.system === true
2798
+ }),
2787
2799
  uiLocale: locale
2788
2800
  },
2789
2801
  `${editing.type}:${editing.locale ?? ""}`
@@ -2793,12 +2805,7 @@ function AdminShell({
2793
2805
  {
2794
2806
  client: courierClient,
2795
2807
  locale,
2796
- onSelectTemplate: (tpl) => setEditing({
2797
- kind: "template",
2798
- type: tpl.type,
2799
- locale: tpl.locale ?? null,
2800
- system: tpl.system === true
2801
- }),
2808
+ onSelectTemplate: (tpl) => setEditing({ kind: "template", type: tpl.type, locale: tpl.locale, system: tpl.system }),
2802
2809
  onCreateTemplate: (c) => setEditing({ kind: "template-new", locales: c.locales })
2803
2810
  }
2804
2811
  );