Skip to content

Commit

Permalink
#8726 The new widgets on the map are under the TOC (#8751) (#8763)
Browse files Browse the repository at this point in the history
* improve widgets layout on map

* restore map layout selector
  • Loading branch information
allyoucanmap authored Nov 3, 2022
1 parent fa48ea1 commit b23c4fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion web/client/configs/localConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@
"declineUrl" : "http://www.google.com"
}
},
"FeedbackMask"
"FeedbackMask",
{ "name": "Widgets" },
{ "name": "WidgetsTray" }
],
"desktop": ["Details",
{
Expand Down
11 changes: 5 additions & 6 deletions web/client/plugins/Widgets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ compose(
compose(
heightProvider({ debounceTime: 20, closest: true, querySelector: '.fill' }),
widthProvider({ overrideWidthProvider: false }),
withProps(({ isMobileAgent, width, mapLayout, singleWidgetLayoutBreakpoint = 600 }) => {
withProps(({ isMobileAgent, width, mapLayout, singleWidgetLayoutBreakpoint = 1024 }) => {
const rightOffset = mapLayout?.right ?? 0;
const leftOffset = 0;
const viewWidth = width - (leftOffset + rightOffset + RIGHT_MARGIN);
const isSingleWidgetLayout = isMobileAgent || viewWidth <= singleWidgetLayoutBreakpoint;
const isSingleWidgetLayout = isMobileAgent || width <= singleWidgetLayoutBreakpoint;
const leftOffset = isSingleWidgetLayout ? 0 : 500;
const viewWidth = width - (rightOffset + RIGHT_MARGIN + leftOffset);
const backgroundSelectorOffset = isSingleWidgetLayout ? (isMobileAgent ? 40 : 60) : 0;
return {
backgroundSelectorOffset,
Expand All @@ -104,7 +104,6 @@ compose(
leftOffset,
viewWidth,
isSingleWidgetLayout,
singleWidgetLayoutBreakpoint,
singleWidgetLayoutMaxHeight = 300,
singleWidgetLayoutMinHeight = 200,
backgroundSelectorOffset
Expand Down Expand Up @@ -145,7 +144,7 @@ compose(
return ({
rowHeight,
className: "on-map",
breakpoints: isSingleWidgetLayout ? { xxs: 0 } : { md: singleWidgetLayoutBreakpoint, xxs: 0 },
breakpoints: isSingleWidgetLayout ? { xxs: 0 } : { md: 0 },
cols: { md: 6, xxs: 1 },
...widthOptions,
useDefaultWidthProvider: false,
Expand Down
2 changes: 1 addition & 1 deletion web/client/plugins/widgets/WidgetsTray.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default compose(
hasCollapsedWidgets: widgets.filter(({ collapsed } = {}) => collapsed).length > 0,
hasTrayWidgets: widgets.length > 0
})),
withProps(({ isMobileAgent, width, singleWidgetLayoutBreakpoint = 600 }) => {
withProps(({ isMobileAgent, width, singleWidgetLayoutBreakpoint = 1024 }) => {
return {
isSingleWidgetLayout: isMobileAgent || width <= singleWidgetLayoutBreakpoint
};
Expand Down

0 comments on commit b23c4fd

Please sign in to comment.