Create mailchimp component in react

[MAILPOET-1808]
This commit is contained in:
Pavel Dohnal
2019-04-11 14:35:50 +02:00
committed by M. Shull
parent 8d6b05a80e
commit 1a4b0f2785
2 changed files with 26 additions and 6 deletions

View File

@@ -1,21 +1,39 @@
import React from 'react';
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import MailPoet from 'mailpoet';
const MethodMailChimp = ({ setInputValid }) => {
const MethodMailChimp = ({ setInputValid, setInputInvalid, onValueChange }) => {
const [key, setKey] = useState('');
return (
<div>
MethodMailChimp
</div>
<>
<label htmlFor="paste_input" className="import_method_paste">
<div>
<span className="import_heading">{MailPoet.I18n.t('methodMailChimpLabel')}</span>
</div>
<input
id="paste_input"
type="text"
onChange={setKey}
/>
<button className="button" type="button">
{MailPoet.I18n.t('methodMailChimpVerify')}
</button>
<span className="mailpoet_mailchimp-key-status"></span>
</label>
</>
);
};
MethodMailChimp.propTypes = {
setInputValid: PropTypes.func,
setInputInvalid: PropTypes.func,
onValueChange: PropTypes.func.isRequired,
};
MethodMailChimp.defaultProps = {
setInputValid: () => {},
setInputInvalid: () => {},
};
export default MethodMailChimp;