9f18221fc9
* fix: Custom styles not applying to loading screen * fix: Apply custom styles before rendering children * fix: Use Object.assign instead of spread syntax * fix: Add cleanup function to clear the timeout and abort the fetch * fix: Clear the timeout if the fetch completes successfully * refactor: Remove unused queries file
27 lines
875 B
TypeScript
27 lines
875 B
TypeScript
import React from 'react';
|
|
import useUserSettings from '/imports/ui/core/local-states/useUserSettings';
|
|
|
|
interface CustomStylesProps {
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
const CustomStyles: React.FC<CustomStylesProps> = (props) => {
|
|
const { children } = props;
|
|
|
|
const [userSettings] = useUserSettings();
|
|
|
|
const customStyleUrl = userSettings.bbb_custom_style_url
|
|
|| window.meetingClientSettings.public.app.customStyleUrl;
|
|
const customStyle = userSettings.bbb_custom_style;
|
|
|
|
return (
|
|
<>
|
|
{customStyleUrl && typeof customStyleUrl === 'string' ? <link rel="stylesheet" type="text/css" href={customStyleUrl} /> : null}
|
|
{customStyle && typeof customStyle === 'string' ? <link rel="stylesheet" type="text/css" href={`data:text/css;charset=UTF-8,${encodeURIComponent(customStyle)}`} /> : null}
|
|
{children}
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default CustomStyles;
|