Skip to content

Commit

Permalink
fix: prevent map loop on i18n config (#1388)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia authored Jul 31, 2024
1 parent 1bc4145 commit 4ac1f83
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ThemeProvider } from '@graasp/ui';

import * as Sentry from '@sentry/react';

import i18nConfig, { useCommonTranslation } from '../config/i18n';
import i18nConfig from '../config/i18n';
import {
QueryClientProvider,
ReactQueryDevtools,
Expand All @@ -32,15 +32,14 @@ import { FilterItemsContextProvider } from './context/FilterItemsContext';
import ModalProviders from './context/ModalProviders';

const ThemeWrapper = () => {
const { i18n } = useCommonTranslation();
const { data: currentMember } = hooks.useCurrentMember();

return (
<ThemeProvider
langs={langs}
languageSelectSx={{ mb: 2, mr: 2 }}
i18n={i18n}
defaultDirection={i18n.dir(currentMember?.extra?.lang)}
i18n={i18nConfig}
defaultDirection={i18nConfig.dir(currentMember?.extra?.lang)}
>
<CssBaseline />
<ToastContainer stacked position="bottom-left" theme="colored" />
Expand Down

0 comments on commit 4ac1f83

Please sign in to comment.