From de2094eb297b286915f91f962664c12415508d74 Mon Sep 17 00:00:00 2001 From: Maciej Ziarkowski Date: Mon, 25 Jan 2021 01:34:41 +0000 Subject: [PATCH] Remove categories from header, add link targets --- app/src/frontend/header.tsx | 293 +++++++++++++++++------------------- 1 file changed, 136 insertions(+), 157 deletions(-) diff --git a/app/src/frontend/header.tsx b/app/src/frontend/header.tsx index 28d64834..f4f7e204 100644 --- a/app/src/frontend/header.tsx +++ b/app/src/frontend/header.tsx @@ -1,11 +1,10 @@ -import React, { Fragment } from 'react'; +import React, { Fragment, useState } from 'react'; import { NavLink } from 'react-router-dom'; import './header.css'; import { Logo } from './components/logo'; import { User } from './models/user'; -import Categories from './building/categories'; interface HeaderProps { @@ -13,171 +12,151 @@ interface HeaderProps { animateLogo: boolean; } -interface HeaderState { - collapseMenu: boolean; -} - /** * Render the main header using a responsive design */ -class Header extends React.Component { - constructor(props) { - super(props); - this.state = {collapseMenu: true}; - this.handleClick = this.handleClick.bind(this); - this.handleNavigate = this.handleNavigate.bind(this); - } - handleClick() { - this.setState(state => ({ - collapseMenu: !state.collapseMenu - })); - } + const Header : React.FC = (props) => { + const [collapseMenu, setCollapseMenu] = useState(true); - handleNavigate() { - this.setState({ - collapseMenu: true - }); - } + const handleClick = () => setCollapseMenu(!collapseMenu); + const handleNavigate = () => setCollapseMenu(true); - render() { - return ( -
-
- - + + return ( +
+
+ + + + +
+
- -
- ); - } + ): + ( + +
  • + + Log in + +
  • +
  • + + Sign up + +
  • +
    + ) + } + +
    + +
    +
      +
    • + + Contact + +
    • +
    • + + Privacy Policy + +
    • +
    • + + Contributor Agreement + +
    • +
    • + + Code of Conduct + +
    • +
    • + + Data Accuracy Agreement + +
    • +
    • + + Ordnance Survey terms of UPRN usage + +
    • +
    + + + ); } export default Header;