added home nav
This commit was merged in pull request #6.
This commit is contained in:
+5
-18
@@ -1,23 +1,10 @@
|
||||
"use client"
|
||||
import React, { useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import logo from '../assets/images/wrenchboard-logo-text.png';
|
||||
import getConfig from "../../Config/config"; // './../../Config/config'
|
||||
import Image from 'next/image';
|
||||
|
||||
|
||||
function Drawer({ drawer, action }) {
|
||||
var site = getConfig()[0];
|
||||
|
||||
const [itemSize, setSize] = useState('0px');
|
||||
const [item, setItem] = useState('home');
|
||||
const handler = (e, value) => {
|
||||
e.preventDefault();
|
||||
const getItems = document.querySelectorAll(`#${value} li`).length;
|
||||
if (getItems > 0) {
|
||||
setSize(`${43 * getItems}px`);
|
||||
setItem(value);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
@@ -35,7 +22,7 @@ function Drawer({ drawer, action }) {
|
||||
</a>
|
||||
</div>
|
||||
<div className="offcanvas-brand text-center mb-40">
|
||||
<img src={logo} alt="WrechBoard" />
|
||||
<Image width='260' height='57' src={logo} alt="WrechBoard" />
|
||||
</div>
|
||||
<div id="menu" className="text-left ">
|
||||
<ul className="offcanvas_main_menu">
|
||||
@@ -53,10 +40,10 @@ function Drawer({ drawer, action }) {
|
||||
id="service"
|
||||
className="menu-item-has-children active"
|
||||
>
|
||||
<Link to="/service">Service</Link>
|
||||
<a href="/service">Service</a>
|
||||
</li>
|
||||
<li>
|
||||
<Link to="/about-us">About Us</Link>
|
||||
<a href="/about-us">About Us</a>
|
||||
</li>
|
||||
|
||||
|
||||
@@ -66,7 +53,7 @@ function Drawer({ drawer, action }) {
|
||||
id="contact"
|
||||
className="menu-item-has-children active"
|
||||
>
|
||||
<Link to="/contact">Contact</Link>
|
||||
<a href="/contact">Contact</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user