Update dialog logic to support defining buttons/icon from anywhere
This commit is contained in:
parent
48af9bced1
commit
7c4028f8f1
9 changed files with 182 additions and 121 deletions
13
resources/scripts/components/elements/dialog/context.ts
Normal file
13
resources/scripts/components/elements/dialog/context.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import React from 'react';
|
||||
|
||||
interface DialogContextType {
|
||||
icon: React.RefObject<HTMLDivElement | undefined>;
|
||||
buttons: React.RefObject<HTMLDivElement | undefined>;
|
||||
}
|
||||
|
||||
const DialogContext = React.createContext<DialogContextType>({
|
||||
icon: React.createRef(),
|
||||
buttons: React.createRef(),
|
||||
});
|
||||
|
||||
export default DialogContext;
|
Reference in a new issue