From 175c820f56894b57d90e644ec541d8120fc669b8 Mon Sep 17 00:00:00 2001 From: Phil Owen <19691521+PhillipsOwen@users.noreply.github.com> Date: Fri, 9 Aug 2024 15:45:38 -0400 Subject: [PATCH] improvements to the way the resize control is configured. --- src/components/dialog/base-floating-dialog.js | 19 ++++++++-------- src/components/legend/legend.js | 22 +++++++++---------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/components/dialog/base-floating-dialog.js b/src/components/dialog/base-floating-dialog.js index 5735b305..cbaf5a48 100644 --- a/src/components/dialog/base-floating-dialog.js +++ b/src/components/dialog/base-floating-dialog.js @@ -1,5 +1,5 @@ import React, { Fragment } from 'react'; -import { ToggleButtonGroup, ToggleButton, Box, Stack } from '@mui/material'; +import { ToggleButtonGroup, ToggleButton, Box, Stack, Typography } from '@mui/material'; import Draggable from "react-draggable"; import PropTypes from 'prop-types'; import { Resizable } from "react-resizable"; @@ -83,7 +83,6 @@ export default function BaseFloatingDialog({ title, index, dialogObject, dataKey axis="x" draggableOpts={{ handleSize: [20, 20] }}> + - + sx={{ p: 1, display: 'flex', alignItems: 'center', cursor: 'move', backgroundColor: 'lightblue' }}> + { title } - - - - + + + + - + { toggleLineView(newValue); }}> diff --git a/src/components/legend/legend.js b/src/components/legend/legend.js index 4ccb1fc1..610921d5 100644 --- a/src/components/legend/legend.js +++ b/src/components/legend/legend.js @@ -58,17 +58,17 @@ export const MapLegend = () => { } // define the starting size of the card - const [newWidth, setNewWidth] = React.useState(75); - const [newHeight, setNewHeight] = React.useState(600); + const [newWidth, setNewWidth] = React.useState(60); + const [newHeight, setNewHeight] = React.useState(400); // create a reference to avoid the findDOMNode deprecation issue const nodeRef = React.useRef(null); // declare the mins/maxes for the dialog content area const minWidth = 40; - const minHeight = 450; - const maxWidth = 100; - const maxHeight = 700; + const minHeight = 400; + const maxWidth = 110; + const maxHeight = 600; return ( @@ -101,22 +101,20 @@ export const MapLegend = () => { zIndex: 410, borderRadius: 'sm', visibility: legendVisibilty, - height: newHeight+60, width: newWidth, - minWidth: minWidth, minHeight: minHeight+70, maxWidth: maxWidth, maxHeight: maxHeight+70 - }} - > + width: newWidth, height: newHeight+70, + minWidth: minWidth, minHeight: minHeight+70, maxWidth: maxWidth, maxHeight: maxHeight+65 + }}> + alignItems="center">