mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-23 13:28:07 +01:00
28 lines
607 B
JavaScript
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>
|
|
);
|
|
}
|
|
|
|
}
|