From 6ace7722a6135cd883416f9333b7f8e5c7353d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 24 Aug 2024 14:40:06 +0200 Subject: [PATCH] Remove unused code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/features/ui/components/columns-area.tsx | 31 ------------- src/features/ui/util/react-router-helpers.tsx | 44 +++++-------------- 2 files changed, 12 insertions(+), 63 deletions(-) delete mode 100644 src/features/ui/components/columns-area.tsx diff --git a/src/features/ui/components/columns-area.tsx b/src/features/ui/components/columns-area.tsx deleted file mode 100644 index e64ee449f..000000000 --- a/src/features/ui/components/columns-area.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import React from 'react'; - -import { Layout } from '../../../components/ui'; - -interface IColumnsArea { - layout: any; - children: React.ReactNode; -} - -const ColumnsArea: React.FC = (props) => { - const { children } = props; - const layout = props.layout || { LEFT: null, RIGHT: null }; - - return ( - - - {layout.LEFT} - - - - {children} - - - - {layout.RIGHT} - - - ); -}; - -export { ColumnsArea as default }; diff --git a/src/features/ui/util/react-router-helpers.tsx b/src/features/ui/util/react-router-helpers.tsx index a1f80f04d..6c5256af7 100644 --- a/src/features/ui/util/react-router-helpers.tsx +++ b/src/features/ui/util/react-router-helpers.tsx @@ -7,21 +7,18 @@ import { useOwnAccount, useSettings } from 'soapbox/hooks'; import ColumnForbidden from '../components/column-forbidden'; import ColumnLoading from '../components/column-loading'; -import ColumnsArea from '../components/columns-area'; import ErrorColumn from '../components/error-column'; type PageProps = { params?: MatchType['params']; - layout?: any; children: React.ReactNode; }; interface IWrappedRoute extends RouteProps { component: React.LazyExoticComponent; - page?: React.ComponentType; + page: React.ComponentType; content?: React.ReactNode; componentParams?: Record; - layout?: any; publicRoute?: boolean; staffOnly?: boolean; adminOnly?: boolean; @@ -33,7 +30,6 @@ const WrappedRoute: React.FC = ({ page: Page, content, componentParams = {}, - layout, publicRoute = false, staffOnly = false, adminOnly = false, @@ -45,33 +41,17 @@ const WrappedRoute: React.FC = ({ const { account } = useOwnAccount(); const { isDeveloper } = useSettings(); - const renderComponent = ({ match }: RouteComponentProps) => { - if (Page) { - return ( - - }> - - - {content} - - - - - ); - } - - return ( - - }> - - - {content} - - - - - ); - }; + const renderComponent = ({ match }: RouteComponentProps) => ( + + }> + + + {content} + + + + + ); const loginRedirect = () => { const actualUrl = encodeURIComponent(`${history.location.pathname}${history.location.search}`);