diff options
author | Phil <letsphil12@gmail.com> | 2023-06-16 19:35:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-16 19:35:50 +0200 |
commit | e8d90d2b45e8be0595f75454429fc1a5cedb4e33 (patch) | |
tree | 68c24a51d3fe3ba00d7a4314989e5c9ddbdf5403 /src/utils/modal.tsx | |
parent | 55af40ee747fbf872eb5bb07a49ea4cd276e8c34 (diff) | |
download | Vencord-e8d90d2b45e8be0595f75454429fc1a5cedb4e33.tar.gz Vencord-e8d90d2b45e8be0595f75454429fc1a5cedb4e33.tar.bz2 Vencord-e8d90d2b45e8be0595f75454429fc1a5cedb4e33.zip |
feat(plugin): BiggerStreamPreview (#1222)
Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src/utils/modal.tsx')
-rw-r--r-- | src/utils/modal.tsx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/utils/modal.tsx b/src/utils/modal.tsx index 05d235f..4ac6f9b 100644 --- a/src/utils/modal.tsx +++ b/src/utils/modal.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { filters, mapMangledModuleLazy } from "@webpack"; +import { filters, findByCode, mapMangledModuleLazy } from "@webpack"; import type { ComponentType, PropsWithChildren, ReactNode, Ref } from "react"; import { LazyComponent } from "./react"; @@ -107,6 +107,25 @@ export const Modals = mapMangledModuleLazy(".closeWithCircleBackground", { }>; }; +export type ImageModal = ComponentType<{ + className?: string; + src: string; + placeholder: string; + original: string; + width?: number; + height?: number; + animated?: boolean; + responsive?: boolean; + renderLinkComponent(props: any): ReactNode; + maxWidth?: number; + maxHeight?: number; + shouldAnimate?: boolean; + onClose?(): void; + shouldHideMediaOptions?: boolean; +}>; + +export const ImageModal = LazyComponent(() => findByCode(".renderLinkComponent", ".responsive") as ImageModal); + export const ModalRoot = LazyComponent(() => Modals.ModalRoot); export const ModalHeader = LazyComponent(() => Modals.ModalHeader); export const ModalContent = LazyComponent(() => Modals.ModalContent); |