import { createGlobalStyle, RcThemeProvider } from '@ringcentral/juno'; import type { FunctionComponent } from 'react'; import React from 'react'; import { connectModule } from '../../lib/phoneContext'; import type { ThemeContainerProps } from './ThemeContainer.interface'; import { getThemeVariableString } from './utils'; type GlobalVariablesStylesProps = Pick; const GlobalVariablesStyles = createGlobalStyle` :root { ${({ variable, theme }) => getThemeVariableString(variable, theme)}; } `; export const GlobalStyle = createGlobalStyle<{ style: string }>` :root { ${({ style }) => style}; } `; const ThemeProvider: FunctionComponent = ({ children, theme, variable, prefixGlobalClass, }) => { return ( {children} ); }; export const ThemeContainer = connectModule>( (phone) => phone.themeUI, )(ThemeProvider);