adjust thread visual

This commit is contained in:
thislight 2024-10-12 19:48:34 +08:00
parent 2b2b5ea1ae
commit 295a905b8b
5 changed files with 131 additions and 64 deletions
src/timelines

View file

@ -113,27 +113,29 @@ const TimelinePanel: Component<{
</Show>
<For each={timeline.list}>
{(itemId, index) => {
let element: HTMLElement | undefined;
const path = timeline.getPath(itemId)!;
const toots = path.reverse().map((x) => x.value);
return (
<Thread
ref={element}
toots={toots}
onBoost={onBoost}
onBookmark={onBookmark}
onReply={(client, status) =>
props.openFullScreenToot(status, element, true)
onReply={
({ status }, element) =>
props.openFullScreenToot(status, element, true)
}
client={props.client}
isExpended={(status) => status.id === expandedThreadId()}
onItemClick={(status) => {
onItemClick={(status, event) => {
setTyping(false);
if (status.id !== expandedThreadId()) {
setExpandedThreadId((x) => (x ? undefined : status.id));
} else {
props.openFullScreenToot(status, element);
props.openFullScreenToot(
status,
event.currentTarget as HTMLElement,
);
}
}}
/>