Skip to content

Commit

Permalink
Merge pull request #724 from w3bdesign/dev
Browse files Browse the repository at this point in the history
Fix "method_lines" issue in components/Header/Hamburger
  • Loading branch information
w3bdesign authored Dec 9, 2021
2 parents 56ce1ae + ccac3c8 commit 08cc5d2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The current release has been tested and is confirmed working with the following

## Features

- NextJS version 11.1.2
- NextJS version 12.0.7
- Connect to Woocommerce GraphQL API and list name, price and display image for products
- Support for simple products and variable products
- Cart handling and checkout with WooCommerce (Cash On Delivery only for now)
Expand Down
49 changes: 15 additions & 34 deletions components/Header/Hamburger.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { useState } from 'react';
import { useSpring, animated } from 'react-spring';
import Link from 'next/link';

import LINKS from '../../utils/constants/LINKS';

/**
* Shows the mobile menu.
* Shows a X when mobile menu is expanded.
Expand Down Expand Up @@ -89,47 +91,26 @@ const Hamburger = () => {
<line x1="6" y1="6" x2="18" y2="18"></line>
</animated.svg>
</label>

{isExpanded && (
<animated.div
style={hamburgerSlideDownAnimation}
id="mobile-menu"
className="absolute right-0 z-10 w-full text-center text-black bg-white "
>
<ul>
<li className="w-full p-4 border-t border-gray-400 border-solid rounded">
<Link href="/">
<a
className="inline-block px-4 py-2 no-underline hover:text-black hover:underline"
href="#"
>
Hjem
</a>
</Link>
</li>
<li className="w-full p-4 border-t border-gray-400 border-solid rounded">
<Link href="/produkter">
<a
className="inline-block px-4 py-2 no-underline hover:text-black hover:underline"
href="#"
>
Produkter
</a>
</Link>
</li>
<li
id="mobile-li"
className="w-full p-4 border-t border-b border-gray-400 border-solid rounded"
>
<Link href="/kategorier">
<a
className="inline-block px-4 py-2 no-underline hover:text-black hover:underline"
href="#"
>
Kategorier
</a>
</Link>
</li>
{LINKS.map(({ id, title, href }) => (
<li
key={id}
id="mobile-li"
className="w-full p-4 border-t border-gray-400 border-solid rounded"
>
<Link href={href}>
<a className="inline-block px-4 py-2 no-underline hover:text-black hover:underline">
{title}
</a>
</Link>
</li>
))}
</ul>
</animated.div>
)}
Expand Down
20 changes: 20 additions & 0 deletions utils/constants/LINKS.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//exports.default = [
const LINKS = [
{
id: 0,
title: 'Hjem',
href: '/',
},
{
id: 1,
title: 'Produkter',
href: '/produkter',
},
{
id: 2,
title: 'Kategorier',
href: '/kategorier',
},
];

export default LINKS;

1 comment on commit 08cc5d2

@vercel
Copy link

@vercel vercel bot commented on 08cc5d2 Dec 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.