import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { observer } from 'mobx-react';
import { intlShape } from 'react-intl';
import { TitleBar } from 'electron-react-titlebar';
import Link from '../ui/Link';
import InfoBar from '../ui/InfoBar';
import {
oneOrManyChildElements,
globalError as globalErrorPropType,
} from '../../prop-types';
import globalMessages from '../../i18n/globalMessages';
import { isWindows } from '../../environment';
import AppUpdateInfoBar from '../AppUpdateInfoBar';
import { GITHUB_FERDI_URL } from '../../config';
export default
@observer
class AuthLayout extends Component {
static propTypes = {
children: oneOrManyChildElements.isRequired,
error: globalErrorPropType.isRequired,
isOnline: PropTypes.bool.isRequired,
isAPIHealthy: PropTypes.bool.isRequired,
retryHealthCheck: PropTypes.func.isRequired,
isHealthCheckLoading: PropTypes.bool.isRequired,
isFullScreen: PropTypes.bool.isRequired,
installAppUpdate: PropTypes.func.isRequired,
appUpdateIsDownloaded: PropTypes.bool.isRequired,
};
state = {
shouldShowAppUpdateInfoBar: true,
};
static contextTypes = {
intl: intlShape,
};
render() {
const {
children,
error,
isOnline,
isAPIHealthy,
retryHealthCheck,
isHealthCheckLoading,
isFullScreen,
installAppUpdate,
appUpdateIsDownloaded,
} = this.props;
const { intl } = this.context;
return (
<>
{isWindows && !isFullScreen && (