mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-29 19:40:23 -05:00
28 lines
596 B
JavaScript
28 lines
596 B
JavaScript
import PropTypes from 'prop-types';
|
|
import { PureComponent } from 'react';
|
|
|
|
import { IntlProvider } from 'react-intl';
|
|
|
|
import { getLocale, onProviderError } from '../locales';
|
|
|
|
const { messages } = getLocale();
|
|
|
|
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} onError={onProviderError}>
|
|
{children}
|
|
</IntlProvider>
|
|
);
|
|
}
|
|
|
|
}
|