-
chris authored6e459269
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Editors.js 1.55 KiB
import React, { useState } from 'react';
import styled from 'styled-components';
import { createGlobalStyle } from 'styled-components';
import Editoria from './Editoria/Editoria';
import HHMI from './HHMI/HHMI';
const GlobalStyle = createGlobalStyle`
body {
margin: 0;
overflow-y: hidden;
padding: 0;
}
#root {
height:100vh;
width:100vw;
}
`;
const ProjectContainer = styled.div`
display: flex;
height: calc(100% - 55px);
`;
const ChooseProject = styled.div`
background: #fff;
display: flex;
flex-direction: row;
align-items: center;
height: 50px;
span {
margin-right: 20px;
}
`;
const Projects = styled.div`
margin-left: 10px;
`;
const ProjectButton = styled.button`
cursor: pointer;
margin-right: 20px;
`;
const Editors = () => {
const [project, setProject] = useState('editoria');
const displayProject = () => {
switch (project) {
case 'hhmi':
return <HHMI />;
case 'ncbi':
break;
default:
return <HHMI />;
}
};
return (
<>
<GlobalStyle />
<ChooseProject>
<Projects>
<span>Select Project:</span>
<ProjectButton onClick={() => setProject('editoria')}>
Editoria
</ProjectButton>
<ProjectButton onClick={() => setProject('hhmi')}>HHMI</ProjectButton>
{/* <ProjectButton onClick={() => setProject('ncbi')}>NCBI</ProjectButton> */}
</Projects>
</ChooseProject>
<ProjectContainer>{displayProject()}</ProjectContainer>
</>
);
};
export default Editors;