- {
- status === 'pending' ? ( Gathering chart data...
) :
- status === 'error' ? ( There was a problem with observation data for this location.
) :
-
-
-
-
- formatX_axis(value) }/>
-
-
- formatY_axis(value) } />
-
-
-
-
-
-
-
-
-
-
- }
+ {
+ status === 'pending' ? ( Gathering chart data...
) :
+ status === 'error' ? ( There was a problem with observation data for this location.
) :
+
+
+
+
+ formatX_axis(value) }/>
+
+
+ formatY_axis(value) } />
+
+
+
+
+
+
+
+
+
+
+ }
);
}
From 1f86d0bb91f1e7610b603e295ca9e423d1c3a159 Mon Sep 17 00:00:00 2001
From: Phil Owen <19691521+PhillipsOwen@users.noreply.github.com>
Date: Thu, 8 Aug 2024 15:14:59 -0400
Subject: [PATCH 2/3] making the line view buttons flex/wrap, enforcing min
width and height of the dialog content area
---
src/components/dialog/base-floating-dialog.js | 98 ++++++++++---------
1 file changed, 52 insertions(+), 46 deletions(-)
diff --git a/src/components/dialog/base-floating-dialog.js b/src/components/dialog/base-floating-dialog.js
index 2cb06750..5735b305 100644
--- a/src/components/dialog/base-floating-dialog.js
+++ b/src/components/dialog/base-floating-dialog.js
@@ -1,13 +1,10 @@
import React, { Fragment } from 'react';
-import { ToggleButtonGroup, Button, Box, Stack } from '@mui/joy'; //, Checkbox
+import { ToggleButtonGroup, ToggleButton, Box, Stack } from '@mui/material';
import Draggable from "react-draggable";
import PropTypes from 'prop-types';
-
import { Resizable } from "react-resizable";
import "react-resizable/css/styles.css";
-import { markUnclicked } from '@utils/map-utils';
-
import CssBaseline from '@mui/material/CssBaseline';
import Dialog from '@mui/material/Dialog';
import DialogContent from '@mui/material/DialogActions';
@@ -18,6 +15,8 @@ import Slide from '@mui/material/Slide';
import IconButton from '@mui/material/IconButton';
import CloseOutlinedIcon from '@mui/icons-material/CloseOutlined';
+import { markUnclicked } from '@utils/map-utils';
+
// define the properties of this component's input
BaseFloatingDialog.propTypes = {
title: PropTypes.string,
@@ -45,9 +44,14 @@ BaseFloatingDialog.propTypes = {
* @param toggleLineView - toggles the visibility of a chart line
*/
export default function BaseFloatingDialog({ title, index, dialogObject, dataKey, dataList, setDataList, map, showLineButtonView, toggleLineView } ) {
- const [newWidth, setNewWidth] = React.useState(600);
+ // declare state to capture the dialog size
+ const [newWidth, setNewWidth] = React.useState(460);
const [newHeight, setNewHeight] = React.useState(300);
+ // declare the minimums for the dialog content area
+ const minWidth = 200;
+ const minHeight = 150;
+
/**
* the close dialog handler
*/
@@ -77,9 +81,9 @@ export default function BaseFloatingDialog({ title, index, dialogObject, dataKey
setNewHeight(newHeight + event.movementY);
}}
axis="x"
- draggableOpts={{ handleSize: [20, 20] }}
- >
+ draggableOpts={{ handleSize: [20, 20] }}>