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 11import { useState } from 'react' ;
2- import { v4 } from 'uuid' ;
32
4- import SVGCloseX from 'components/SVG/SVGCloseX.component' ;
3+ import SVGX from "components/SVG/SVGX.component"
4+
55
66const CartItem = ( {
77 item,
@@ -16,26 +16,15 @@ const CartItem = ({
1616 < tr className = "bg-gray-100" >
1717 < td className = "px-4 py-2 border" >
1818 < span >
19- < svg
20- id = "xsvg"
19+ < SVGX
2120 onClick = { ( ) => {
2221 //setisExpanded(!isExpanded);
2322 } }
23+ />
24+
25+
2426
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+
3928
4029 </ span >
4130 </ td >
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ const Hamburger = () => {
9999 className = "absolute right-0 z-10 w-full text-center text-black bg-white "
100100 >
101101 < 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" >
103103 < Link href = "/" >
104104 < a
105105 className = "inline-block px-4 py-2 no-underline hover:text-black hover:underline"
@@ -119,7 +119,10 @@ const Hamburger = () => {
119119 </ a >
120120 </ Link >
121121 </ 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+ >
123126 < Link href = "/kategorier" >
124127 < a
125128 className = "inline-block px-4 py-2 no-underline hover:text-black hover:underline"
@@ -128,7 +131,7 @@ const Hamburger = () => {
128131 Kategorier
129132 </ a >
130133 </ Link >
131- </ li >
134+ </ li >
132135 </ ul >
133136 </ animated . div >
134137 ) }
Original file line number Diff line number Diff line change 11/**
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
43 */
5- const SVGCloseX = ( props ) => {
6-
7-
8- const { isExpanded, setisExpanded } = props ;
4+ const SVGCloseX = ( ) => {
95 return (
106 < >
117 < svg
128 width = "80px"
139 height = "80px"
14- onClick = { ( ) => {
15- setisExpanded ( ! isExpanded ) ;
16- } }
1710 xmlns = "http://www.w3.org/2000/svg"
1811 viewBox = "0 0 234.6 45.47"
1912 >
Original file line number Diff line number Diff line change @@ -47,7 +47,11 @@ const SVGMobileSearchIcon = () => {
4747 className = "absolute right-0 z-50 w-full p-4 text-black bg-white"
4848 >
4949 < 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+ />
5155 </ div >
5256 < br />
5357 < 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