muffin-admin 9.5.1 → 9.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muffin-admin",
3
- "version": "9.5.1",
3
+ "version": "9.5.2",
4
4
  "description": "NPM package for https://github.com/klen/muffin-admin",
5
5
  "files": [
6
6
  "src",
@@ -6,7 +6,7 @@ import ListItemIcon from "@mui/material/ListItemIcon"
6
6
  import ListItemText from "@mui/material/ListItemText"
7
7
  import { matchPath, useLocation } from "react-router-dom"
8
8
 
9
- import { Menu, MenuProps, useBasename, useTranslate } from "react-admin"
9
+ import { Menu, MenuProps, useBasename, useTheme, useTranslate } from "react-admin"
10
10
 
11
11
  import find from "lodash/find"
12
12
  import groupBy from "lodash/groupBy"
@@ -50,12 +50,25 @@ function MenuGroup({ name, resources }: { name: string; resources: AdminResource
50
50
  (resource) => !!matchPath({ path: `${basename}/${resource.name}/*` }, pathname)
51
51
  )
52
52
  const [groupOpen, setGroupOpen] = useState(match)
53
+ const theme = useTheme()[0]
54
+ const colors =
55
+ theme == "dark"
56
+ ? {
57
+ text: "rgba(255, 255, 255, 0.87)",
58
+ textSecondary: "rgba(255, 255, 255, 0.6)",
59
+ }
60
+ : {
61
+ text: "rgba(0, 0, 0, 0.87)",
62
+ textSecondary: "rgba(0, 0, 0, 0.6)",
63
+ }
53
64
 
54
65
  return (
55
66
  <div>
56
67
  <ListItemButton
57
68
  onClick={() => setGroupOpen(!groupOpen)}
58
- sx={{ color: match ? "rgba(0, 0, 0, 0.87)" : "rgba(0, 0, 0, 0.6)" }}
69
+ sx={{
70
+ color: match ? colors.text : colors.textSecondary,
71
+ }}
59
72
  >
60
73
  {Icon && (
61
74
  <ListItemIcon sx={{ minWidth: 40 }}>
package/src/index.tsx CHANGED
@@ -37,4 +37,4 @@ export async function initAdmin(prefix = "", containerId: string = "root") {
37
37
  )
38
38
  }
39
39
 
40
- export const VERSION = "9.5.1"
40
+ export const VERSION = "9.5.2"