BottomSheet: improve hero animation
This commit is contained in:
parent
70649e97e6
commit
bcfb846115
5 changed files with 11 additions and 9 deletions
|
@ -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}`, {
|
||||
|
|
|
@ -185,7 +185,6 @@ function randomChoose<T extends any[]>(
|
|||
K: T,
|
||||
): T extends Array<infer E> ? E : never {
|
||||
const idx = Math.floor(rn * K.length);
|
||||
console.log(idx, K.length);
|
||||
return K[idx];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue