Settings 2.0 (#107)

Co-authored-by: Vendicated <vendicated@riseup.net>
This commit is contained in:
megumin 2022-10-17 20:18:25 +01:00 committed by GitHub
parent ae730e8398
commit 5625d63e46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 945 additions and 192 deletions

View file

@ -1,7 +1,7 @@
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { lazyWebpack, makeLazy } from "../utils/misc";
import { ModalSize, openModal } from "../utils/modal";
import { ModalRoot, ModalSize, openModal } from "../utils/modal";
import { find } from "../webpack";
import { React } from "../webpack/common";
@ -15,14 +15,16 @@ export default definePlugin({
description: "Makes Avatars/Banners in user profiles clickable, and adds Guild Context Menu Entries to View Banner/Icon.",
openImage(url: string) {
openModal(() => (
<ImageModal
shouldAnimate={true}
original={url}
src={url}
renderLinkComponent={props => React.createElement(getMaskedLink(), props)}
/>
), { size: ModalSize.DYNAMIC });
openModal(modalProps => (
<ModalRoot size={ModalSize.DYNAMIC} {...modalProps}>
<ImageModal
shouldAnimate={true}
original={url}
src={url}
renderLinkComponent={props => React.createElement(getMaskedLink(), props)}
/>
</ModalRoot>
));
},
patches: [