2021-10-14 18:44:59 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2023-05-28 14:38:10 +00:00
|
|
|
import { PureComponent } from 'react';
|
|
|
|
|
2023-05-31 21:43:39 +00:00
|
|
|
import { IntlProvider } from 'react-intl';
|
2023-05-28 14:38:10 +00:00
|
|
|
|
2023-05-31 21:43:39 +00:00
|
|
|
import { getLocale, onProviderError } from 'mastodon/locales';
|
2021-10-14 18:44:59 +00:00
|
|
|
|
2023-05-31 21:43:39 +00:00
|
|
|
const { messages } = getLocale();
|
2021-10-14 18:44:59 +00:00
|
|
|
|
2023-05-28 12:18:23 +00:00
|
|
|
export default class AdminComponent extends PureComponent {
|
2021-10-14 18:44:59 +00:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
locale: PropTypes.string.isRequired,
|
|
|
|
children: PropTypes.node.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
render () {
|
|
|
|
const { locale, children } = this.props;
|
|
|
|
|
|
|
|
return (
|
2023-05-31 21:43:39 +00:00
|
|
|
<IntlProvider locale={locale} messages={messages} onError={onProviderError}>
|
2021-10-14 18:44:59 +00:00
|
|
|
{children}
|
|
|
|
</IntlProvider>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|