e.stopPropagation()} actions={false}>
-
- {!props.nonDismissable && (
-
-
-
- )}
-
+ {!props.withoutCloseButton && (
+
+ {!props.nonDismissable && (
+
+
+
+ )}
+
+ )}
{(title || description) && (
{title && typeof title === "string" ? {title} : title}
diff --git a/src/components/modals/index.ts b/src/components/modals/index.ts
index 08916cb..7d64b47 100644
--- a/src/components/modals/index.ts
+++ b/src/components/modals/index.ts
@@ -1,11 +1,11 @@
export * from "./AddServerModal";
-export * from "./AttachmentPreviewModal";
export * from "./BanMemberModal";
export * from "./CreateInviteModal";
export * from "./CreateServerModal";
export * from "./DeleteMessageModal";
export * from "./ErrorModal";
export * from "./ForgotPasswordModal";
+export * from "./ImageViewerModal";
export * from "./JoinServerModal";
export * from "./KickMemberModal";
export * from "./LeaveServerModal";
diff --git a/src/controllers/modals/ModalController.tsx b/src/controllers/modals/ModalController.tsx
index 4f34d2b..df99e80 100644
--- a/src/controllers/modals/ModalController.tsx
+++ b/src/controllers/modals/ModalController.tsx
@@ -8,6 +8,7 @@ import {
CreateServerModal,
DeleteMessageModal,
ErrorModal,
+ ImageViewerModal,
JoinServerModal,
KickMemberModal,
LeaveServerModal,
@@ -162,7 +163,7 @@ export const modalController = new ModalControllerExtended({
// custom_status: CustomStatus,
delete_message: DeleteMessageModal,
error: ErrorModal,
- // image_viewer: ImageViewer,
+ image_viewer: ImageViewerModal,
kick_member: KickMemberModal,
// link_warning: LinkWarning,
// mfa_flow: MFAFlow,
diff --git a/src/controllers/modals/types.ts b/src/controllers/modals/types.ts
index c7289a5..688b544 100644
--- a/src/controllers/modals/types.ts
+++ b/src/controllers/modals/types.ts
@@ -1,5 +1,6 @@
// adapted from https://github.com/revoltchat/revite/blob/master/src/controllers/modals/types.ts
+import { APIAttachment, APIEmbedImage, APIEmbedThumbnail } from "@spacebarchat/spacebar-api-types/v9";
import Channel from "../../stores/objects/Channel";
import Guild from "../../stores/objects/Guild";
import GuildMember from "../../stores/objects/GuildMember";
@@ -42,6 +43,12 @@ export type Modal = {
type: "leave_server";
target: Guild;
}
+ | {
+ type: "image_viewer";
+ attachment: APIAttachment | APIEmbedImage | APIEmbedThumbnail;
+ width?: number;
+ height?: number;
+ }
);
export type ModalProps = Modal & { type: T } & {