diff --git a/web/e.cash/components/navbar/index.js b/web/e.cash/components/navbar/index.js
index 9f6b0ef9e..6b4071fd0 100644
--- a/web/e.cash/components/navbar/index.js
+++ b/web/e.cash/components/navbar/index.js
@@ -1,181 +1,175 @@
-import s from './navbar.module.css';
import Link from 'next/link';
import Image from 'next/image';
import { useEffect, useState } from 'react';
import { navitems } from '../../data/navitems';
+import { NavbarOuter, NavbarCtn } from './styles';
export default function Navbar({ announcementbar }) {
const [priceLinkText, setPriceLinkText] = useState('Buy XEC');
const [mobileMenu, setMobileMenu] = useState(false);
const [selectedDropDownMenu, setSelectedDropDownMenu] = useState(-1);
const [windowWidth, setWindowWidth] = useState('');
const handleResize = () => {
setWindowWidth(window.innerWidth);
};
const getPrice = () => {
const api =
'https://api.coingecko.com/api/v3/simple/price?ids=ecash&vs_currencies=usd';
fetch(api)
.then(response => response.json())
.then(data =>
setPriceLinkText('1 XEC = $' + data.ecash.usd.toFixed(6)),
)
.catch(err => console.log(err));
};
useEffect(() => {
// set the window width so logic for mobile or desktop menus is applied correctly
setWindowWidth(window.innerWidth);
// add event listeners for resize so we can update the screen width
window.addEventListener('resize', handleResize);
// get XEC price
getPrice();
// remove the event listener after mount to avoid memory leak
return () => {
window.removeEventListener('resize', handleResize);
};
}, []);
return (
-
+
{announcementbar && (
{announcementbar.text}
)}
-
-
-
+
+
+