feat: create confirm dialog to use instead of window.confirm (#4256)

* feat: create confirm dialog to use instead of window.confirm

* move confirm to right

* add types

* less margin
This commit is contained in:
Aakansha Doshi 2021-11-16 18:55:56 +05:30 committed by GitHub
parent b9abcc825a
commit 3ff9744b39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 76 additions and 51 deletions

View file

@ -10,7 +10,7 @@ import { Island } from "./Island";
import { Modal } from "./Modal";
import { AppState } from "../types";
export const Dialog = (props: {
export interface DialogProps {
children: React.ReactNode;
className?: string;
small?: boolean;
@ -18,7 +18,8 @@ export const Dialog = (props: {
title: React.ReactNode;
autofocus?: boolean;
theme?: AppState["theme"];
}) => {
}
export const Dialog = (props: DialogProps) => {
const [islandNode, setIslandNode] = useCallbackRefState<HTMLDivElement>();
const [lastActiveElement] = useState(document.activeElement);
const { id } = useExcalidrawContainer();