BottomSheet: improve hero animation
This commit is contained in:
parent
71434e5293
commit
15e2bf3304
5 changed files with 11 additions and 9 deletions
|
@ -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]();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue