BottomSheet: improve hero animation

This commit is contained in:
thislight 2024-10-09 17:33:27 +08:00
parent 71434e5293
commit 15e2bf3304
5 changed files with 11 additions and 9 deletions

View file

@ -340,8 +340,7 @@ const Home: ParentComponent = (props) => {
console.warn("no account info?");
return;
}
const rect = srcElement?.getBoundingClientRect();
setHeroSrc((x) => Object.assign({}, x, { [BOTTOM_SHEET_HERO]: rect }));
setHeroSrc((x) => Object.assign({}, x, { [BOTTOM_SHEET_HERO]: srcElement }));
const acct = `${inf.username}@${p.account.site}`;
setTootBottomSheetCache(acct, toot);
navigate(`/${encodeURIComponent(acct)}/${toot.id}`, {