Actually move Layout.Sidebar out of WrappedRoute and into UI

This commit is contained in:
Alex Gleason 2022-04-28 18:26:30 -05:00
parent 2c542e4548
commit a23fb9f1aa
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 12 additions and 17 deletions

View File

@ -13,7 +13,9 @@ import { fetchCustomEmojis } from 'soapbox/actions/custom_emojis';
import { fetchMarker } from 'soapbox/actions/markers'; import { fetchMarker } from 'soapbox/actions/markers';
import { register as registerPushNotifications } from 'soapbox/actions/push_notifications'; import { register as registerPushNotifications } from 'soapbox/actions/push_notifications';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
import SidebarNavigation from 'soapbox/components/sidebar-navigation';
import ThumbNavigation from 'soapbox/components/thumb_navigation'; import ThumbNavigation from 'soapbox/components/thumb_navigation';
import { Layout } from 'soapbox/components/ui';
import { useAppSelector, useOwnAccount, useSoapboxConfig, useFeatures } from 'soapbox/hooks'; import { useAppSelector, useOwnAccount, useSoapboxConfig, useFeatures } from 'soapbox/hooks';
import AdminPage from 'soapbox/pages/admin_page'; import AdminPage from 'soapbox/pages/admin_page';
import DefaultPage from 'soapbox/pages/default_page'; import DefaultPage from 'soapbox/pages/default_page';
@ -647,9 +649,15 @@ const UI: React.FC = ({ children }) => {
<div className='z-10 flex flex-col'> <div className='z-10 flex flex-col'>
<Navbar /> <Navbar />
<SwitchingColumnsArea> <Layout>
{children} <Layout.Sidebar>
</SwitchingColumnsArea> <SidebarNavigation />
</Layout.Sidebar>
<SwitchingColumnsArea>
{children}
</SwitchingColumnsArea>
</Layout>
{me && floatingActionButton} {me && floatingActionButton}

View File

@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import { Redirect, Route, useHistory, RouteProps, RouteComponentProps, match as MatchType } from 'react-router-dom'; 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 { Layout } from 'soapbox/components/ui';
import { useOwnAccount, useSettings } from 'soapbox/hooks'; import { useOwnAccount, useSettings } from 'soapbox/hooks';
@ -111,19 +110,7 @@ const WrappedRoute: React.FC<IWrappedRoute> = ({
} }
} }
const renderBody = (props: RouteComponentProps) => { return <Route {...rest} render={renderComponent} />;
return (
<Layout>
<Layout.Sidebar>
<SidebarNavigation />
</Layout.Sidebar>
{renderComponent(props)}
</Layout>
);
};
return <Route {...rest} render={renderBody} />;
}; };
export { export {