Files
opencloud/services/idp/src/App.jsx
Brandon Richardson 9bbd993dfb feat(idp): support login page background configuration
This revision introduces a new environment variable
`IDP_LOGIN_BACKGROUND_URL` that overrides the default background image
of the IDP login page when present.
2024-01-05 11:27:25 -04:00

37 lines
971 B
JavaScript

import React, { ReactElement, Suspense, lazy } from 'react';
import PropTypes from 'prop-types';
import { MuiThemeProvider } from '@material-ui/core/styles';
import { defaultTheme as theme } from 'kpop/es/theme';
import 'kpop/static/css/base.css';
import 'kpop/static/css/scrollbar.css';
import Spinner from './components/Spinner';
import * as version from './version';
const LazyMain = lazy(() => import(/* webpackChunkName: "identifier-main" */ './Main'));
console.info(`Kopano Identifier build version: ${version.build}`); // eslint-disable-line no-console
const App = ({ bgImg }): ReactElement => {
return (
<div
className='oc-login-bg'
style={{ backgroundImage: bgImg ? `url(${bgImg})` : undefined }}
>
<MuiThemeProvider theme={theme}>
<Suspense fallback={<Spinner/>}>
<LazyMain/>
</Suspense>
</MuiThemeProvider>
</div>
);
}
App.propTypes = {
bgImg: PropTypes.string
};
export default App;