Remove popular tab

This commit is contained in:
Jonathan Staab 2023-02-22 09:50:06 -06:00
parent 419a57b7f7
commit 0dd528f0b6
5 changed files with 11 additions and 37 deletions

View File

@ -39,7 +39,7 @@
class="py-2 px-3 flex flex-col gap-2 text-white cursor-pointer transition-all
border border-solid border-black hover:border-medium hover:bg-dark text-left"
on:click={() => modal.set({type: 'note/detail', note})}>
<div class="flex gap-2 items-center justify-between relative">
<div class="flex gap-2 items-center justify-between relative w-full">
<button class="cursor-pointer" on:click={openPopover}>
{quantify(pubkeys.length, 'person', 'people')} {actionText}.
</button>

View File

@ -1,7 +1,7 @@
<script lang="ts">
import cx from 'classnames'
import {nip19} from 'nostr-tools'
import {last, always, whereEq, without, uniq, pluck, reject, propEq, find} from 'ramda'
import {last, whereEq, without, uniq, pluck, reject, propEq, find} from 'ramda'
import {onMount} from 'svelte'
import {tweened} from 'svelte/motion'
import {slide} from 'svelte/transition'
@ -28,7 +28,6 @@
export let anchorId = null
export let showParent = true
export let invertColors = false
export let shouldDisplay = always(true)
const getDefaultReplyMentions = () =>
without([user.getPubkey()], uniq(Tags.from(note).type("p").values().all().concat(note.pubkey)))
@ -204,7 +203,7 @@
}}
/>
{#if $person && shouldDisplay(note)}
{#if $person}
<div bind:this={noteContainer} class="note relative">
<div class="absolute w-px bg-light z-10 ml-8 mt-12 h-0" bind:this={border} />
<Card class="flex gap-4 relative" on:click={onClick} {interactive} {invertColors}>
@ -324,13 +323,7 @@
</button>
{/if}
{#each note.replies.slice(showEntire ? 0 : -3) as r (r.id)}
<svelte:self
showParent={false}
note={r}
depth={depth - 1}
{invertColors}
{anchorId}
{shouldDisplay} />
<svelte:self showParent={false} note={r} depth={depth - 1} {invertColors} {anchorId} />
{/each}
</div>
{/if}

View File

@ -1,6 +1,6 @@
<script lang="ts">
import {onMount} from 'svelte'
import {partition, last, propEq, always, uniqBy, sortBy, prop} from 'ramda'
import {partition, last, propEq, uniqBy, sortBy, prop} from 'ramda'
import {slide} from 'svelte/transition'
import {quantify} from 'hurdak/lib/hurdak'
import {createScroller, now, Cursor} from 'src/util/misc'
@ -15,7 +15,6 @@
export let filter
export let relays = []
export let shouldDisplay = always(true)
let notes = []
let notesBuffer = []
@ -59,7 +58,7 @@
// Drop notes at the end if there are a lot
notes = uniqBy(
prop('id'),
notesBuffer.filter(shouldDisplay).concat(notes).slice(0, maxNotes)
notesBuffer.concat(notes).slice(0, maxNotes)
)
notesBuffer = []
@ -98,18 +97,18 @@
</script>
<Content size="inherit" class="pt-6">
{#if notesBuffer.filter(shouldDisplay).length > 0}
{#if notesBuffer.length > 0}
<button
in:slide
class="cursor-pointer text-center underline text-light"
on:click={loadBufferedNotes}>
Load {quantify(notesBuffer.filter(shouldDisplay).length, 'new note')}
Load {quantify(notesBuffer.length, 'new note')}
</button>
{/if}
<div>
{#each notes as note (note.id)}
<Note depth={2} {note} {shouldDisplay} />
<Note depth={2} {note} />
{/each}
</div>

View File

@ -6,7 +6,6 @@
import Tabs from "src/partials/Tabs.svelte"
import Follows from "src/views/notes/Follows.svelte"
import Network from "src/views/notes/Network.svelte"
import Popular from "src/views/notes/Popular.svelte"
import user from 'src/agent/user'
export let activeTab
@ -22,13 +21,11 @@
</Content>
{/if}
<div>
<Tabs tabs={['follows', 'network', 'popular']} {activeTab} {setActiveTab} />
<Tabs tabs={['follows', 'network']} {activeTab} {setActiveTab} />
{#if activeTab === 'follows'}
<Follows />
{:else if activeTab === 'network'}
<Network />
{:else}
<Popular />
<Network />
{/if}
</div>
</Content>

View File

@ -1,15 +0,0 @@
<script>
import Notes from "src/partials/Notes.svelte"
import {isLike} from 'src/util/nostr'
const filter = {kinds: [1, 7]}
const shouldDisplay = note => {
return (
note.reactions.filter(isLike).length > 2
|| note.replies.length > 2
)
}
</script>
<Notes {filter} {shouldDisplay} />