import React, { useState, useEffect } from "react"; import "./Header.css"; import { Link } from "react-router-dom"; import MenuIcon from "@material-ui/icons/Menu"; import SearchIcon from "@material-ui/icons/Search"; import RoomOutlinedIcon from "@material-ui/icons/RoomOutlined"; import ShoppingCartIcon from "@material-ui/icons/ShoppingCart"; import { useStateValue } from "../../context/StateProvider"; import { auth } from "../../firebase/firebaseConfig"; function Header() { const [{ cart, user, profile }] = useStateValue(); const [address, setAddress] = useState('') const login = () => { if (user) auth.signOut(); }; useEffect(() => { const URL = 'https://geolocation-db.com/json/697de680-a737-11ea-9820-af05f4014d91'; fetch(URL) .then(res => res.json()) .then(data => setAddress(data)); }, []) return ( ); } export default Header;