import React, { Component } from 'react' import Link from 'next/link' import LinkWrap from '@hashicorp/react-link-wrap' import InlineSvg from '@hashicorp/react-inline-svg' import caratIcon from './img/carat.svg?include' import downloadIcon from './img/download.svg?include' import githubIcon from './img/github.svg?include' class ProductSubnav extends Component { constructor(props) { super(props) this.state = { fixNav: true, menuOpen: false } this.toggleMenu = this.toggleMenu.bind(this) this.openSubmenu = this.openSubmenu.bind(this) this.closeSubmenu = this.closeSubmenu.bind(this) } toggleMenu() { this.setState({ menuOpen: !this.state.menuOpen }) } openSubmenu(e) { const dropdown = e.currentTarget.nextElementSibling dropdown && dropdown.classList.add('open') } closeSubmenu(e) { e.currentTarget.parentElement.classList.remove('open') } render() { const { rootUrl, buttonText, hideDownloadIcon, buttonExternal, links } = this.props const currentProduct = { slug: 'vault', siteUrl: 'https://www.vaultproject.io', downloadUrl: '/downloads', githubUrl: 'https://github.com/hashicorp/vault', colorLogo: { url: 'https://www.datocms-assets.com/2885/1509990185-vault-dark.svg', alt: 'Vault Logo' } } return (