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

28 lines
662 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 16:58:52 +05:30
type Props = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
createContactPopup: () => void;
};
function ContactLink({ createContactPopup, ...props }: Props) {
return (
<a
href="#"
data-e2e-button="feedbackPopup"
onClick={(event) => {
event.preventDefault();
createContactPopup();
}}
{...props}
/>
);
}
2019-12-07 16:58:52 +05:30
export default connect(null, {
createContactPopup: () => createPopup({ Popup: ContactForm }),
})(ContactLink);