@iobroker/adapter-react-v5
Version:
React components to develop ioBroker interfaces with react.
52 lines • 2.17 kB
JavaScript
/**
* Copyright 2021-2024 ioBroker GmbH
*
* MIT License
*
*/
import React, { useEffect } from 'react';
import { CircularProgress } from '@mui/material';
// import './Vendor.css'
const vendorStyles = `
.logo-background-light, .logo-background-colored {
background: white;
}
.logo-background-dark, .logo-background-blue {
background: black;
}
`;
export function LoaderVendor(props) {
useEffect(() => {
if (!window.document.getElementById('vendor-iobroker-component')) {
const style = window.document.createElement('style');
style.setAttribute('id', 'vendor-iobroker-component');
style.innerHTML = vendorStyles;
window.document.head.appendChild(style);
}
}, []);
const theme = props.themeType || props.themeName || 'light';
return (React.createElement("div", { className: `vendor-logo-back logo-background-${theme}`, style: {
display: 'flex',
flexDirection: 'column',
height: '100%',
width: '10%',
margin: 'auto',
backgroundImage: props.backgroundImage && props.backgroundImage !== '@@loginBackgroundImage@@'
? props.backgroundImage
: window.loadingBackgroundImage && window.loadingBackgroundImage !== '@@loginBackgroundImage@@'
? `url(${window.loadingBackgroundImage})`
: undefined,
backgroundColor: props.backgroundColor && props.backgroundColor !== '@@loginBackgroundColor@@'
? props.backgroundColor
: window.loadingBackgroundColor && window.loadingBackgroundColor !== '@@loginBackgroundColor@@'
? window.loadingBackgroundColor
: props.themeType === 'dark'
? '#000'
: '#FFF',
backgroundSize: 'cover',
} },
React.createElement("div", { style: { flexGrow: 1 } }),
React.createElement(CircularProgress, { color: "secondary", size: props.size || 200, thickness: 5 }),
React.createElement("div", { style: { flexGrow: 1 } })));
}
//# sourceMappingURL=Vendor.js.map