This commit is contained in:
Shusui MOYATANI
2023-03-01 00:31:04 +09:00
parent 57bc321436
commit 471b03eb1d
20 changed files with 279 additions and 118 deletions

View File

@@ -19,17 +19,25 @@ const DeprecatedRepost: Component<DeprecatedRepostProps> = (props) => {
const eventId = () => props.event.tags.find(([tagName]) => tagName === 'e')?.[1];
const { profile } = useProfile(() => ({ relayUrls: config().relayUrls, pubkey: pubkey() }));
const { event } = useEvent(() => ({ relayUrls: config().relayUrls, eventId: eventId() }));
const { event, query: eventQuery } = useEvent(() => ({
relayUrls: config().relayUrls,
eventId: eventId(),
}));
return (
<div>
<div class="flex content-center px-1 text-xs">
<div class="h-5 w-5 pr-1 text-green-500" aria-hidden="true">
<div class="flex content-center px-1 text-xs">
<div class="h-5 w-5 shrink-0 pr-1 text-green-500" aria-hidden="true">
<ArrowPathRoundedSquare />
</div>
<div>{profile()?.display_name} Reposted</div>
<div class="truncate">
<Show when={(profile()?.display_name?.length ?? 0) > 0} fallback={props.event.pubkey}>
{profile()?.display_name}
</Show>
{' Reposted'}
</div>
</div>
<Show when={event() != null} fallback={'loading'}>
<Show when={event() != null} fallback={<Show when={eventQuery.isLoading}>loading</Show>}>
<TextNote event={event()} />
</Show>
</div>