-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
problem: scroll position is all over the place
- Loading branch information
1 parent
f8b96a2
commit 632406c
Showing
3 changed files
with
125 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,54 @@ | ||
<script lang="ts"> | ||
import RenderNoteContent from '@/components/RenderNoteContent.svelte'; | ||
import Marcus from './Marcus.svelte'; | ||
import type { NostrEvent } from 'nostr-tools'; | ||
import Zap from './Zap.svelte'; | ||
import Reply from './Reply.svelte'; | ||
import { derived, type Writable } from 'svelte/store'; | ||
import type { FrontendData } from '@/snort_workers/types'; | ||
import { viewed } from '@/workers_snort/firehose_master'; | ||
import { onMount } from 'svelte'; | ||
import RenderNoteContent from "@/components/RenderNoteContent.svelte"; | ||
import Marcus from "./Marcus.svelte"; | ||
import type { NostrEvent } from "nostr-tools"; | ||
import Zap from "./Zap.svelte"; | ||
import Reply from "./Reply.svelte"; | ||
import { derived, type Writable } from "svelte/store"; | ||
import type { FrontendData } from "@/snort_workers/types"; | ||
import { viewed } from "@/workers_snort/firehose_master"; | ||
export let note: NostrEvent; | ||
export let store: Writable<FrontendData>; | ||
export let note:NostrEvent | ||
export let store: Writable<FrontendData> | ||
let top: HTMLDivElement; | ||
$:childrenCount = $store?.replies.get(note.id)?$store.replies.get(note.id)!.size:0 | ||
onMount(() => { | ||
(async () => { | ||
top.scrollIntoView() | ||
//top.scrollIntoView() | ||
})(); | ||
}); | ||
$: childrenCount = $store?.replies.get(note.id) ? $store.replies.get(note.id)!.size : 0; | ||
</script> | ||
<div class="w-full mt-2"> | ||
<div class="grid"> | ||
<div class="flex gap-2"> | ||
<img | ||
class="w-8 h-8 rounded-full" | ||
src="https://zenquotes.io/img/marcus-aurelius.jpg" | ||
alt="profile pic" | ||
/> | ||
<div class="grid"> | ||
<h5 class="text-gray-900 dark:text-orange-600 font-semibold leading-snug pb-1">Marcus</h5> | ||
<div class="grid overflow-hidden mr-2 min-w-56"> | ||
<div class="px-3.5 py-2 bg-fuchsia-300 dark:bg-fuchsia-950 rounded-e-xl rounded-es-xl flex flex-col gap-2"> | ||
<h5 class="text-sm font-normal text-gray-900 dark:text-white py-2"> | ||
<RenderNoteContent inputString={note.content} /> | ||
</h5> | ||
</div> | ||
<div class="justify-end items-center inline-flex"> | ||
<h6 class="text-gray-500 text-xs font-normal leading-4 py-1"> | ||
{new Date(note.created_at * 1000).toLocaleString()}{#if $viewed.has(note.id)}✓{/if} | ||
</h6> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div bind:this={top} class="w-full mt-2"> | ||
<div class="grid"> | ||
<div class="flex gap-2"> | ||
<img | ||
class="w-8 h-8 rounded-full" | ||
src="https://zenquotes.io/img/marcus-aurelius.jpg" | ||
alt="profile pic" | ||
/> | ||
<div class="grid"> | ||
<h5 class="text-gray-900 dark:text-orange-600 font-semibold leading-snug pb-1">Marcus</h5> | ||
<div class="grid overflow-hidden mr-2 min-w-56"> | ||
<div | ||
class="px-3.5 py-2 bg-fuchsia-300 dark:bg-fuchsia-950 rounded-e-xl rounded-es-xl flex flex-col gap-2" | ||
> | ||
<h5 class="text-sm font-normal text-gray-900 dark:text-white py-2"> | ||
<RenderNoteContent inputString={note.content} /> | ||
</h5> | ||
</div> | ||
<div class="justify-end items-center inline-flex"> | ||
<h6 class="text-gray-500 text-xs font-normal leading-4 py-1"> | ||
{new Date(note.created_at * 1000).toLocaleString()}{#if $viewed.has(note.id)}✓{/if} | ||
</h6> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |