└── CompareButton.jsx /CompareButton.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from 'react'; 2 | import { connect } from 'react-redux'; 3 | //import { Link } from 'react-router-dom'; 4 | import { changeSellersComparison } from '../../actions/sellers_comparison'; 5 | import { ModalConfirmation } from '../../UI/ModalConfirmation/ModalConfirmation'; 6 | import { ReactComponent as CloseIcon } from '../../img/ui/close_icon.svg'; 7 | 8 | import classes from './CompareButton.module.css'; 9 | //import { routes } from '../../providers/AppRoutes/AppRoutes.data'; 10 | 11 | const CompareButton = ({ 12 | sellers_comparison: { sellersInComparsion }, 13 | changeSellersComparison, 14 | className = '' 15 | }) => { 16 | const [isOpen, setOpen] = useState(false); 17 | 18 | const onApprove = () => { 19 | changeSellersComparison([]); 20 | setOpen(false); 21 | }; 22 | 23 | const openModal = () => { 24 | setOpen(true); 25 | }; 26 | 27 | if (!sellersInComparsion.length) return null; 28 | 29 | return ( 30 |