import React from 'react'
import { connect } from 'react-redux'
import { withRouter } from 'react-router'
import { Route } from 'react-router-dom'
import { PAGE } from '../helper.js'
import appFactory from '../appFactory.js'
import Sidebar from './Sidebar.jsx'
class AppFullscreenManager extends React.Component {
constructor (props) {
super(props)
this.state = {
AmIMounted: false
}
}
componentDidMount = () => this.setState({AmIMounted: true})
render () {
const { props } = this
return (
{this.state.AmIMounted && (// we must wait for the component to be fully mounted to be sure the div#appFullscreenContainer exists in DOM
{
props.renderAppFullscreen({slug: 'admin_workspace_user', hexcolor: '#7d4e24', type: 'workspace'}, props.user, {})
return null
}} />
{
props.renderAppFullscreen({slug: 'admin_workspace_user', hexcolor: '#7d4e24', type: 'user'}, props.user, {})
return null
}} />
)}
)
}
}
const mapStateToProps = ({ user }) => ({ user })
export default connect(mapStateToProps)(withRouter(appFactory(AppFullscreenManager)))