accounts-frontend/packages/app/components/contact/ContactLink.tsx

29 lines
736 B
TypeScript
Raw Permalink Normal View History

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