mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-12 04:31:11 +00:00
refactor: AdminComponent
This commit is contained in:
parent
70085dd2ed
commit
98e87c38a4
|
@ -1,22 +0,0 @@
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { PureComponent } from 'react';
|
|
||||||
|
|
||||||
import { IntlProvider } from 'mastodon/locales';
|
|
||||||
|
|
||||||
export default class AdminComponent extends PureComponent {
|
|
||||||
|
|
||||||
static propTypes = {
|
|
||||||
children: PropTypes.node.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
render () {
|
|
||||||
const { children } = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<IntlProvider>
|
|
||||||
{children}
|
|
||||||
</IntlProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
17
app/javascript/mastodon/containers/admin_component.tsx
Normal file
17
app/javascript/mastodon/containers/admin_component.tsx
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import React, { ReactNode } from 'react';
|
||||||
|
|
||||||
|
import { IntlProvider } from 'mastodon/locales';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
children: ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
const AdminComponent: React.FC<Props> = ({ children }) => {
|
||||||
|
return (
|
||||||
|
<IntlProvider>
|
||||||
|
{children}
|
||||||
|
</IntlProvider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AdminComponent;
|
Loading…
Reference in New Issue
Block a user