Skip to content

Commit 8e39c18

Browse files
feat: added width and background option for nav bar
1 parent ee148f5 commit 8e39c18

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

client/packages/lowcoder/src/comps/comps/layout/navLayout.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ import { withDispatchHook } from "comps/generators/withDispatchHook";
88
import { NameAndExposingInfo } from "comps/utils/exposingTypes";
99
import { ALL_APPLICATIONS_URL } from "constants/routesURL";
1010
import { TopHeaderHeight } from "constants/style";
11-
import { Section } from "lowcoder-design";
11+
import { Section, sectionNames } from "lowcoder-design";
1212
import { trans } from "i18n";
1313
import { EditorContainer, EmptyContent } from "pages/common/styledComponent";
1414
import { useCallback, useEffect, useMemo, useState } from "react";
1515
import styled from "styled-components";
1616
import { isUserViewMode, useAppPathParam } from "util/hooks";
17+
import { StringControl } from "comps/controls/codeControl";
18+
import { styleControl } from "comps/controls/styleControl";
19+
import { NavLayoutStyle } from "comps/controls/styleControlConstants";
20+
21+
const DEFAULT_WIDTH = 240;
1722

1823
const StyledSide = styled(Layout.Sider)`
1924
max-height: calc(100vh - ${TopHeaderHeight});
@@ -46,6 +51,8 @@ let NavTmpLayout = (function () {
4651
label: trans("menuItem") + " 1",
4752
},
4853
]),
54+
width: StringControl,
55+
style: styleControl(NavLayoutStyle),
4956
};
5057
return new MultiCompBuilder(childrenMap, (props) => {
5158
return null;
@@ -54,6 +61,16 @@ let NavTmpLayout = (function () {
5461
return (
5562
<>
5663
<Section name={trans("menu")}>{menuPropertyView(children.items)}</Section>
64+
<Section name={sectionNames.layout}>
65+
{ children.width.propertyView({
66+
label: trans("drawer.width"),
67+
tooltip: trans("drawer.widthTooltip"),
68+
placeholder: DEFAULT_WIDTH + "",
69+
})}
70+
</Section>
71+
<Section name={sectionNames.style}>
72+
{ children.style.getPropertyView() }
73+
</Section>
5774
</>
5875
);
5976
})
@@ -195,7 +212,7 @@ NavTmpLayout = withViewFn(NavTmpLayout, (comp) => {
195212

196213
let content = (
197214
<Layout>
198-
<StyledSide theme="light" width={240}>
215+
<StyledSide theme="light" width={DEFAULT_WIDTH}>
199216
<AntdMenu
200217
items={menuItems}
201218
mode="inline"

client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,8 @@ export const TreeSelectStyle = [...multiSelectCommon, ...ACCENT_VALIDATE] as con
823823

824824
export const DrawerStyle = [getBackground()] as const;
825825

826+
export const NavLayoutStyle = [getBackground()] as const;
827+
826828
export const JsonEditorStyle = [LABEL] as const;
827829

828830
export const CalendarStyle = [

0 commit comments

Comments
 (0)