mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: add rtlcss to styled components.
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import React from 'react';
|
||||
import { ThemeProvider } from 'styled-components';
|
||||
import { ThemeProvider, StyleSheetManager } from 'styled-components';
|
||||
import rtlcss from 'stylis-rtlcss';
|
||||
import { useAppIntlContext } from '../AppIntlProvider';
|
||||
|
||||
export function DashboardThemeProvider({ children }) {
|
||||
const { direction } = useAppIntlContext();
|
||||
|
||||
return <ThemeProvider theme={{ dir: direction }}>{children}</ThemeProvider>;
|
||||
return (
|
||||
<StyleSheetManager
|
||||
{...(direction === 'rtl' ? { stylisPlugins: [rtlcss] } : {})}
|
||||
>
|
||||
<ThemeProvider theme={{ dir: direction }}>{children}</ThemeProvider>
|
||||
</StyleSheetManager>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user