diff --git a/app/soapbox/features/account/components/header.tsx b/app/soapbox/features/account/components/header.tsx index f0a6d9033..fe7bb7497 100644 --- a/app/soapbox/features/account/components/header.tsx +++ b/app/soapbox/features/account/components/header.tsx @@ -22,6 +22,7 @@ import Badge from 'soapbox/components/badge'; import StillImage from 'soapbox/components/still_image'; import { HStack, IconButton, Menu, MenuButton, MenuItem, MenuList, MenuLink, MenuDivider } from 'soapbox/components/ui'; import SvgIcon from 'soapbox/components/ui/icon/svg-icon'; +import MovedNote from 'soapbox/features/account_timeline/components/moved_note'; import ActionButton from 'soapbox/features/ui/components/action-button'; import SubscriptionButton from 'soapbox/features/ui/components/subscription-button'; import { useAppDispatch, useFeatures, useOwnAccount } from 'soapbox/hooks'; @@ -725,6 +726,10 @@ const Header: React.FC = ({ account }) => { return (
+ {(account.moved && typeof account.moved === 'object') && ( + + )} +
{account.header && ( diff --git a/app/soapbox/features/account_timeline/containers/header_container.tsx b/app/soapbox/features/account_timeline/containers/header_container.tsx deleted file mode 100644 index b0acd21ac..000000000 --- a/app/soapbox/features/account_timeline/containers/header_container.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react'; - -import Header from 'soapbox/features/account/components/header'; -import { useAppSelector } from 'soapbox/hooks'; -import { makeGetAccount } from 'soapbox/selectors'; - -import MovedNote from '../components/moved_note'; - -const getAccount = makeGetAccount(); - -interface IHeaderContainer { - accountId: string, -} - -/** - * Legacy account Header container, accepting an accountId instead of an account. - * @deprecated Use account Header directly. - */ -const HeaderContainer: React.FC = ({ accountId }) => { - const account = useAppSelector(state => getAccount(state, accountId)); - - if (account) { - return ( - <> - {(account.moved && typeof account.moved === 'object') && ( - - )} -
- - ); - } else { - return null; - } -}; - -export default HeaderContainer; diff --git a/app/soapbox/pages/profile_page.tsx b/app/soapbox/pages/profile_page.tsx index 1c3a1aa2e..4756ee7b2 100644 --- a/app/soapbox/pages/profile_page.tsx +++ b/app/soapbox/pages/profile_page.tsx @@ -2,6 +2,8 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; import { Redirect, useHistory } from 'react-router-dom'; +import { Column, Layout, Tabs } from 'soapbox/components/ui'; +import Header from 'soapbox/features/account/components/header'; import LinkFooter from 'soapbox/features/ui/components/link_footer'; import BundleContainer from 'soapbox/features/ui/containers/bundle_container'; import { @@ -17,9 +19,6 @@ import { useAppSelector, useFeatures, useSoapboxConfig } from 'soapbox/hooks'; import { findAccountByUsername } from 'soapbox/selectors'; import { getAcct, isLocal } from 'soapbox/utils/accounts'; -import { Column, Layout, Tabs } from '../components/ui'; -import HeaderContainer from '../features/account_timeline/containers/header_container'; - interface IProfilePage { params?: { username?: string, @@ -90,8 +89,9 @@ const ProfilePage: React.FC = ({ params, children }) => {
- {/* @ts-ignore */} - + {account && ( +
+ )} {Component => }