diff --git a/src/App.js b/src/App.js
index 9fbb1fc..34f0457 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,4 +1,5 @@
import React, { useState, useEffect, useRef, useMemo, createContext, useContext, useCallback } from 'react';
+import { createPortal } from 'react-dom';
import * as shared from '@ttrpg/shared';
import { initializeApp, getAuth, signInAnonymously, onAuthStateChanged, signInWithCustomToken, getFirestore, where, orderBy, limit, offset, getStorage, getStorageMode } from './storage';
import { isDevToolsEnabled } from './config/devTools';
@@ -35,7 +36,7 @@ function ToastStack({ toasts, onDismiss }) {
function InfoModal({ message, onClose }) {
if (!message) return null;
return (
-
+
@@ -346,8 +347,8 @@ function Modal({ onClose, title, children }) {
return () => window.removeEventListener('keydown', handleEsc);
}, [onClose]);
- return (
-
+ return createPortal(
+
{title}
@@ -357,7 +358,8 @@ function Modal({ onClose, title, children }) {
{children}
-
+
,
+ document.body
);
}
@@ -391,8 +393,8 @@ function ConfirmationModal({ isOpen, onClose, onConfirm, title, message }) {
onClose();
};
- return (
-
+ return createPortal(
+
@@ -419,7 +421,8 @@ function ConfirmationModal({ isOpen, onClose, onConfirm, title, message }) {
-
+
,
+ document.body
);
}
@@ -846,7 +849,7 @@ function CharacterManager({ campaignId, campaignCharacters, syncCharacters }) {
return (
<>
-
+