BottomSheet: backward animation

This commit is contained in:
thislight 2024-08-12 21:55:26 +08:00
parent 6e014324de
commit 80de0e52ee
9 changed files with 150 additions and 75 deletions

View file

@ -12,7 +12,7 @@ export type HeroSource = {
[key: string | symbol | number]: DOMRect | undefined;
};
const HeroSourceContext = createContext<Signal<HeroSource>>(undefined);
const HeroSourceContext = createContext<Signal<HeroSource>>(/* __@PURE__ */undefined);
export const HeroSourceProvider = HeroSourceContext.Provider;
@ -20,6 +20,9 @@ function useHeroSource() {
return useContext(HeroSourceContext);
}
/**
* Use hero value for the {@link key}.
*/
export function useHeroSignal(
key: string | symbol | number,
): Accessor<DOMRect | undefined> {
@ -29,7 +32,6 @@ export function useHeroSignal(
createRenderEffect(() => {
const value = source[0]();
console.debug("value", value);
if (value[key]) {
set(value[key]);
source[1]((x) => {