Skip to content

Commit

Permalink
add: margin top to page
Browse files Browse the repository at this point in the history
  • Loading branch information
lizable committed Aug 29, 2024
1 parent d4dc34d commit 75b1b12
Showing 1 changed file with 31 additions and 25 deletions.
56 changes: 31 additions & 25 deletions react/src/components/MainLayout/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import PasswordChangeRequestAlert from '../PasswordChangeRequestAlert';
import { DRAWER_WIDTH } from '../WEBUINotificationDrawer';
import WebUIHeader from './WebUIHeader';
import WebUISider from './WebUISider';
import { App, Layout, Space, theme } from 'antd';
import { App, Button, Layout, Space, theme } from 'antd';
import { atom, useSetAtom } from 'jotai';
import { Suspense, useEffect, useLayoutEffect, useRef, useState } from 'react';
import { useNavigate, Outlet } from 'react-router-dom';
Expand Down Expand Up @@ -132,6 +132,25 @@ function MainLayout() {
backgroundColor: 'transparent',
}}
>
<Suspense
fallback={
<div>
<Layout.Header style={{ visibility: 'hidden', height: 62 }} />
</div>
}
>
<WebUISider
collapsed={sideCollapsed}
onBreakpoint={(broken) => {
if (broken) {
setSideCollapsed(true);
} else {
!compactSidebarActive && setSideCollapsed(false);
}
}}
webuiplugins={webUIPlugins}
/>
</Suspense>
<BAIContentWithDrawerArea drawerWidth={DRAWER_WIDTH}>
<Flex
ref={contentScrollFlexRef}
Expand All @@ -141,33 +160,24 @@ function MainLayout() {
style={{
// paddingLeft: token.paddingContentHorizontalLG,
// paddingRight: token.paddingContentHorizontalLG,
marginTop: 24,
paddingBottom: token.paddingContentVertical,
height: '100vh',
overflow: 'auto',
}}
>
<BAIErrorBoundary>
<Suspense
fallback={
<div>
<Layout.Header
style={{ visibility: 'hidden', height: 62 }}
/>
</div>
}
<Flex
direction="row"
align="stretch"
gap="lg"
style={{ marginTop: 100 }}
>
<WebUISider
collapsed={sideCollapsed}
onBreakpoint={(broken) => {
if (broken) {
setSideCollapsed(true);
} else {
!compactSidebarActive && setSideCollapsed(false);
}
}}
webuiplugins={webUIPlugins}
/>
</Suspense>
<Suspense>
{/* @ts-ignore */}
<backend-ai-webui id="webui-shell" ref={webUIRef} />
</Suspense>
</Flex>
{/* <Flex direction="column"> */}

{/* TODO: Breadcrumb */}
Expand Down Expand Up @@ -210,10 +220,6 @@ function MainLayout() {
<Suspense>
<Outlet />
</Suspense>
<Flex direction="column" align="start" gap="lg">
{/* @ts-ignore */}
<backend-ai-webui id="webui-shell" ref={webUIRef} />
</Flex>
</BAIErrorBoundary>
</Flex>
</BAIContentWithDrawerArea>
Expand Down

0 comments on commit 75b1b12

Please sign in to comment.