From abcdc1fd63f1b3bec7b41707e879099ded125c60 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 18 Sep 2021 19:17:55 -0500 Subject: [PATCH] Profile: make account panels async --- .../features/account/components/header.js | 21 +++++++++++-------- .../features/ui/util/async-components.js | 8 +++++++ app/soapbox/pages/profile_page.js | 14 +++++++++---- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/app/soapbox/features/account/components/header.js b/app/soapbox/features/account/components/header.js index f5a4efe35..53a78015f 100644 --- a/app/soapbox/features/account/components/header.js +++ b/app/soapbox/features/account/components/header.js @@ -22,7 +22,8 @@ import Avatar from 'soapbox/components/avatar'; import { shortNumberFormat } from 'soapbox/utils/numbers'; import { NavLink } from 'react-router-dom'; import DropdownMenuContainer from 'soapbox/containers/dropdown_menu_container'; -import ProfileInfoPanel from '../../ui/components/profile_info_panel'; +import BundleContainer from 'soapbox/features/ui/containers/bundle_container'; +import { ProfileInfoPanel } from 'soapbox/features/ui/util/async-components'; import { debounce } from 'lodash'; import StillImage from 'soapbox/components/still_image'; import ActionButton from 'soapbox/features/ui/components/action_button'; @@ -303,12 +304,13 @@ class Header extends ImmutablePureComponent {
- { - isSmallScreen && + {isSmallScreen && (
- + + {Component => } +
- } + )}
); @@ -380,12 +382,13 @@ class Header extends ImmutablePureComponent { } - { - isSmallScreen && + {isSmallScreen && (
- + + {Component => } +
- } + )}
diff --git a/app/soapbox/features/ui/util/async-components.js b/app/soapbox/features/ui/util/async-components.js index 0c72d0b7b..278edeae4 100644 --- a/app/soapbox/features/ui/util/async-components.js +++ b/app/soapbox/features/ui/util/async-components.js @@ -314,6 +314,14 @@ export function TrendsPanel() { return import(/* webpackChunkName: "features/trends" */'../components/trends_panel'); } +export function ProfileInfoPanel() { + return import(/* webpackChunkName: "features/account_timeline" */'../components/profile_info_panel'); +} + +export function ProfileMediaPanel() { + return import(/* webpackChunkName: "features/account_gallery" */'../components/profile_media_panel'); +} + export function CryptoDonate() { return import(/* webpackChunkName: "features/crypto_donate" */'../../crypto_donate'); } diff --git a/app/soapbox/pages/profile_page.js b/app/soapbox/pages/profile_page.js index 663c77b3e..ad15d0cf3 100644 --- a/app/soapbox/pages/profile_page.js +++ b/app/soapbox/pages/profile_page.js @@ -9,10 +9,10 @@ import BundleContainer from 'soapbox/features/ui/containers/bundle_container'; import { WhoToFollowPanel, SignUpPanel, + ProfileInfoPanel, + ProfileMediaPanel, } from 'soapbox/features/ui/util/async-components'; import LinkFooter from '../features/ui/components/link_footer'; -import ProfileInfoPanel from '../features/ui/components/profile_info_panel'; -import ProfileMediaPanel from '../features/ui/components/profile_media_panel'; import { getAcct } from 'soapbox/utils/accounts'; import { displayFqn } from 'soapbox/utils/state'; import { getFeatures } from 'soapbox/utils/features'; @@ -89,7 +89,9 @@ class ProfilePage extends ImmutablePureComponent {
- + + {Component => } +
@@ -104,7 +106,11 @@ class ProfilePage extends ImmutablePureComponent { {Component => } - {account && } + {account && ( + + {Component => } + + )} {features.suggestions && ( {Component => }