From aeef1710cd6b5f765b199c130df9096faa607462 Mon Sep 17 00:00:00 2001 From: yoonie-jang Date: Thu, 3 Oct 2024 15:44:41 -0400 Subject: [PATCH] Convert modal to dialog --- demo/src/MemoryModelsUserInput.tsx | 67 +++++++++---------- .../__tests__/MemoryModelsUserInput.spec.tsx | 6 +- 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/demo/src/MemoryModelsUserInput.tsx b/demo/src/MemoryModelsUserInput.tsx index f1e49298..a7c7bb73 100644 --- a/demo/src/MemoryModelsUserInput.tsx +++ b/demo/src/MemoryModelsUserInput.tsx @@ -11,6 +11,9 @@ import { Stack, Modal, Paper, + Dialog, + DialogActions, + DialogContent, } from "@mui/material"; import DownloadJSONButton from "./DownloadJSONButton"; import MemoryModelsMenu from "./MemoryModelsMenu"; @@ -79,46 +82,36 @@ function MemoryModelsFileInput(props: MemoryModelsFileInputPropTypes) { - - -
- -
-
- -
-
-
+ + + + + + + ); } diff --git a/demo/src/__tests__/MemoryModelsUserInput.spec.tsx b/demo/src/__tests__/MemoryModelsUserInput.spec.tsx index b1108aca..1e4751d2 100644 --- a/demo/src/__tests__/MemoryModelsUserInput.spec.tsx +++ b/demo/src/__tests__/MemoryModelsUserInput.spec.tsx @@ -133,9 +133,9 @@ describe("MemoryModelsUserInput", () => { jest.restoreAllMocks(); }); - it("does not render the modal when the page first loads", () => { - const modal = screen.queryByTestId("file-input-modal"); - expect(modal).toBeNull(); + it("does not render the dialog when the page first loads", () => { + const dialog = screen.queryByTestId("file-input-dialog"); + expect(dialog).toBeNull(); const input: HTMLInputElement = screen.queryByTestId("file-input"); expect(input).toBeNull();