BottomSheet: backward animation

This commit is contained in:
thislight 2024-08-12 21:55:26 +08:00
parent 0d856c61c7
commit c461ae72f8
No known key found for this signature in database
GPG key ID: A50F9451AC56A63E
9 changed files with 150 additions and 75 deletions

View file

@ -2,9 +2,7 @@ import type { mastodon } from "masto";
import { type Component, For, createSignal } from "solid-js";
import { css } from "solid-styled";
import tootStyle from "./toot.module.css";
import { Portal } from "solid-js/web";
import MediaViewer, { MEDIA_VIEWER_HEROSRC } from "./MediaViewer";
import { HeroSourceProvider } from "../platform/anim";
import MediaViewer from "./MediaViewer";
const MediaAttachmentGrid: Component<{
attachments: mastodon.v1.MediaAttachment[];
@ -58,13 +56,6 @@ const MediaAttachmentGrid: Component<{
}
}}
</For>
<HeroSourceProvider
value={() => ({
[MEDIA_VIEWER_HEROSRC]: rootRef.children.item(
viewerIndex() || 0,
) as HTMLElement,
})}
>
<MediaViewer
show={viewerOpened()}
index={viewerIndex() || 0}
@ -72,7 +63,6 @@ const MediaAttachmentGrid: Component<{
media={props.attachments}
onClose={() => setViewerIndex(undefined)}
/>
</HeroSourceProvider>
</section>
);
};