2020-05-29 19:31:19 +05:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import ModalTypes from '../constants/ModalTypes';
|
|
|
|
import FixedContainer from '../containers/FixedContainer';
|
|
|
|
import StaticContainer from '../containers/StaticContainer';
|
|
|
|
import UsersModalContainer from '../containers/UsersModalContainer';
|
|
|
|
import UserSettingsModalContainer from '../containers/UserSettingsModalContainer';
|
2020-08-04 01:32:46 +05:00
|
|
|
import ProjectAddModalContainer from '../containers/ProjectAddModalContainer';
|
2020-05-29 19:31:19 +05:00
|
|
|
import Background from './Background';
|
|
|
|
|
|
|
|
const Core = ({ currentModal, currentProject }) => (
|
|
|
|
<>
|
|
|
|
{currentProject && currentProject.background && (
|
|
|
|
<Background
|
|
|
|
type={currentProject.background.type}
|
|
|
|
name={currentProject.background.name}
|
|
|
|
imageUrl={currentProject.backgroundImage && currentProject.backgroundImage.url}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
<FixedContainer />
|
|
|
|
<StaticContainer />
|
|
|
|
{currentModal === ModalTypes.USERS && <UsersModalContainer />}
|
|
|
|
{currentModal === ModalTypes.USER_SETTINGS && <UserSettingsModalContainer />}
|
2020-08-13 11:38:47 +05:00
|
|
|
{currentModal === ModalTypes.PROJECT_ADD && <ProjectAddModalContainer />}
|
2020-05-29 19:31:19 +05:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
|
|
|
|
Core.propTypes = {
|
|
|
|
currentModal: PropTypes.oneOf(Object.values(ModalTypes)),
|
|
|
|
currentProject: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
|
|
|
};
|
|
|
|
|
|
|
|
Core.defaultProps = {
|
|
|
|
currentModal: undefined,
|
|
|
|
currentProject: undefined,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Core;
|