Layout: standalone fixes

This commit is contained in:
Alex Gleason 2022-04-28 18:57:50 -05:00
parent 8134b5d016
commit 3d0e9200c2
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 6 additions and 2 deletions

View file

@ -28,6 +28,7 @@ import RemoteInstancePage from 'soapbox/pages/remote_instance_page';
import StatusPage from 'soapbox/pages/status_page'; import StatusPage from 'soapbox/pages/status_page';
import { getAccessToken } from 'soapbox/utils/auth'; import { getAccessToken } from 'soapbox/utils/auth';
import { getVapidKey } from 'soapbox/utils/auth'; import { getVapidKey } from 'soapbox/utils/auth';
import { isStandalone } from 'soapbox/utils/state';
import { fetchFollowRequests } from '../../actions/accounts'; import { fetchFollowRequests } from '../../actions/accounts';
import { fetchReports, fetchUsers, fetchConfig } from '../../actions/admin'; import { fetchReports, fetchUsers, fetchConfig } from '../../actions/admin';
@ -346,6 +347,7 @@ const UI: React.FC = ({ children }) => {
const dropdownMenuIsOpen = useAppSelector(state => state.dropdown_menu.get('openId') !== null); const dropdownMenuIsOpen = useAppSelector(state => state.dropdown_menu.get('openId') !== null);
const accessToken = useAppSelector(state => getAccessToken(state)); const accessToken = useAppSelector(state => getAccessToken(state));
const streamingUrl = useAppSelector(state => state.instance.urls.get('streaming_api')); const streamingUrl = useAppSelector(state => state.instance.urls.get('streaming_api'));
const standalone = useAppSelector(isStandalone);
const handleDragEnter = (e: DragEvent) => { const handleDragEnter = (e: DragEvent) => {
e.preventDefault(); e.preventDefault();
@ -651,7 +653,7 @@ const UI: React.FC = ({ children }) => {
<Layout> <Layout>
<Layout.Sidebar> <Layout.Sidebar>
<SidebarNavigation /> {!standalone && <SidebarNavigation />}
</Layout.Sidebar> </Layout.Sidebar>
<SwitchingColumnsArea> <SwitchingColumnsArea>

View file

@ -8,11 +8,13 @@ import {
SignUpPanel, SignUpPanel,
} from 'soapbox/features/ui/util/async-components'; } from 'soapbox/features/ui/util/async-components';
import { useAppSelector, useFeatures } from 'soapbox/hooks'; import { useAppSelector, useFeatures } from 'soapbox/hooks';
import { isStandalone } from 'soapbox/utils/state';
import { Layout } from '../components/ui'; import { Layout } from '../components/ui';
const DefaultPage: React.FC = ({ children }) => { const DefaultPage: React.FC = ({ children }) => {
const me = useAppSelector(state => state.me); const me = useAppSelector(state => state.me);
const standalone = useAppSelector(isStandalone);
const features = useFeatures(); const features = useFeatures();
return ( return (
@ -22,7 +24,7 @@ const DefaultPage: React.FC = ({ children }) => {
</Layout.Main> </Layout.Main>
<Layout.Aside> <Layout.Aside>
{!me && ( {!me && !standalone && (
<BundleContainer fetchComponent={SignUpPanel}> <BundleContainer fetchComponent={SignUpPanel}>
{Component => <Component key='sign-up-panel' />} {Component => <Component key='sign-up-panel' />}
</BundleContainer> </BundleContainer>