From 4d5a32edcb887af4d1ab2aac483c6e439a3e5c43 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 11 Aug 2022 11:59:38 -0500 Subject: [PATCH] Delete unnecessary middleman account Header component --- .../account_timeline/components/header.tsx | 32 ------------------- .../containers/header_container.tsx | 12 +++++-- 2 files changed, 10 insertions(+), 34 deletions(-) delete mode 100644 app/soapbox/features/account_timeline/components/header.tsx diff --git a/app/soapbox/features/account_timeline/components/header.tsx b/app/soapbox/features/account_timeline/components/header.tsx deleted file mode 100644 index 6ed8ffd83..000000000 --- a/app/soapbox/features/account_timeline/components/header.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import React from 'react'; - -import InnerHeader from 'soapbox/features/account/components/header'; - -import MovedNote from './moved_note'; - -import type { Account } from 'soapbox/types/entities'; - -interface IHeader { - account?: Account, -} - -/** - * Legacy account header middleman component that exists for no reason. - * @deprecated Use account Header directly. - */ -const Header: React.FC = ({ account }) => { - if (!account) { - return null; - } - - return ( - <> - {(account.moved && typeof account.moved === 'object') && ( - - )} - - - ); -}; - -export default Header; diff --git a/app/soapbox/features/account_timeline/containers/header_container.tsx b/app/soapbox/features/account_timeline/containers/header_container.tsx index bb303153c..b0acd21ac 100644 --- a/app/soapbox/features/account_timeline/containers/header_container.tsx +++ b/app/soapbox/features/account_timeline/containers/header_container.tsx @@ -1,9 +1,10 @@ import React from 'react'; +import Header from 'soapbox/features/account/components/header'; import { useAppSelector } from 'soapbox/hooks'; import { makeGetAccount } from 'soapbox/selectors'; -import Header from '../components/header'; +import MovedNote from '../components/moved_note'; const getAccount = makeGetAccount(); @@ -19,7 +20,14 @@ const HeaderContainer: React.FC = ({ accountId }) => { const account = useAppSelector(state => getAccount(state, accountId)); if (account) { - return
; + return ( + <> + {(account.moved && typeof account.moved === 'object') && ( + + )} +
+ + ); } else { return null; }