Skip to content

Nav Layout Fixes/Updates #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 20, 2023
Prev Previous commit
Next Next commit
feat: added width and background option for nav bar
  • Loading branch information
raheeliftikhar5 committed Nov 20, 2023
commit 8e39c185b5a75c8ebfc672eba385b7b49caf4fb9
21 changes: 19 additions & 2 deletions client/packages/lowcoder/src/comps/comps/layout/navLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ import { withDispatchHook } from "comps/generators/withDispatchHook";
import { NameAndExposingInfo } from "comps/utils/exposingTypes";
import { ALL_APPLICATIONS_URL } from "constants/routesURL";
import { TopHeaderHeight } from "constants/style";
import { Section } from "lowcoder-design";
import { Section, sectionNames } from "lowcoder-design";
import { trans } from "i18n";
import { EditorContainer, EmptyContent } from "pages/common/styledComponent";
import { useCallback, useEffect, useMemo, useState } from "react";
import styled from "styled-components";
import { isUserViewMode, useAppPathParam } from "util/hooks";
import { StringControl } from "comps/controls/codeControl";
import { styleControl } from "comps/controls/styleControl";
import { NavLayoutStyle } from "comps/controls/styleControlConstants";

const DEFAULT_WIDTH = 240;

const StyledSide = styled(Layout.Sider)`
max-height: calc(100vh - ${TopHeaderHeight});
Expand Down Expand Up @@ -46,6 +51,8 @@ let NavTmpLayout = (function () {
label: trans("menuItem") + " 1",
},
]),
width: StringControl,
style: styleControl(NavLayoutStyle),
};
return new MultiCompBuilder(childrenMap, (props) => {
return null;
Expand All @@ -54,6 +61,16 @@ let NavTmpLayout = (function () {
return (
<>
<Section name={trans("menu")}>{menuPropertyView(children.items)}</Section>
<Section name={sectionNames.layout}>
{ children.width.propertyView({
label: trans("drawer.width"),
tooltip: trans("drawer.widthTooltip"),
placeholder: DEFAULT_WIDTH + "",
})}
</Section>
<Section name={sectionNames.style}>
{ children.style.getPropertyView() }
</Section>
</>
);
})
Expand Down Expand Up @@ -195,7 +212,7 @@ NavTmpLayout = withViewFn(NavTmpLayout, (comp) => {

let content = (
<Layout>
<StyledSide theme="light" width={240}>
<StyledSide theme="light" width={DEFAULT_WIDTH}>
<AntdMenu
items={menuItems}
mode="inline"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,8 @@ export const TreeSelectStyle = [...multiSelectCommon, ...ACCENT_VALIDATE] as con

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

export const NavLayoutStyle = [getBackground()] as const;

export const JsonEditorStyle = [LABEL] as const;

export const CalendarStyle = [
Expand Down