From a23fb9f1aa7e61fef6a3d7527b05449a769084fc Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 28 Apr 2022 18:26:30 -0500 Subject: [PATCH] Actually move Layout.Sidebar out of WrappedRoute and into UI --- app/soapbox/features/ui/index.tsx | 14 +++++++++++--- .../features/ui/util/react_router_helpers.tsx | 15 +-------------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index 8f6a9d959..05e341a66 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -13,7 +13,9 @@ import { fetchCustomEmojis } from 'soapbox/actions/custom_emojis'; import { fetchMarker } from 'soapbox/actions/markers'; import { register as registerPushNotifications } from 'soapbox/actions/push_notifications'; import Icon from 'soapbox/components/icon'; +import SidebarNavigation from 'soapbox/components/sidebar-navigation'; import ThumbNavigation from 'soapbox/components/thumb_navigation'; +import { Layout } from 'soapbox/components/ui'; import { useAppSelector, useOwnAccount, useSoapboxConfig, useFeatures } from 'soapbox/hooks'; import AdminPage from 'soapbox/pages/admin_page'; import DefaultPage from 'soapbox/pages/default_page'; @@ -647,9 +649,15 @@ const UI: React.FC = ({ children }) => {
- - {children} - + + + + + + + {children} + + {me && floatingActionButton} diff --git a/app/soapbox/features/ui/util/react_router_helpers.tsx b/app/soapbox/features/ui/util/react_router_helpers.tsx index 766ac1691..288851d29 100644 --- a/app/soapbox/features/ui/util/react_router_helpers.tsx +++ b/app/soapbox/features/ui/util/react_router_helpers.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { Redirect, Route, useHistory, RouteProps, RouteComponentProps, match as MatchType } from 'react-router-dom'; -import SidebarNavigation from 'soapbox/components/sidebar-navigation'; import { Layout } from 'soapbox/components/ui'; import { useOwnAccount, useSettings } from 'soapbox/hooks'; @@ -111,19 +110,7 @@ const WrappedRoute: React.FC = ({ } } - const renderBody = (props: RouteComponentProps) => { - return ( - - - - - - {renderComponent(props)} - - ); - }; - - return ; + return ; }; export {