From 7aced9477c46eeedf55005732de7e26c9479deb0 Mon Sep 17 00:00:00 2001 From: ewandor Date: Tue, 13 May 2025 03:37:21 +0200 Subject: [PATCH] Localization provider for muix --- gui/rpk-gui/src/components/I18nTheme.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gui/rpk-gui/src/components/I18nTheme.tsx b/gui/rpk-gui/src/components/I18nTheme.tsx index c72a983..2929b7c 100644 --- a/gui/rpk-gui/src/components/I18nTheme.tsx +++ b/gui/rpk-gui/src/components/I18nTheme.tsx @@ -3,6 +3,8 @@ import { useTranslation } from "@refinedev/core"; import { useTheme } from "@mui/material"; import * as locales from '@mui/material/locale'; import { createTheme, ThemeProvider } from "@mui/material/styles"; +import { LocalizationProvider } from "@mui/x-date-pickers"; +import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; type SupportedLocales = keyof typeof locales; @@ -10,11 +12,13 @@ export const I18nTheme: React.FC = ({ children }: PropsWithCh const { getLocale } = useTranslation(); const theme = useTheme() - const themeWithLocale = createTheme(theme, locales[getLocale() as SupportedLocales]) - + const locale = getLocale() || "en" + const themeWithLocale = createTheme(theme, locales[locale as SupportedLocales]) return ( - { children } + + { children } + ); }