mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
24 lines
625 B
TypeScript
24 lines
625 B
TypeScript
// @ts-nocheck
|
|
import React from 'react';
|
|
import { ThemeProvider, StyleSheetManager } from 'styled-components';
|
|
import rtlcss from 'stylis-rtlcss';
|
|
import { useAppIntlContext } from '../AppIntlProvider';
|
|
|
|
interface DashboardThemeProviderProps {
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
export function DashboardThemeProvider({
|
|
children,
|
|
}: DashboardThemeProviderProps) {
|
|
const { direction } = useAppIntlContext();
|
|
|
|
return (
|
|
<StyleSheetManager
|
|
{...(direction === 'rtl' ? { stylisPlugins: [rtlcss] } : {})}
|
|
>
|
|
<ThemeProvider theme={{ dir: direction }}>{children}</ThemeProvider>
|
|
</StyleSheetManager>
|
|
);
|
|
}
|