From 3f0f758ceddaba4f4547e88abcfb5e25536559b8 Mon Sep 17 00:00:00 2001 From: Phil Owen <19691521+PhillipsOwen@users.noreply.github.com> Date: Wed, 1 May 2024 08:52:02 -0400 Subject: [PATCH] working version of the floating dialog component. --- src/app.js | 21 +++++++++++++++++---- src/utils/dialog-utils.js | 19 ++++++++++++++----- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/app.js b/src/app.js index ce89b211..190d398b 100644 --- a/src/app.js +++ b/src/app.js @@ -1,13 +1,26 @@ import React, { Fragment } from 'react'; import { Map } from '@components/map'; import BaseFloatingDialog from "@utils/dialog-utils"; -// import SubObj from "@utils/subObj"; export const App = () => { - return ( + const subObj = () => { + return ( + +
+
+ This is a dialog sub-component. +
+
+
+ ); + }; + + const floaterArgs = {title: "The dialog title.", description: "The dialog description.", openDialogImmediately:true, "dialogObject": {...subObj()}}; + + return ( - + - ); + ); }; diff --git a/src/utils/dialog-utils.js b/src/utils/dialog-utils.js index bbdba192..9e71cfdd 100644 --- a/src/utils/dialog-utils.js +++ b/src/utils/dialog-utils.js @@ -42,7 +42,7 @@ const Transition = React.forwardRef(function Transition(props, ref) { * @returns {JSX.Element} * @constructor */ -export default function BaseFloatingDialog({ title, dialogText, openDialogImmediately} ) { //, dialogObject +export default function BaseFloatingDialog({ title, description, openDialogImmediately, dialogObject} ) { const [open, setOpen] = React.useState(openDialogImmediately); // closes the dialog @@ -59,14 +59,23 @@ export default function BaseFloatingDialog({ title, dialogText, openDialogImmedi PaperComponent={PaperComponent} TransitionComponent={Transition} aria-labelledby="draggable-dialog-title" + disableEnforceFocus + style={{ pointerEvents: 'none', opacity: '100%' }} + PaperProps={{ style: { pointerEvents: 'auto'} }} + sx={{ + '.MuiBackdrop-root': { + backgroundColor: 'transparent', + } + }} > { title } - { dialogText } + { description } + { dialogObject }