You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.0 KiB
44 lines
1.0 KiB
import { useSelector } from 'react-redux';
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
import React, { useState, useEffect } from 'react';
|
|
import classNames from 'classnames';
|
|
|
|
import {
|
|
faBasketShopping,
|
|
faUser,
|
|
faLocationDot,
|
|
faPhone
|
|
} from "@fortawesome/free-solid-svg-icons";
|
|
|
|
|
|
import { Search } from './search';
|
|
import { selectCart } from '../../redux/cart/selectors';
|
|
|
|
export const Header: React.FC = () => {
|
|
//const { items, totalPrice } = useSelector(selectCart);
|
|
const [showBasketCard, setShowBasketCard] = useState(false);
|
|
const isMounted = React.useRef(false);
|
|
const updateDataHeader = () => {
|
|
setShowBasketCard(true);
|
|
console.log('clik');
|
|
}
|
|
//const totalCount = items.reduce((sum: number, item: any) => sum + item.count, 0);
|
|
|
|
//React.useEffect(() => {
|
|
if (isMounted.current) {
|
|
// const json = JSON.stringify(items);
|
|
// localStorage.setItem('cart', json);
|
|
}
|
|
isMounted.current = true;
|
|
// }, [items]);
|
|
|
|
return (
|
|
<header>
|
|
|
|
|
|
|
|
|
|
|
|
</header>
|
|
);
|
|
};
|
|
|