/** * Left panel of the log-view. Houses settings, filters, client list, etc. It's a column of content, each section is housed inside of an accordion. */ import React, { Component } from "react"; // eslint-disable-line import LoggerClientControlList from "./ClientList/LoggerClientControlList"; import LoggerDisplayControl from "./Filters/LoggerDisplayControl"; import QuickViews from "./QuickViews"; import Settings from "./Settings/Settings"; interface AccordionProps { label: string; className?: string; } interface AccordionState { visible: boolean; } class Accordion extends Component { constructor(props: AccordionProps) { super(props); this.state = { visible: true, }; this.toggleVisibility = this.toggleVisibility.bind(this); } toggleVisibility() { this.setState({ visible: !this.state.visible, }); } render() { let classes = "left-panel-accordion "; if (this.props.className) { classes = classes + this.props.className; } let contentClasses = "left-panel-accordion-content"; if (this.state.visible) { contentClasses = `${contentClasses} visible `; } return (
{ if (e.key === "Enter") { this.toggleVisibility(); } }} > {this.state.visible && } {!this.state.visible && } {this.props.label}
{this.state.visible && this.props.children}
); } } interface LeftPanelProps { fileMode?: boolean; } class LeftPanel extends Component { render() { return (
); } } export default LeftPanel;