muffin-admin 3.11.0 → 3.11.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muffin-admin",
3
- "version": "3.11.0",
3
+ "version": "3.11.1",
4
4
  "description": "NPM package for https://github.com/klen/muffin-admin",
5
5
  "files": [
6
6
  "src",
@@ -21,22 +21,20 @@ import { buildAdmin, findBuilder, findIcon, setupAdmin } from "./utils"
21
21
 
22
22
  export function MuffinAdmin(props: AdminProps) {
23
23
  const opts = useMuffinAdminOpts()
24
- const { resources = [], auth, adminProps, apiUrl, locales } = opts
24
+ const { resources = [], auth, adminProps, apiUrl, locales: backendLocales } = opts
25
25
 
26
26
  document.title = adminProps?.title || "Muffin Admin"
27
27
  const muffinI18nProvider = buildProvider(
28
- locales
28
+ backendLocales
29
29
  ? Object.fromEntries(
30
30
  Object.entries(muffinTranslations).map(([locale, messages]) => [
31
31
  locale,
32
- { ...messages, ...locales[locale] },
32
+ { ...messages, ...backendLocales[locale], ...(buildAdmin(["locale", locale]) || {}) },
33
33
  ])
34
34
  )
35
35
  : muffinTranslations
36
36
  )
37
37
 
38
- console.log(999, muffinI18nProvider.getLocale())
39
-
40
38
  const {
41
39
  basename,
42
40
  authProvider = findBuilder(["authprovider"])(auth),
@@ -11,20 +11,17 @@ import { useTranslate } from "react-admin"
11
11
  import { HelpLink } from "./common/HelpLink"
12
12
  import { useMuffinAdminOpts } from "./hooks"
13
13
  import { AdminDashboardBlock } from "./types"
14
- import { setupAdmin } from "./utils"
14
+ import { buildAdmin, setupAdmin } from "./utils"
15
15
 
16
16
  export function MuffinDashboard() {
17
17
  const { dashboard, help } = useMuffinAdminOpts()
18
18
  const translate = useTranslate()
19
19
  return (
20
- <Stack gap={2}>
21
- {help && (
22
- <Card>
23
- <CardContent>
24
- <HelpLink size="large" href={help} label={translate("muffin.how_to_use_admin")} />
25
- </CardContent>
26
- </Card>
27
- )}
20
+ <Stack gap={2} pt={1}>
21
+ <Stack direction="row">
22
+ {help && <HelpLink size="large" href={help} label={translate("muffin.how_to_use_admin")} />}
23
+ {buildAdmin(["dashboard-actions"])}
24
+ </Stack>
28
25
  <Grid container spacing={1}>
29
26
  <AdminCards src={dashboard} />
30
27
  </Grid>