mirror of
https://github.com/maputnik/editor.git
synced 2026-08-26 23:17:27 +00:00
Fix double sidebars
This commit is contained in:
@@ -8,6 +8,7 @@ import { IconContext } from "react-icons";
|
|||||||
const DEFAULT_LIST_WIDTH = 200;
|
const DEFAULT_LIST_WIDTH = 200;
|
||||||
const DEFAULT_DRAWER_WIDTH = 370;
|
const DEFAULT_DRAWER_WIDTH = 370;
|
||||||
const DEFAULT_SIDEBAR_WIDTH = DEFAULT_LIST_WIDTH + DEFAULT_DRAWER_WIDTH;
|
const DEFAULT_SIDEBAR_WIDTH = DEFAULT_LIST_WIDTH + DEFAULT_DRAWER_WIDTH;
|
||||||
|
const PANEL_STYLE: React.CSSProperties = { overflow: "hidden" };
|
||||||
|
|
||||||
const SIDEBAR_LAYOUT_ID = "maputnik:sidebar-layout";
|
const SIDEBAR_LAYOUT_ID = "maputnik:sidebar-layout";
|
||||||
const SIDEBAR_INNER_LAYOUT_ID = "maputnik:sidebar-inner-layout";
|
const SIDEBAR_INNER_LAYOUT_ID = "maputnik:sidebar-inner-layout";
|
||||||
@@ -64,6 +65,7 @@ export const AppLayout: React.FC<AppLayoutProps> = (props) => {
|
|||||||
id={SIDEBAR_PANEL_ID}
|
id={SIDEBAR_PANEL_ID}
|
||||||
data-wd-key="sidebar-panel"
|
data-wd-key="sidebar-panel"
|
||||||
className={props.codeEditor ? "maputnik-layout-code-editor" : "maputnik-layout-sidebar"}
|
className={props.codeEditor ? "maputnik-layout-code-editor" : "maputnik-layout-sidebar"}
|
||||||
|
style={PANEL_STYLE}
|
||||||
defaultSize={`${DEFAULT_SIDEBAR_WIDTH}px`}
|
defaultSize={`${DEFAULT_SIDEBAR_WIDTH}px`}
|
||||||
minSize="280px"
|
minSize="280px"
|
||||||
onResize={({inPixels}) => setSidebarWidth(inPixels)}
|
onResize={({inPixels}) => setSidebarWidth(inPixels)}
|
||||||
@@ -83,6 +85,7 @@ export const AppLayout: React.FC<AppLayoutProps> = (props) => {
|
|||||||
id={LIST_PANEL_ID}
|
id={LIST_PANEL_ID}
|
||||||
data-wd-key="layer-list-panel"
|
data-wd-key="layer-list-panel"
|
||||||
className="maputnik-layout-list"
|
className="maputnik-layout-list"
|
||||||
|
style={PANEL_STYLE}
|
||||||
defaultSize={`${DEFAULT_LIST_WIDTH}px`}
|
defaultSize={`${DEFAULT_LIST_WIDTH}px`}
|
||||||
minSize="100px"
|
minSize="100px"
|
||||||
>
|
>
|
||||||
@@ -97,6 +100,7 @@ export const AppLayout: React.FC<AppLayoutProps> = (props) => {
|
|||||||
<Panel
|
<Panel
|
||||||
id={DRAWER_PANEL_ID}
|
id={DRAWER_PANEL_ID}
|
||||||
className="maputnik-layout-drawer"
|
className="maputnik-layout-drawer"
|
||||||
|
style={PANEL_STYLE}
|
||||||
defaultSize={`${DEFAULT_DRAWER_WIDTH}px`}
|
defaultSize={`${DEFAULT_DRAWER_WIDTH}px`}
|
||||||
minSize="150px"
|
minSize="150px"
|
||||||
>
|
>
|
||||||
@@ -113,7 +117,7 @@ export const AppLayout: React.FC<AppLayoutProps> = (props) => {
|
|||||||
title={t("Drag to resize the sidebar")}
|
title={t("Drag to resize the sidebar")}
|
||||||
aria-label={t("Drag to resize the sidebar")}
|
aria-label={t("Drag to resize the sidebar")}
|
||||||
/>
|
/>
|
||||||
<Panel id={MAP_PANEL_ID} className="maputnik-layout-map" minSize="200px">
|
<Panel id={MAP_PANEL_ID} className="maputnik-layout-map" style={PANEL_STYLE} minSize="200px">
|
||||||
{props.map}
|
{props.map}
|
||||||
</Panel>
|
</Panel>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -47,7 +47,6 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
// scroll-container is position: absolute
|
// scroll-container is position: absolute
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&-sidebar,
|
&-sidebar,
|
||||||
|
|||||||
Reference in New Issue
Block a user