text: import React from "react";
  import { Link } from "react-router-dom";
  // reactstrap components
  import {
    Button,
    Collapse,
    DropdownToggle,
    DropdownMenu,
    DropdownItem,
    UncontrolledDropdown,
    NavbarBrand,
    Navbar,
    NavItem,
    NavLink,
    Nav,
    Container,
    UncontrolledTooltip,
  } from "reactstrap";
  
  function IndexNavbar() {
    const [navbarColor, setNavbarColor] = React.useState("navbar-transparent");
    const [collapseOpen, setCollapseOpen] = React.useState(false);
    React.useEffect(() => {
      const updateNavbarColor = () => {
        if (
          document.documentElement.scrollTop > 399 ||
          document.body.scrollTop > 399
        ) {
          setNavbarColor("");
        } else if (
          document.documentElement.scrollTop < 400 ||
          document.body.scrollTop < 400
        ) {
          setNavbarColor("navbar-transparent");
        }
      };
      window.addEventListener("scroll", updateNavbarColor);
      return function cleanup() {
        window.removeEventListener("scroll", updateNavbarColor);
      };
    });
    return (
      <>
        {collapseOpen ? (
          <div
            id="bodyClick"
            onClick={() => {
              document.documentElement.classList.toggle("nav-open");
              setCollapseOpen(false);
            }}
          />
        ) : null}
        <Navbar className={"fixed-top " + navbarColor} expand="lg" color="info">
          <Container>
            <div className="navbar-translate">
              <NavbarBrand
                href="./index"
                target="_blank"
                id="navbar-brand"
              >
                Find-icament
              </NavbarBrand>
              <UncontrolledTooltip target="#navbar-brand">
                Find-icament, l'application médicale qui vous sécurise !
              </UncontrolledTooltip>
              <button
                className="navbar-toggler navbar-toggler"
                onClick={() => {
                  document.documentElement.classList.toggle("nav-open");
                  setCollapseOpen(!collapseOpen);
                }}
                aria-expanded={collapseOpen}
                type="button"
              >
                <span className="navbar-toggler-bar top-bar"></span>
                <span className="navbar-toggler-bar middle-bar"></span>
                <span className="navbar-toggler-bar bottom-bar"></span>
              </button>
            </div>
            <Collapse
              className="justify-content-end"
              isOpen={collapseOpen}
              navbar
            >
              <Nav navbar>
                <NavItem>
                  <NavLink
                    href="#pablo"
                    onClick={(e) => {
                      e.preventDefault();
                      document
                        .getElementById("download-section")
                        .scrollIntoView();
                    }}
                  >
                    <i className="now-ui-icons arrows-1_cloud-download-93"></i>
                    <p>Download on Playstore</p>
                  </NavLink>
                </NavItem>
                <NavItem>
                  <NavLink
                    href="#pablo"
                    onClick={(e) => {
                      e.preventDefault();
                      document
                        .getElementById("download-section")
                        .scrollIntoView();
                    }}
                  >
                    <i className="now-ui-icons arrows-1_cloud-download-93"></i>
                    <p>Download on Apple store</p>
                  </NavLink>
                  
                </NavItem>
                <UncontrolledDropdown nav>
                  <DropdownMenu>
                    <DropdownItem to="/index" tag={Link}>
                      <i className="now-ui-icons business_chart-pie-36 mr-1"></i>
                      All components
                    </DropdownItem>
                    <DropdownItem
                      href="https://demos.creative-tim.com/now-ui-kit-react/#/documentation/introduction?ref=nukr-index-navbar"
                      target="_blank"
                    >
                      <i className="now-ui-icons design_bullet-list-67 mr-1"></i>
                      Documentation
                    </DropdownItem>
                  </DropdownMenu>
                </UncontrolledDropdown>
                <NavItem>
                  <Button
                    className="nav-link btn-neutral"
                    color="info"
                    href="mailto:contact.findicament@gmail.com"
                    id="upgrade-to-pro"
                    target="_blank"
                  >
                    <i style={styles.icon} className="now-ui-icons ui-1_email-85"></i> 
                    <p> Contactez-nous !</p>
                  </Button>
                  <UncontrolledTooltip target="#upgrade-to-pro">
                    contact.findicament@gmail.com
                  </UncontrolledTooltip>
                </NavItem>
                <NavItem>
                  <NavLink
                    href="https://twitter.com/findicament"
                    target="_blank"
                    id="twitter-tooltip"
                  >
                    <i className="fab fa-twitter"></i>
                    <p className="d-lg-none d-xl-none">Twitter</p>
                  </NavLink>
                  <UncontrolledTooltip target="#twitter-tooltip">
                    Suivez-nous sur Twitter
                  </UncontrolledTooltip>
                </NavItem>
                <NavItem>
                  <Button
                  className="nav-link btn-neutral"
                  color="default"
                  to="/login-page"
                  outline
                  size="lg"
                  tag={Link}
                  >
                    View Login Page
                </Button>
                </NavItem>
              </Nav>
            </Collapse>
          </Container>
        </Navbar>
      </>
    );
  }
  
  const styles = {
    icon: {
      marginRight : 5
    }
  }
  export default IndexNavbar;
  