fix #35: pass correct value to TootActionGroup
All checks were successful
/ depoly (push) Successful in 1m19s
All checks were successful
/ depoly (push) Successful in 1m19s
* add createDefaultTootEnv
This commit is contained in:
parent
6dd6065711
commit
5742932c86
7 changed files with 179 additions and 235 deletions
|
@ -24,13 +24,19 @@ function isolatedCallback(e: MouseEvent) {
|
|||
e.stopPropagation();
|
||||
}
|
||||
|
||||
/**
|
||||
* The actions of the toot card.
|
||||
*
|
||||
* The `value` must be the original toot (contains `reblog` if
|
||||
* it's a boost), since the value will be passed to the callbacks.
|
||||
*/
|
||||
function TootActionGroup<T extends mastodon.v1.Status>(props: {
|
||||
value: T;
|
||||
class?: string;
|
||||
}) {
|
||||
const { reply, boost, favourite, bookmark } = useTootEnv();
|
||||
let actGrpElement: HTMLDivElement;
|
||||
const toot = () => props.value;
|
||||
const toot = () => props.value.reblog ?? props.value;
|
||||
return (
|
||||
<div
|
||||
ref={actGrpElement!}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue