File tree Expand file tree Collapse file tree 3 files changed +36
-35
lines changed Expand file tree Collapse file tree 3 files changed +36
-35
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ The current release has been tested and is confirmed working with the following
67
67
68
68
## Features
69
69
70
- - NextJS version 11.1.2
70
+ - NextJS version 12.0.7
71
71
- Connect to Woocommerce GraphQL API and list name, price and display image for products
72
72
- Support for simple products and variable products
73
73
- Cart handling and checkout with WooCommerce (Cash On Delivery only for now)
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { useState } from 'react';
2
2
import { useSpring , animated } from 'react-spring' ;
3
3
import Link from 'next/link' ;
4
4
5
+ import LINKS from '../../utils/constants/LINKS' ;
6
+
5
7
/**
6
8
* Shows the mobile menu.
7
9
* Shows a X when mobile menu is expanded.
@@ -89,47 +91,26 @@ const Hamburger = () => {
89
91
< line x1 = "6" y1 = "6" x2 = "18" y2 = "18" > </ line >
90
92
</ animated . svg >
91
93
</ label >
92
-
93
94
{ isExpanded && (
94
95
< animated . div
95
96
style = { hamburgerSlideDownAnimation }
96
97
id = "mobile-menu"
97
98
className = "absolute right-0 z-10 w-full text-center text-black bg-white "
98
99
>
99
100
< ul >
100
- < li className = "w-full p-4 border-t border-gray-400 border-solid rounded" >
101
- < Link href = "/" >
102
- < a
103
- className = "inline-block px-4 py-2 no-underline hover:text-black hover:underline"
104
- href = "#"
105
- >
106
- Hjem
107
- </ a >
108
- </ Link >
109
- </ li >
110
- < li className = "w-full p-4 border-t border-gray-400 border-solid rounded" >
111
- < Link href = "/produkter" >
112
- < a
113
- className = "inline-block px-4 py-2 no-underline hover:text-black hover:underline"
114
- href = "#"
115
- >
116
- Produkter
117
- </ a >
118
- </ Link >
119
- </ li >
120
- < li
121
- id = "mobile-li"
122
- className = "w-full p-4 border-t border-b border-gray-400 border-solid rounded"
123
- >
124
- < Link href = "/kategorier" >
125
- < a
126
- className = "inline-block px-4 py-2 no-underline hover:text-black hover:underline"
127
- href = "#"
128
- >
129
- Kategorier
130
- </ a >
131
- </ Link >
132
- </ li >
101
+ { LINKS . map ( ( { id, title, href } ) => (
102
+ < li
103
+ key = { id }
104
+ id = "mobile-li"
105
+ className = "w-full p-4 border-t border-gray-400 border-solid rounded"
106
+ >
107
+ < Link href = { href } >
108
+ < a className = "inline-block px-4 py-2 no-underline hover:text-black hover:underline" >
109
+ { title }
110
+ </ a >
111
+ </ Link >
112
+ </ li >
113
+ ) ) }
133
114
</ ul >
134
115
</ animated . div >
135
116
) }
Original file line number Diff line number Diff line change
1
+ //exports.default = [
2
+ const LINKS = [
3
+ {
4
+ id : 0 ,
5
+ title : 'Hjem' ,
6
+ href : '/' ,
7
+ } ,
8
+ {
9
+ id : 1 ,
10
+ title : 'Produkter' ,
11
+ href : '/produkter' ,
12
+ } ,
13
+ {
14
+ id : 2 ,
15
+ title : 'Kategorier' ,
16
+ href : '/kategorier' ,
17
+ } ,
18
+ ] ;
19
+
20
+ export default LINKS ;
You can’t perform that action at this time.
0 commit comments