From 27aee5c45e64f0180c4b4a495876f76570033c12 Mon Sep 17 00:00:00 2001 From: w3bdesign <45217974+w3bdesign@users.noreply.github.com> Date: Sun, 5 Jul 2020 04:38:44 +0200 Subject: [PATCH] Fix so we can close mobile search --- components/Header/Navbar.component.jsx | 103 +++++++++--------- components/SVG/SVGCloseX.component.jsx | 5 +- .../SVG/SVGMobileSearchIcon.component.jsx | 8 +- components/Search/MobileSearch.component.jsx | 6 +- package.json | 2 +- 5 files changed, 62 insertions(+), 62 deletions(-) diff --git a/components/Header/Navbar.component.jsx b/components/Header/Navbar.component.jsx index 65641a423..ab1145efb 100644 --- a/components/Header/Navbar.component.jsx +++ b/components/Header/Navbar.component.jsx @@ -12,61 +12,60 @@ import Hamburger from './Hamburger.component'; const Navbar = () => { return (
- -
+ + ); }; diff --git a/components/SVG/SVGCloseX.component.jsx b/components/SVG/SVGCloseX.component.jsx index 2ca279723..5094392bb 100644 --- a/components/SVG/SVGCloseX.component.jsx +++ b/components/SVG/SVGCloseX.component.jsx @@ -1,7 +1,7 @@ /** * The SVG that we display to close the cart or the mobile search */ -const SVGCloseX = () => { +const SVGCloseX = ({ setisExpanded }) => { return ( <> { height="80px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 234.6 45.47" + onClick={() => { + setisExpanded(false); + }} > { style={mobileSearchSlideDownAnimation} className="absolute right-0 z-50 w-full p-4 text-black bg-white" > -
- { - setisExpanded(!isExpanded); - }} - /> +
+

diff --git a/components/Search/MobileSearch.component.jsx b/components/Search/MobileSearch.component.jsx index 8b81530fd..9f42d3786 100644 --- a/components/Search/MobileSearch.component.jsx +++ b/components/Search/MobileSearch.component.jsx @@ -19,7 +19,10 @@ const MobileSearch = () => { return ( <>
- + { setSearch(text.target.value); }} /> - {search && }
diff --git a/package.json b/package.json index c5bee6fd8..0561fef59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nextjs-woocommerce", - "version": "0.9.0", + "version": "0.9.1", "description": "", "main": "index.js", "scripts": {