diff options
Diffstat (limited to 'packages/renderer/src/i18n/RtlCacheProvider.tsx')
-rw-r--r-- | packages/renderer/src/i18n/RtlCacheProvider.tsx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/packages/renderer/src/i18n/RtlCacheProvider.tsx b/packages/renderer/src/i18n/RtlCacheProvider.tsx index d54308b..be770b8 100644 --- a/packages/renderer/src/i18n/RtlCacheProvider.tsx +++ b/packages/renderer/src/i18n/RtlCacheProvider.tsx | |||
@@ -18,21 +18,20 @@ | |||
18 | * SPDX-License-Identifier: AGPL-3.0-only | 18 | * SPDX-License-Identifier: AGPL-3.0-only |
19 | */ | 19 | */ |
20 | 20 | ||
21 | import createCache from '@emotion/cache'; | 21 | import type { EmotionCache } from '@emotion/cache'; |
22 | import { CacheProvider } from '@emotion/react'; | 22 | import { CacheProvider } from '@emotion/react'; |
23 | import { observer } from 'mobx-react-lite'; | 23 | import { observer } from 'mobx-react-lite'; |
24 | import React, { ReactNode } from 'react'; | 24 | import React, { ReactNode } from 'react'; |
25 | import { prefixer } from 'stylis'; | ||
26 | import rtlPlugin from 'stylis-plugin-rtl'; | ||
27 | 25 | ||
28 | import { useStore } from '../components/StoreProvider'; | 26 | import { useStore } from '../components/StoreProvider'; |
29 | 27 | ||
30 | const rtlCache = createCache({ | 28 | function RtlCacheProvider({ |
31 | key: 'muirtl', | 29 | children, |
32 | stylisPlugins: [prefixer, rtlPlugin], | 30 | rtlCache, |
33 | }); | 31 | }: { |
34 | 32 | children?: ReactNode; | |
35 | function RtlCacheProvider({ children }: { children?: ReactNode }): JSX.Element { | 33 | rtlCache: EmotionCache; |
34 | }): JSX.Element { | ||
36 | const { | 35 | const { |
37 | shared: { writingDirection }, | 36 | shared: { writingDirection }, |
38 | } = useStore(); | 37 | } = useStore(); |