File tree Expand file tree Collapse file tree 5 files changed +48
-31
lines changed Expand file tree Collapse file tree 5 files changed +48
-31
lines changed Original file line number Diff line number Diff line change 1
1
import { useState } from 'react' ;
2
- import { v4 } from 'uuid' ;
3
2
4
- import SVGCloseX from 'components/SVG/SVGCloseX.component' ;
3
+ import SVGX from "components/SVG/SVGX.component"
4
+
5
5
6
6
const CartItem = ( {
7
7
item,
@@ -16,26 +16,15 @@ const CartItem = ({
16
16
< tr className = "bg-gray-100" >
17
17
< td className = "px-4 py-2 border" >
18
18
< span >
19
- < svg
20
- id = "xsvg"
19
+ < SVGX
21
20
onClick = { ( ) => {
22
21
//setisExpanded(!isExpanded);
23
22
} }
23
+ />
24
+
25
+
24
26
25
- xmlns = "http://www.w3.org/2000/svg"
26
- width = "20"
27
- height = "20"
28
- viewBox = "0 0 20 20"
29
- fill = "none"
30
- stroke = "currentColor"
31
- strokeWidth = "2"
32
- strokeLinecap = "round"
33
- strokeLinejoin = "round"
34
- className = "feather feather-x"
35
- >
36
- < line x1 = "18" y1 = "6" x2 = "6" y2 = "18" > </ line >
37
- < line x1 = "6" y1 = "6" x2 = "18" y2 = "18" > </ line >
38
- </ svg >
27
+
39
28
40
29
</ span >
41
30
</ td >
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ const Hamburger = () => {
99
99
className = "absolute right-0 z-10 w-full text-center text-black bg-white "
100
100
>
101
101
< ul >
102
- < li className = "w-full p-4 border-b border-gray-400 border-solid rounded" >
102
+ < li className = "w-full p-4 border-b border-gray-400 border-solid rounded" >
103
103
< Link href = "/" >
104
104
< a
105
105
className = "inline-block px-4 py-2 no-underline hover:text-black hover:underline"
@@ -119,7 +119,10 @@ const Hamburger = () => {
119
119
</ a >
120
120
</ Link >
121
121
</ li >
122
- < li id = "mobile-li" className = "w-full p-4 border-b border-gray-400 border-solid rounded" >
122
+ < li
123
+ id = "mobile-li"
124
+ className = "w-full p-4 border-b border-gray-400 border-solid rounded"
125
+ >
123
126
< Link href = "/kategorier" >
124
127
< a
125
128
className = "inline-block px-4 py-2 no-underline hover:text-black hover:underline"
@@ -128,7 +131,7 @@ const Hamburger = () => {
128
131
Kategorier
129
132
</ a >
130
133
</ Link >
131
- </ li >
134
+ </ li >
132
135
</ ul >
133
136
</ animated . div >
134
137
) }
Original file line number Diff line number Diff line change 1
1
/**
2
- * The SVG that we display to close the cart or the mobile search
3
- * @param {Object } props
2
+ * The SVG that we display to close the cart or the mobile search
4
3
*/
5
- const SVGCloseX = ( props ) => {
6
-
7
-
8
- const { isExpanded, setisExpanded } = props ;
4
+ const SVGCloseX = ( ) => {
9
5
return (
10
6
< >
11
7
< svg
12
8
width = "80px"
13
9
height = "80px"
14
- onClick = { ( ) => {
15
- setisExpanded ( ! isExpanded ) ;
16
- } }
17
10
xmlns = "http://www.w3.org/2000/svg"
18
11
viewBox = "0 0 234.6 45.47"
19
12
>
Original file line number Diff line number Diff line change @@ -47,7 +47,11 @@ const SVGMobileSearchIcon = () => {
47
47
className = "absolute right-0 z-50 w-full p-4 text-black bg-white"
48
48
>
49
49
< div className = "absolute right-0 mr-6 -mt-12 cursor-pointer" >
50
- < SVGCloseX isExpanded = { isExpanded } setisExpanded = { setisExpanded } />
50
+ < SVGCloseX
51
+ onClick = { ( ) => {
52
+ setisExpanded ( ! isExpanded ) ;
53
+ } }
54
+ />
51
55
</ div >
52
56
< br />
53
57
< MobileSearch />
Original file line number Diff line number Diff line change
1
+ /**
2
+ * The SVG that we display inside of the cart to remove items
3
+ */
4
+
5
+ const SVGX = ( ) => {
6
+ return (
7
+ < >
8
+ < svg
9
+ id = "xsvg"
10
+ xmlns = "http://www.w3.org/2000/svg"
11
+ width = "20"
12
+ height = "20"
13
+ viewBox = "0 0 20 20"
14
+ fill = "none"
15
+ stroke = "currentColor"
16
+ strokeWidth = "2"
17
+ strokeLinecap = "round"
18
+ strokeLinejoin = "round"
19
+ className = "feather feather-x"
20
+ >
21
+ < line x1 = "18" y1 = "6" x2 = "6" y2 = "18" > </ line >
22
+ < line x1 = "6" y1 = "6" x2 = "18" y2 = "18" > </ line >
23
+ </ svg >
24
+ </ >
25
+ ) ;
26
+ } ;
27
+
28
+ export default SVGX ;
You can’t perform that action at this time.
0 commit comments