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