2019-12-06 13:18:55 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import classnames from 'classnames';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
2020-05-22 14:51:38 +00:00
|
|
|
const CheckoutForm = ( {
|
|
|
|
className,
|
|
|
|
children,
|
|
|
|
onSubmit = ( event ) => void event,
|
|
|
|
} ) => {
|
|
|
|
const formOnSubmit = ( event ) => {
|
|
|
|
event.preventDefault();
|
|
|
|
onSubmit( event );
|
|
|
|
};
|
2020-08-31 10:17:42 +00:00
|
|
|
|
2019-12-06 13:18:55 +00:00
|
|
|
return (
|
2020-05-22 14:51:38 +00:00
|
|
|
<form
|
2020-08-31 10:17:42 +00:00
|
|
|
className={ classnames( 'wc-block-components-form', className ) }
|
2020-05-22 14:51:38 +00:00
|
|
|
onSubmit={ formOnSubmit }
|
|
|
|
>
|
2019-12-06 13:18:55 +00:00
|
|
|
{ children }
|
|
|
|
</form>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
CheckoutForm.propTypes = {
|
|
|
|
className: PropTypes.string,
|
|
|
|
children: PropTypes.node,
|
2020-05-22 14:51:38 +00:00
|
|
|
onSubmit: PropTypes.func,
|
2019-12-06 13:18:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default CheckoutForm;
|