Skip to content

Commit 8d04fae

Browse files
authored
Studio: fix setting menu not open if no sites (#340)
* Studio: fix setting menu not open if no sites * Update: Fix bug based on comments
1 parent e0d4770 commit 8d04fae

2 files changed

Lines changed: 32 additions & 32 deletions

File tree

‎src/components/app.tsx‎

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,45 @@ import { cx } from '../lib/cx';
99
import MainSidebar from './main-sidebar';
1010
import Onboarding from './onboarding';
1111
import { SiteContentTabs } from './site-content-tabs';
12+
import UserSettings from './user-settings';
1213
import WindowsTitlebar from './windows-titlebar';
1314

1415
export default function App() {
1516
useLocalizationSupport();
1617
const { needsOnboarding } = useOnboarding();
1718

18-
if ( needsOnboarding ) {
19-
return (
20-
<VStack
21-
className={ cx( 'h-screen backdrop-blur-3xl app-drag-region select-none' ) }
22-
spacing="0"
23-
>
24-
{ isWindows() && <WindowsTitlebar className="h-titlebar-win flex-shrink-0" /> }
25-
<Onboarding />
26-
</VStack>
27-
);
28-
}
29-
3019
return (
31-
<VStack
32-
className={ cx(
33-
'h-screen bg-chrome backdrop-blur-3xl ltr:pr-chrome rtl:pl-chrome app-drag-region select-none',
34-
isWindows() && 'pt-0 pb-chrome',
35-
! isWindows() && 'py-chrome'
36-
) }
37-
spacing="0"
38-
>
39-
{ isWindows() && <WindowsTitlebar className="h-titlebar-win flex-shrink-0" /> }
40-
<HStack spacing="0" alignment="left" className="flex-grow">
41-
<MainSidebar className="basis-52 flex-shrink-0 h-full" />
42-
<main
43-
data-testid="site-content"
44-
className="bg-white h-full flex-grow rounded-chrome overflow-hidden"
20+
<>
21+
{ needsOnboarding ? (
22+
<VStack
23+
className={ cx( 'h-screen backdrop-blur-3xl app-drag-region select-none' ) }
24+
spacing="0"
4525
>
46-
<SiteContentTabs />
47-
</main>
48-
</HStack>
49-
</VStack>
26+
{ isWindows() && <WindowsTitlebar className="h-titlebar-win flex-shrink-0" /> }
27+
<Onboarding />
28+
</VStack>
29+
) : (
30+
<VStack
31+
className={ cx(
32+
'h-screen bg-chrome backdrop-blur-3xl ltr:pr-chrome rtl:pl-chrome app-drag-region select-none',
33+
isWindows() && 'pt-0 pb-chrome',
34+
! isWindows() && 'py-chrome'
35+
) }
36+
spacing="0"
37+
>
38+
{ isWindows() && <WindowsTitlebar className="h-titlebar-win flex-shrink-0" /> }
39+
<HStack spacing="0" alignment="left" className="flex-grow">
40+
<MainSidebar className="basis-52 flex-shrink-0 h-full" />
41+
<main
42+
data-testid="site-content"
43+
className="bg-white h-full flex-grow rounded-chrome overflow-hidden"
44+
>
45+
<SiteContentTabs />
46+
</main>
47+
</HStack>
48+
</VStack>
49+
) }
50+
<UserSettings />
51+
</>
5052
);
5153
}

‎src/components/main-sidebar.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import offlineIcon from './offline-icon';
1313
import { RunningSites } from './running-sites';
1414
import SiteMenu from './site-menu';
1515
import Tooltip from './tooltip';
16-
import UserSettings from './user-settings';
1716
import { WordPressLogo } from './wordpress-logo';
1817

1918
interface MainSidebarProps {
@@ -143,7 +142,6 @@ export default function MainSidebar( { className }: MainSidebarProps ) {
143142
<div className="mb-[6px]">
144143
<SidebarAuthFooter />
145144
</div>
146-
<UserSettings />
147145
</div>
148146
</div>
149147
</div>

0 commit comments

Comments
 (0)