From 4172610927ed7d986cf81f8f2c0a004299a6a379 Mon Sep 17 00:00:00 2001 From: rtrembecky Date: Thu, 5 Dec 2024 22:47:15 +0100 Subject: [PATCH] global medium buttons, `yarn add @mui/utils@^5`, `yarn dedupe` --- package.json | 1 + src/components/Admin/Admin.tsx | 24 ++++++++++++++++++++++-- yarn.lock | 13 +++++++------ 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 60d0639c..65a31072 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/components/Admin/Admin.tsx b/src/components/Admin/Admin.tsx index 2c74438f..f4f21987 100644 --- a/src/components/Admin/Admin.tsx +++ b/src/components/Admin/Admin.tsx @@ -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' @@ -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 ( - +