Admin: async components

This commit is contained in:
Alex Gleason 2021-09-18 19:34:45 -05:00
parent aa54e0bd0b
commit 1e77adda34
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 19 additions and 4 deletions

View file

@ -330,6 +330,14 @@ export function InstanceModerationPanel() {
return import(/* webpackChunkName: "features/remote_timeline" */'../components/profile_media_panel');
}
export function LatestAccountsPanel() {
return import(/* webpackChunkName: "features/admin" */'../../admin/components/latest_accounts_panel');
}
export function AdminNav() {
return import(/* webpackChunkName: "features/admin" */'../../admin/components/admin_nav');
}
export function CryptoDonate() {
return import(/* webpackChunkName: "features/crypto_donate" */'../../crypto_donate');
}

View file

@ -1,8 +1,11 @@
import React from 'react';
import ImmutablePureComponent from 'react-immutable-pure-component';
import LinkFooter from '../features/ui/components/link_footer';
import AdminNav from 'soapbox/features/admin/components/admin_nav';
import LatestAccountsPanel from 'soapbox/features/admin/components/latest_accounts_panel';
import BundleContainer from 'soapbox/features/ui/containers/bundle_container';
import {
AdminNav,
LatestAccountsPanel,
} from 'soapbox/features/ui/util/async-components';
export default
class AdminPage extends ImmutablePureComponent {
@ -17,7 +20,9 @@ class AdminPage extends ImmutablePureComponent {
<div className='columns-area__panels__pane columns-area__panels__pane--left'>
<div className='columns-area__panels__pane__inner'>
<AdminNav />
<BundleContainer fetchComponent={AdminNav}>
{Component => <Component />}
</BundleContainer>
</div>
</div>
@ -29,7 +34,9 @@ class AdminPage extends ImmutablePureComponent {
<div className='columns-area__panels__pane columns-area__panels__pane--right'>
<div className='columns-area__panels__pane__inner'>
<LatestAccountsPanel limit={5} />
<BundleContainer fetchComponent={LatestAccountsPanel}>
{Component => <Component limit={5} />}
</BundleContainer>
<LinkFooter />
</div>
</div>