Skip to content

Commit 8581002

Browse files
committed
Fix sticky footer navbar
1 parent f138011 commit 8581002

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

components/Cart/Cart.component.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { AppContext } from 'utils/context/AppContext';
88
* Currently only displays a sample cart.
99
* Displays amount of items in cart.
1010
*/
11-
const Cart = () => {
11+
const Cart = ({ stickyNav }) => {
1212
const [cart] = useContext(AppContext);
1313

1414
const productsCount =
@@ -22,7 +22,7 @@ const Cart = () => {
2222
aria-label="Handlekurv"
2323
>
2424
<svg
25-
className="fill-current"
25+
className={`${stickyNav ? 'fill-white' : 'fill-current'}`}
2626
xmlns="https://www.w3.org/2000/svg"
2727
width="55"
2828
height="55"
@@ -40,7 +40,10 @@ const Cart = () => {
4040
</Link>
4141
{/*Cart quantity */}
4242
{productsCount && (
43-
<span className="w-6 h-6 pb-2 -mt-5 text-center text-white bg-black rounded-full">
43+
<span
44+
className={`w-6 h-6 pb-2 -mt-5 text-center rounded-full
45+
${stickyNav ? 'text-black bg-white' : 'text-white bg-black'}`}
46+
>
4447
{productsCount}
4548
</span>
4649
)}

components/Footer/Stickynav.component.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import Hamburger from '../Header/Hamburger.component';
1313
const Stickynav = () => (
1414
<nav
1515
id="footer"
16-
className="fixed bottom-0 z-50 w-full py-1 bg-white md:hidden lg:hidden xl:hidden"
16+
className="fixed bottom-0 z-50 w-full md:hidden lg:hidden xl:hidden"
1717
>
18-
<div className="container flex flex-wrap items-center justify-between px-6 py-3 mx-auto mt-0 md:min-w-96">
18+
<div className="container flex flex-wrap items-center justify-between px-6 py-3 mx-auto mt-0 md:min-w-96 bg-blue-800">
1919
<Hamburger />
2020
<div
2121
className="order-3 hidden w-full md:flex md:items-center md:w-auto md:order-1"
@@ -41,7 +41,7 @@ const Stickynav = () => (
4141
<div className="flex items-center order-2 md:order-3" id="nav-content">
4242
<Search />
4343
<SVGMobileSearchIcon />
44-
<Cart />
44+
<Cart stickyNav />
4545
</div>
4646
</div>
4747
</nav>

components/Header/Hamburger.component.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const Hamburger = () => {
4949
const opacityFull = 'opacity-100 group-hover:opacity-100';
5050

5151
return (
52-
<div className="z-50 md:hidden lg:hidden xl:hidden bg-gray-800">
52+
<div className="z-50 md:hidden lg:hidden xl:hidden bg-blue-800">
5353
<button
5454
className="flex flex-col w-16 rounded justify-center items-center group"
5555
data-cy="hamburger"

components/SVG/SVGMobileSearchIcon.component.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ const SVGMobileSearchIcon = () => {
3232
onClick={() => {
3333
setisExpanded(!isExpanded);
3434
}}
35-
fill="#000000"
35+
fill="#fff"
3636
xmlns="https://www.w3.org/2000/svg"
3737
viewBox="0 0 50 50"
38-
width="20px"
39-
height="20px"
38+
width="35px"
39+
height="35px"
4040
>
4141
<path d="M 21 3 C 11.601563 3 4 10.601563 4 20 C 4 29.398438 11.601563 37 21 37 C 24.355469 37 27.460938 36.015625 30.09375 34.34375 L 42.375 46.625 L 46.625 42.375 L 34.5 30.28125 C 36.679688 27.421875 38 23.878906 38 20 C 38 10.601563 30.398438 3 21 3 Z M 21 7 C 28.199219 7 34 12.800781 34 20 C 34 27.199219 28.199219 33 21 33 C 13.800781 33 8 27.199219 8 20 C 8 12.800781 13.800781 7 21 7 Z" />
4242
</svg>

0 commit comments

Comments
 (0)