accounts-frontend/packages/app/components/contact/ContactLink.tsx
ErickSkrauch 82abe0a746
Extract general popups markup to its own component
Split popups controllers into separate components
Implemented storybooks for all project's popups
2020-07-06 19:29:56 +03:00

28 lines
733 B
TypeScript

import React from 'react';
import { connect } from 'react-redux';
import { create as createPopup } from 'app/components/ui/popup/actions';
import ContactForm from 'app/components/contact';
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}
/>
);
}
export default connect(null, {
createContactPopup: () => createPopup({ Popup: ContactForm }),
})(ContactLink);