Skip to content

Commit

Permalink
add: sidebar style setting
Browse files Browse the repository at this point in the history
  • Loading branch information
lizable committed Aug 29, 2024
1 parent c5ee37e commit 7de2c60
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
5 changes: 5 additions & 0 deletions react/src/components/BAIMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ const BAIMenu: React.FC<MenuProps> = ({ ...props }) => {
Menu: {
itemBorderRadius: 20,
itemMarginInline: 0,
colorPrimaryBorder: token.colorInfoHover,
itemHoverBg: token.colorInfoHover,
itemHoverColor: token.colorPrimaryBg,
itemSelectedBg: token.colorInfoHover,
itemSelectedColor: token.colorPrimaryBg,
},
},
}}
Expand Down
37 changes: 18 additions & 19 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, theme } from 'antd';
import { App, 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 @@ -135,8 +135,9 @@ function MainLayout() {
<BAIContentWithDrawerArea drawerWidth={DRAWER_WIDTH}>
<Flex
ref={contentScrollFlexRef}
direction="column"
direction="row"
align="stretch"
gap="lg"
style={{
// paddingLeft: token.paddingContentHorizontalLG,
// paddingRight: token.paddingContentHorizontalLG,
Expand All @@ -155,19 +156,17 @@ function MainLayout() {
</div>
}
>
<Flex>
<WebUISider
collapsed={sideCollapsed}
onBreakpoint={(broken) => {
if (broken) {
setSideCollapsed(true);
} else {
!compactSidebarActive && setSideCollapsed(false);
}
}}
webuiplugins={webUIPlugins}
/>
</Flex>
<WebUISider
collapsed={sideCollapsed}
onBreakpoint={(broken) => {
if (broken) {
setSideCollapsed(true);
} else {
!compactSidebarActive && setSideCollapsed(false);
}
}}
webuiplugins={webUIPlugins}
/>
</Suspense>
{/* <Flex direction="column"> */}

Expand Down Expand Up @@ -211,10 +210,10 @@ function MainLayout() {
<Suspense>
<Outlet />
</Suspense>
{/* To match paddig to 16 (2+14) */}
{/* </Flex> */}
{/* @ts-ignore */}
<backend-ai-webui id="webui-shell" ref={webUIRef} />
<Flex direction="column" align="start" gap="lg">
{/* @ts-ignore */}
<backend-ai-webui id="webui-shell" ref={webUIRef} />
</Flex>
</BAIErrorBoundary>
</Flex>
</BAIContentWithDrawerArea>
Expand Down
4 changes: 2 additions & 2 deletions react/src/components/MainLayout/WebUISider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ const WebUISider: React.FC<WebUISiderProps> = (props) => {
{
label: 'Start', // t('webui.menu.Summary'),
icon: <PlayCircleOutlined />,
key: 'start', // 'summary',
key: 'summary', // 'summary',
},
{
label: 'Dashboard',
icon: <DashboardOutlined />,
key: 'summary',
key: 'dashboard',
},
{
key: 'storage',
Expand Down
1 change: 1 addition & 0 deletions resources/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"fontFamily": "'Ubuntu', Roboto, sans-serif",
"colorPrimaryBg": "#FF7A00",
"colorFillContent": "#FF9D00",
"colorInfoHover": "#FFE3B7",
"colorLink": "#FF9D00",
"colorLinkHover": "#FF9D00",
"colorSuccess": "#37B076",
Expand Down

0 comments on commit 7de2c60

Please sign in to comment.