Skip to content

Commit

Permalink
global medium buttons, yarn add @mui/utils@^5, yarn dedupe
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrembecky committed Dec 5, 2024
1 parent 848a502 commit 4172610
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@emotion/styled": "^11.13.5",
"@mui/icons-material": "^5.16.7",
"@mui/material": "^5.16.7",
"@mui/utils": "^5",
"@tanstack/react-query": "5.61.0",
"@tanstack/react-query-devtools": "5.61.0",
"@testing-library/jest-dom": "^5.17.0",
Expand Down
24 changes: 22 additions & 2 deletions src/components/Admin/Admin.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {deepmerge} from '@mui/utils'
import {FC} from 'react'
import {Admin as ReactAdmin, Resource} from 'react-admin'
import {Admin as ReactAdmin, defaultDarkTheme, defaultLightTheme, RaThemeOptions, Resource} from 'react-admin'

import {AdminLayout} from './AdminLayout'
import {dataProvider} from './dataProvider'
Expand Down Expand Up @@ -47,11 +48,30 @@ import {SchoolList} from './resources/personal/schools/SchoolList'
import {SchoolShow} from './resources/personal/schools/SchoolShow'
import {useAuthProvider} from './useAuthProvider'

const themeOverrides: RaThemeOptions = {
components: {
RaButton: {
defaultProps: {
size: 'medium',
},
},
},
}

const lightTheme = deepmerge(defaultLightTheme, themeOverrides)
const darkTheme = deepmerge(defaultDarkTheme, themeOverrides)

export const Admin: FC = () => {
const authProvider = useAuthProvider()

return (
<ReactAdmin authProvider={authProvider} dataProvider={dataProvider} layout={AdminLayout}>
<ReactAdmin
authProvider={authProvider}
dataProvider={dataProvider}
layout={AdminLayout}
theme={lightTheme}
darkTheme={darkTheme}
>
<Resource name="cms/post" list={PostList} edit={PostEdit} show={PostShow} create={PostCreate} />
<Resource
name="cms/flat-page"
Expand Down
13 changes: 7 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2075,9 +2075,9 @@ __metadata:
languageName: node
linkType: hard

"@mui/utils@npm:^5.16.6":
version: 5.16.6
resolution: "@mui/utils@npm:5.16.6"
"@mui/utils@npm:^5, @mui/utils@npm:^5.16.6":
version: 5.16.8
resolution: "@mui/utils@npm:5.16.8"
dependencies:
"@babel/runtime": "npm:^7.23.9"
"@mui/types": "npm:^7.2.15"
Expand All @@ -2086,12 +2086,12 @@ __metadata:
prop-types: "npm:^15.8.1"
react-is: "npm:^18.3.1"
peerDependencies:
"@types/react": ^17.0.0 || ^18.0.0
react: ^17.0.0 || ^18.0.0
"@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0
react: ^17.0.0 || ^18.0.0 || ^19.0.0
peerDependenciesMeta:
"@types/react":
optional: true
checksum: 10/214bc3e9fe49579c5aee264477c802e5f5ced3473cafb1ed0aacd63db223e2668a08fb1f7304e70ea0511f68200dd80c3b49cc58050c7b0962228758a003371d
checksum: 10/b091f069a554eb7c691c362ec56c68c5939ce789f3b6d3b94a1718b3c0c7af28eb14aaf45cc8b10e32eb550df156e60f595b4d58f67f2bb34749768b41bd4502
languageName: node
linkType: hard

Expand Down Expand Up @@ -10214,6 +10214,7 @@ __metadata:
"@emotion/styled": "npm:^11.13.5"
"@mui/icons-material": "npm:^5.16.7"
"@mui/material": "npm:^5.16.7"
"@mui/utils": "npm:^5"
"@svgr/webpack": "npm:^8.1.0"
"@tanstack/react-query": "npm:5.61.0"
"@tanstack/react-query-devtools": "npm:5.61.0"
Expand Down

0 comments on commit 4172610

Please sign in to comment.