28 lines
724 B
TypeScript
Raw Normal View History

import React from 'react';
import { connect } from 'react-redux';
import { create as createPopup } from 'app/components/ui/popup/actions';
import ContactForm from './ContactForm';
2019-12-07 13:28:52 +02:00
type Props = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
2020-05-24 02:08:24 +03:00
createContactPopup: () => void;
};
function ContactLink({ createContactPopup, ...props }: Props) {
2020-05-24 02:08:24 +03:00
return (
<a
href="#"
data-e2e-button="feedbackPopup"
onClick={(event) => {
event.preventDefault();
2020-05-24 02:08:24 +03:00
createContactPopup();
}}
{...props}
/>
);
}
2019-12-07 13:28:52 +02:00
export default connect(null, {
2020-05-24 02:08:24 +03:00
createContactPopup: () => createPopup({ Popup: ContactForm }),
})(ContactLink);