Vulcan/packages/vulcan-forms/lib/components/FormIntl.jsx

23 lines
750 B
React
Raw Normal View History

import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
2018-05-10 17:17:44 +09:00
import { Components, registerComponent, Locales } from 'meteor/vulcan:core';
class FormIntl extends PureComponent {
render() {
// do not pass FormIntl's own value, inputProperties, and intlInput props down
const properties = _.omit(this.props, 'value', 'inputProperties', 'intlInput');
return (
<div className="form-intl">
2018-05-10 17:17:44 +09:00
{Locales.map(locale => (
<div className={`form-intl-${locale.id}`} key={locale.id}>
<Components.FormComponent {...properties} label={`${this.props.label} (${locale.label})`} locale={locale.id} />
</div>
))}
</div>
);
}
}
registerComponent('FormIntl', FormIntl);