BottomSheet: improve hero animation

This commit is contained in:
thislight 2024-10-09 17:33:27 +08:00
parent 70649e97e6
commit bcfb846115
No known key found for this signature in database
GPG key ID: A50F9451AC56A63E
5 changed files with 11 additions and 9 deletions
src/platform

View file

@ -9,7 +9,7 @@ import {
} from "solid-js";
export type HeroSource = {
[key: string | symbol | number]: DOMRect | undefined;
[key: string | symbol | number]: HTMLElement | undefined;
};
const HeroSourceContext = createContext<Signal<HeroSource>>(
@ -27,10 +27,10 @@ function useHeroSource() {
*/
export function useHeroSignal(
key: string | symbol | number,
): Signal<DOMRect | undefined> {
): Signal<HTMLElement | undefined> {
const source = useHeroSource();
if (source) {
const [get, set] = createSignal<DOMRect>();
const [get, set] = createSignal<HTMLElement>();
createRenderEffect(() => {
const value = source[0]();