auspice
Version:
Web app for visualizing pathogen evolution
36 lines (33 loc) • 1.11 kB
JavaScript
import React from "react";
import {ThemeProvider} from 'styled-components';
import Narrative from "../narrative";
import NavBar from "../navBar";
import Controls from "../controls/controls";
import { SidebarContainer, sidebarTheme } from "./styles";
import { narrativeNavBarHeight } from "../../util/globals";
export const Sidebar = (
{sidebarOpen, width, height, displayNarrative, panelsToDisplay, narrativeTitle, mobileDisplay, navBarHandler}
) => {
return (
<ThemeProvider theme={sidebarTheme}>
<SidebarContainer left={sidebarOpen ? 0 : -1 * width} width={width} height={height}>
<NavBar
sidebar
mobileDisplay={mobileDisplay}
toggleHandler={navBarHandler}
narrativeTitle={displayNarrative ? narrativeTitle : false}
width={width}
/>
{displayNarrative ?
<Narrative
height={height - narrativeNavBarHeight}
width={width}
/> :
<Controls
mapOn={panelsToDisplay.includes("map")}
/>
}
</SidebarContainer>
</ThemeProvider>
);
};