aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-09-08 22:25:21 +0200
committerVendicated <vendicated@riseup.net>2022-09-08 22:25:21 +0200
commit6099179f0230e3c6eb449a2cd7f6a5c5d79201f2 (patch)
tree78d3eede2c9ca882481989523680de4c317032dd /src/utils
parente52225304e47d92bf1b84f5a2c8e97ab57bd85a4 (diff)
downloadVencord-6099179f0230e3c6eb449a2cd7f6a5c5d79201f2.tar.gz
Vencord-6099179f0230e3c6eb449a2cd7f6a5c5d79201f2.tar.bz2
Vencord-6099179f0230e3c6eb449a2cd7f6a5c5d79201f2.zip
ViewIcons: Now opens icons in image viewer
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/modal.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils/modal.tsx b/src/utils/modal.tsx
index 5628ebe..63821f3 100644
--- a/src/utils/modal.tsx
+++ b/src/utils/modal.tsx
@@ -1,8 +1,8 @@
import Components from "discord-types/components";
import { waitFor } from "../webpack";
-let Modal: Components.Modal;
-let modals: any;
+export let Modal: Components.Modal;
+export let modals: any;
waitFor("openModalLazy", m => modals = m);
waitFor("ModalRoot", m => Modal = m);
@@ -14,10 +14,10 @@ let modalId = 1337;
* @param Component The component to render in the modal
* @returns The key of this modal. This can be used to close the modal later with closeModal
*/
-export function openModal(Component: React.ComponentType) {
+export function openModal(Component: React.ComponentType, modalProps: Record<string, any>) {
let key = `Vencord${modalId++}`;
modals.openModal(props =>
- <Modal.ModalRoot {...props}>
+ <Modal.ModalRoot {...props} {...modalProps}>
<Component />
</Modal.ModalRoot>
, { modalKey: key });