forked from abner/for-legacy-web
feat: port ImageViewer
This commit is contained in:
@@ -3,9 +3,8 @@ import { API } from "revolt.js";
|
||||
|
||||
import styles from "./Embed.module.scss";
|
||||
|
||||
import { useIntermediate } from "../../../../context/intermediate/Intermediate";
|
||||
|
||||
import { useClient } from "../../../../controllers/client/ClientController";
|
||||
import { modalController } from "../../../../controllers/modals/ModalController";
|
||||
|
||||
interface Props {
|
||||
embed: API.Embed;
|
||||
@@ -15,7 +14,6 @@ interface Props {
|
||||
|
||||
export default function EmbedMedia({ embed, width, height }: Props) {
|
||||
if (embed.type !== "Website") return null;
|
||||
const { openScreen } = useIntermediate();
|
||||
const client = useClient();
|
||||
|
||||
switch (embed.special?.type) {
|
||||
@@ -118,8 +116,8 @@ export default function EmbedMedia({ embed, width, height }: Props) {
|
||||
loading="lazy"
|
||||
style={{ width, height }}
|
||||
onClick={() =>
|
||||
openScreen({
|
||||
id: "image_viewer",
|
||||
modalController.push({
|
||||
type: "image_viewer",
|
||||
embed: embed.image!,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user