Skip to content

Commit

Permalink
Merge pull request #118 from SnowCait/loading-timeline-animation
Browse files Browse the repository at this point in the history
Loading timeline animation
  • Loading branch information
SnowCait authored Mar 26, 2023
2 parents 3f642b8 + c6a119f commit fb5f659
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
10 changes: 10 additions & 0 deletions web/src/routes/TimelineView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
import Reaction from './timeline/Reaction.svelte';
import { pubkey } from '../stores/Author';
import { Author } from '$lib/Author';
import Loading from './Loading.svelte';
export let events: Event[] = [];
export let readonly = false;
export let focusEventId: string | undefined = undefined;
export let load: () => Promise<void>;
export let showLoading = true;
export let createdAtFormat: 'auto' | 'time' = 'auto';
let loading = false;
Expand Down Expand Up @@ -55,6 +57,9 @@
</li>
{/each}
</ul>
{#if showLoading}
<div class="loading"><Loading /></div>
{/if}

<style>
ul {
Expand All @@ -79,6 +84,11 @@
border-left: 2px solid lightcoral;
}
.loading {
width: 24px;
margin: 0 auto;
}
@keyframes add {
0% {
opacity: 0;
Expand Down
8 changes: 7 additions & 1 deletion web/src/routes/[note=note]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,10 @@

<h1>note</h1>

<TimelineView {events} readonly={false} focusEventId={eventId} load={async () => console.debug()} />
<TimelineView
{events}
readonly={false}
focusEventId={eventId}
load={async () => console.debug()}
showLoading={false}
/>
1 change: 0 additions & 1 deletion web/src/routes/[npub=npub]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@
events={notes}
readonly={!$authorPubkey}
load={async () => {
console.warn('load', pubkey);
const oldestCreatedAt = notes.at(notes.length - 1)?.created_at;
const events = await fetchPastNotes(
pubkey,
Expand Down
7 changes: 6 additions & 1 deletion web/src/routes/search/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@

<NoteIdsView />

<TimelineView events={$searchEvents} readonly={true} load={async () => console.debug()} />
<TimelineView
events={$searchEvents}
readonly={true}
load={async () => console.debug()}
showLoading={false}
/>

<style>
h1 a {
Expand Down

1 comment on commit fb5f659

@vercel
Copy link

@vercel vercel bot commented on fb5f659 Mar 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nostter – ./

nostter-git-main-snowcait.vercel.app
nostter-snowcait.vercel.app
nostter.vercel.app

Please sign in to comment.