catstodon/app/javascript/mastodon/containers/admin_component.jsx
2023-05-23 17:15:17 +02:00

28 lines
607 B
JavaScript

import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { IntlProvider, addLocaleData } from 'react-intl';
import { getLocale } from '../locales';
const { localeData, messages } = getLocale();
addLocaleData(localeData);
export default class AdminComponent extends PureComponent {
static propTypes = {
locale: PropTypes.string.isRequired,
children: PropTypes.node.isRequired,
};
render () {
const { locale, children } = this.props;
return (
<IntlProvider locale={locale} messages={messages}>
{children}
</IntlProvider>
);
}
}