2018-05-05 13:12:29 +05:30
|
|
|
// @flow
|
2019-06-30 19:02:50 +05:30
|
|
|
import type { ElementConfig } from 'react';
|
2018-05-05 13:12:29 +05:30
|
|
|
import React from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { create as createPopup } from 'components/ui/popup/actions';
|
|
|
|
import ContactForm from './ContactForm';
|
|
|
|
|
2019-06-30 19:02:50 +05:30
|
|
|
type OwnProps = $Exact<ElementConfig<'a'>>;
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
...OwnProps,
|
|
|
|
createContactPopup: () => void,
|
|
|
|
};
|
|
|
|
|
2018-11-10 14:33:47 +05:30
|
|
|
function ContactLink({
|
|
|
|
createContactPopup,
|
|
|
|
...props
|
2019-06-30 19:02:50 +05:30
|
|
|
}: Props) {
|
2018-05-05 13:12:29 +05:30
|
|
|
return (
|
2018-11-10 14:33:47 +05:30
|
|
|
<a
|
|
|
|
href="#"
|
|
|
|
data-e2e-button="feedbackPopup"
|
|
|
|
onClick={(event) => {
|
|
|
|
event.preventDefault();
|
2018-05-05 13:12:29 +05:30
|
|
|
|
2018-11-10 14:33:47 +05:30
|
|
|
createContactPopup();
|
|
|
|
}}
|
|
|
|
{...props}
|
|
|
|
/>
|
2018-05-05 13:12:29 +05:30
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2019-06-30 19:02:50 +05:30
|
|
|
export default connect<Props, OwnProps, _, _, _, _>(
|
2018-11-10 14:33:47 +05:30
|
|
|
null,
|
|
|
|
{
|
2019-06-30 19:02:50 +05:30
|
|
|
createContactPopup: () => createPopup({ Popup: ContactForm })
|
2018-11-10 14:33:47 +05:30
|
|
|
}
|
|
|
|
)(ContactLink);
|