import React from 'react'; import classnames from 'classnames'; import translate from 'translations'; import { navigationLinks } from 'config'; import NavigationLink from 'components/NavigationLink'; import NetworkSelect from './NetworkSelect'; import LanguageSelect from './LanguageSelect'; import NetworkStatus from './NetworkStatus'; import './ElectronNav.scss'; interface State { panelContent: React.ReactElement | null; isPanelOpen: boolean; } export default class ElectronNav extends React.Component<{}, State> { public state: State = { panelContent: null, isPanelOpen: false }; public render() { const { panelContent, isPanelOpen } = this.state; return (
Alpha Release
    {navigationLinks.map(link => ( ))}
{panelContent}
); } private openLanguageSelect = () => { const panelContent = ; this.setState({ panelContent, isPanelOpen: true }); }; private openNodeSelect = () => { const panelContent = ; this.setState({ panelContent, isPanelOpen: true }); }; private closePanel = () => { const { panelContent } = this.state; // Start closing panel this.setState({ isPanelOpen: false }); // Remove content when out of sight setTimeout(() => { if (this.state.panelContent === panelContent) { this.setState({ panelContent: null }); } }, 300); }; }